Generator Exhaustion Behavior - Quant Trader Interview Question
Difficulty: Medium
Category: Code Analysis
Practice quant interview questions from top firms including Jane Street, Citadel, Two Sigma, DE Shaw, and other leading quantitative finance companies.
Topics: python, generators, iterators, code-analysis
Problem Description
You are backtesting a trading strategy using a Python generator to simulate streaming market data. The generator market_data() yields price updates. You need to analyze the first 1000 price updates twice for different risk models.
Why does the second for loop not produce any output?
Practice this medium trader interview question on MyntBit - the all-in-one quant learning platform with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.