Katkat

How would you model stock price prediction?

MillenniumSoftware Engineer · Technical Screen

Last updated

This problem tests the candidate's ability to design an end-to-end machine learning pipeline for financial time-series forecasting, specifically focusing on the nuances of feature engineering and evaluation in a non-stationary environment.

Problem Statement

You are tasked with building a machine learning model to predict the price movement of a high-liquidity stock over the next 10 minutes. The objective is to inform an automated trading strategy that decides whether to go long or short on the asset.

Requirements

  1. Target Definition: How will you define the 'label' for this classification or regression task, and how do you handle noise in high-frequency price data?
  2. Feature Engineering: What features would you derive from the Limit Order Book (LOB) and historical trade data? Consider both spatial and temporal dependencies.
  3. Validation Strategy: Standard k-fold cross-validation is inappropriate for time-series data due to look-ahead bias and autocorrelation. Propose a robust validation framework.
  4. Evaluation Metrics: Beyond standard accuracy, what metrics are most relevant for a financial stakeholder, and why?
  5. Deployment: How would you handle model drift and the concept of 'concept drift' in financial markets?

Assumptions

  • You have access to tick-level data, LOB snapshots, and trade volume data.
  • The market exhibits non-stationary properties (the statistical properties change over time).
  • Latency requirements are such that your inference must complete in under 5 milliseconds.

Hints

Hint 1

Consider using Z-scores or rolling window statistics instead of raw price values to ensure your input features are stationary.

Hint 2

Think about 'Time Series Split' or 'Walk-forward Validation' to prevent the model from 'seeing' the future during training.

Hint 3

Discuss the trade-off between model complexity (e.g., Deep Learning) and the need for low-latency inference.

Follow-up questions

  • How would you address the significant class imbalance if you define your target as 'price movement > 0.05% threshold'?
  • What impact would transaction costs, slippage, and spread have on your model's real-world profitability vs. its statistical performance?
  • If the model performance degrades after two weeks in production, what specific steps would you take to diagnose and rectify the issue?