← AkunaCapital Interview Insights
Start by clarifying requirements (latency, throughput, window type, threshold semantics) and then design a streaming pipeline with a ring buffer for the moving average and a state machine for signal emission. Discuss trade-offs between exact and approximate methods, and how to handle out-of-order or missing data.
Pro tip: Emphasize that the moving average and signal logic must be idempotent and deterministic per event to ensure correctness in replay or recovery scenarios, and mention that you would use a monotonic clock for latency measurements.
Ask about expected message rate, latency requirements, window size, threshold value, and whether the signal should be emitted once per crossing or continuously while above/below.
Outline a pipeline: ingest (e.g., Kafka), compute moving average (e.g., using a ring buffer or exponential moving average), compare to threshold, and emit signal (e.g., to a trading engine).
Discuss simple moving average (SMA) with a ring buffer for O(1) updates, or exponential moving average (EMA) for lower memory and recency weighting. Mention trade-offs in accuracy and responsiveness.
Maintain a boolean state (above/below threshold) and emit a signal only on state change. Handle edge cases like exactly equal to threshold and initial state.
Discuss partitioning by symbol, handling out-of-order events with watermarks, exactly-once semantics, and how to test with historical data and simulated streams.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.