PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Analytics & Experimentation/Optiver

Simulate return-weighted rebalancing strategy

Last updated: Mar 29, 2026

Quick Overview

This question evaluates competency in quantitative portfolio analytics within the Analytics & Experimentation category, focusing on time-series manipulation, numerical computation of log-returns, and implementation of a momentum-weighted daily rebalancing strategy under edge conditions.

  • 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: This question evaluates competency in quantitative portfolio analytics within the Analytics & Experimentation category, focusing on time-series manipulation, numerical computation of log-returns, and implementation of a momentum-weighted daily rebalancing strategy under edge conditions.

Related Interview Questions

  • Design and backtest a trading strategy - Optiver (hard)
Optiver logo
Optiver
Jul 16, 2025, 12:00 AM
Software Engineer
Technical Screen
Analytics & Experimentation
3
0

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].

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

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

Master your tech interviews with 7,500+ 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
  • Compare Platforms
  • Discord Community

Support

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

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.