PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Analytics & Experimentation/Optiver

Simulate return-weighted rebalancing strategy

Last updated: Mar 29, 2026

Quick Overview

Simulate return-weighted rebalancing strategy evaluates metric design, causal reasoning, experiment setup, diagnostics, SQL/statistical checks, and recommendations in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

  • medium
  • Optiver
  • Analytics & Experimentation
  • Software Engineer

Simulate return-weighted rebalancing strategy

Company: Optiver

Role: Software Engineer

Category: Analytics & Experimentation

Difficulty: medium

Interview Round: Technical Screen

You are given an N×T matrix prices where prices[i][t] is the end‑of‑day price of asset i on day t (t = 0…T− 1). Start with total capital C in cash on day 0. For each day t ≥ 1, compute simple returns r_i(t) = prices[i][t]/prices[i][t−1] − 1. If all r_i(t) ≤ 0, hold 100% cash for the next day. Otherwise, set next‑day portfolio weights proportional to the positive returns: w_i(t) = r_i(t) / Σ_{j: r_j(t) > 0} r_j(t) for r_i(t) > 0, and w_i(t) = 0 otherwise. Rebalance at the close of day t using these weights; fractional shares and zero transaction costs are allowed. Let V_t be portfolio value at the close of day t. The daily log return for period t→t+1 is ln(V_{t+1}/V_t). Compute and return [mean_log_return, stddev_log_return] over all T−1 daily log returns.

Quick Answer: Simulate return-weighted rebalancing strategy evaluates metric design, causal reasoning, experiment setup, diagnostics, SQL/statistical checks, and recommendations in a realistic interview setting. A strong answer states assumptions, handles edge cases, explains trade-offs, and shows how to validate the result clearly.

Related Interview Questions

  • Design and backtest a trading strategy - Optiver (hard)
|Home/Analytics & Experimentation/Optiver

Simulate return-weighted rebalancing strategy

Optiver logo
Optiver
Jul 16, 2025, 12:00 AM
mediumSoftware EngineerTechnical ScreenAnalytics & Experimentation
5
0

Simulate return-weighted rebalancing strategy

Problem: Momentum-weighted daily log-return statistics

You have N assets with end-of-day prices over T trading days. Let prices[i][t] be the closing price of asset i on day t (i = 0..N−1, t = 0..T−1). You start with total capital C in cash at the close of day 0. Fractional shares and zero transaction costs are allowed.

At each day t ≥ 1:

  1. Compute simple returns r_i(t) = prices[i][t] / prices[i][t−1] − 1.
  2. Set next-day portfolio weights for period t→t+1 as follows:
    • If all r_i(t) ≤ 0, hold 100% cash for the next day (i.e., all asset weights are 0).
    • Otherwise, assign weights only to assets with positive returns, proportional to those returns: w_i(t) = r_i(t) / Σ_{j: r_j(t) > 0} r_j(t) if r_i(t) > 0; else w_i(t) = 0.
  3. Rebalance at the close of day t using these weights.

Let V_t denote portfolio value at the close of day t. The daily log return for period t→t+1 is ln(V_{t+1}/V_t). Note:

  • For t = 0, there are no prior-day returns; treat period 0→1 as 100% cash (log return 0).

Task: Compute and return [mean_log_return, stddev_log_return] over all T−1 daily log returns L_t = ln(V_{t+1}/V_t), for t = 0..T−2.

Assume prices are positive. If T < 2, return [0.0, 0.0].

Constraints & Assumptions

  • Preserve the scope, facts, inputs, and requested outputs from the prompt above.
  • If the prompt leaves a detail unspecified, state a reasonable assumption before relying on it.
  • Keep the answer interview-ready: concise enough to present, but concrete enough to implement or evaluate.

Clarifying Questions to Ask

  • Clarify the business objective, unit of analysis, time window, exposure definition, and primary metric.
  • State assumptions about instrumentation, randomization, sample size, and data quality.
  • Separate descriptive analysis from causal claims.

What a Strong Answer Covers

  • A metric framework with primary, guardrail, and diagnostic metrics.
  • A credible analysis or experiment design with clear assumptions and bias checks.
  • SQL/statistical logic for segmentation, variance, confidence, and data validation where relevant.
  • An actionable recommendation that explains trade-offs and next steps.

Follow-up Questions

  • What sanity checks would you run before trusting the result?
  • How would you handle novelty effects, seasonality, or selection bias?
  • What decision would you make if metrics disagree?
Loading comments...

Browse More Questions

More Analytics & Experimentation•More Optiver•More Software Engineer•Optiver Software Engineer•Optiver Analytics & Experimentation•Software Engineer Analytics & Experimentation

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.