KatInterview

Building a Home Valuation Model for a Metropolitan Housing Market

Machine LearningModel answer
HardModel answerMachine Learningml-system-designgeospatialfeature-engineering

Last updated

Design a production ML system that estimates residential sale prices across a large city, covering features, leakage-safe validation, modeling, fairness, deployment and error analysis.

You are asked to build a machine learning system that estimates the sale price of residential properties across a large city. It will be used as an automated valuation tool, so its outputs may influence lending or pricing decisions.

Describe your design for the following areas.

  1. Features and engineering

    • Which signals would you use (location, transit access, school quality, neighborhood effects, timing of the sale, broader economic conditions)?
    • How would you turn raw data into features, for example distances to points of interest or features that summarize nearby sales?
    • How would you encode categorical variables with very many levels?
  2. Validation and metrics

    • How would you split data so that neither time nor geography leaks information into evaluation?
    • Which metrics would you report, and why?
  3. Modeling and interpretability

    • Compare gradient-boosted trees, random forests, and a linear model with interactions.
    • Which would you choose, and how would you explain individual predictions?
  4. Fairness and compliance

    • How would you detect and mitigate proxies for protected characteristics, such as historical redlining patterns?
  5. Operations

    • How would you deploy and monitor the system?
    • How would you run ablation studies and analyze errors after launch?

State your assumptions about scale, latency and intended use before you begin.

Hints

Hint 1

Start by clarifying the use case and the target: which sales count as valid (arm's-length only), what latency is needed, and whether regulation applies. These choices drive everything else.

Hint 2

Leakage comes from two directions. Prices drift over time and neighboring sales are near-duplicates, so features built from nearby sales must use only earlier data, and validation must hold out both future periods and whole spatial blocks.

Hint 3

Trees cannot extrapolate a time trend, and exponentiating log-space predictions biases them low. Think about modeling price relative to a market index and about a bias correction, and consider slicing metrics by price band and neighborhood for both accuracy and fairness.