Logo

Coding preview

Looking for alpha

What this preview is

About this preview

Looking for alpha is a easy quant coding problem on language knowledge in Python, asked at Quant.

Unlock full access to getcracked

Join to unlock this problem, detailed solutions, and our complete library of quant finance interview prep.

Implementing a backtesting engine in Python

This easy coding problem asks you to build the core loop of a quantitative trading backtest: processing a stream of price data, executing trades according to a strategy function, and tracking two hard constraints—maximum drawdown and position size limits.

The problem tests your ability to manage state across multiple timesteps, handle account value and position tracking accurately, and enforce stopping conditions correctly. You'll need to distinguish between violations that halt all trading permanently (drawdown) and those that only restrict future trades (position limits), while correctly recording when each violation occurs and when a position constraint is lifted.

  • Position and cash accounting across trades
  • Conditional trade execution based on constraint state
  • Rounding financial values to two decimal places
  • Distinguishing violation types and their implications for future trading