Distilled Prep

Interview prep, distilled from
engineering blogs.

Engineering blogs of major tech companies, distilled into interview preparation. Every question links back to the post that inspired it, and teaches the reasoning — not the trivia.

Meta
10 questions
Google
8 questions
Airbnb
5 questions
Stripe
5 questions
Uber
6 questions
DoorDash
11 questions
Netflix
12 questions

What this is

Major tech companies publish how they actually build things — then interview candidates on exactly those problems. This site reads their engineering blogs every week and distills the interview-worthy material into practice questions: the scenario and constraints come from what each company really works on, but every question is answerable from first principles — reasoning, not trivia. Each one carries likely interviewer follow-ups, an answer guide, the underlying concept from scratch, and a link to the source that inspired it. Two layers per company: a curated canon of their enduring themes, and fresh questions derived from what they published this month. A free community project.

Prep by role

Data Science
36 questions
Software Engineering
22 questions
ML Engineering
21 questions

Recently added

difficulty 4/5 Systems designSoftware engstream-processingdistributed-systemsreliabilitygeospatialJul 2026

A concert ends and demand in a few city blocks jumps 20x in minutes. Design the platform that keeps pricing, ETAs, and trip requests reliable through spikes like this.

Practice against the follow-up probes
  • Where exactly does 20x-in-one-neighborhood stress a system that handles the whole city fine?
  • What must stay strongly consistent during a surge, and what can be seconds stale?
  • Thundering herd: every app in the venue refreshes at once. What absorbs it?
  • How do you prevent duplicate trip creation when users rage-tap through timeouts?
  • What load do you shed first, and how do users experience degradation?
Show answer guide

What the interviewer is probing

Hot-partition reasoning: geographic sharding concentrates a local spike onto a handful of shards/keys, so the answer is absorbing structures — caching with request coalescing, aggregation before fan-in, backpressure, and tiered shedding — plus consistency judgment (prices shown can be stale-bounded; the price committed to a trip must be exact) and idempotency under retry storms.

Strong answer outline

  • Identify the hot spots: the venue's geo-cells become hot keys in every layer — location ingestion, demand aggregation, pricing reads, matching. City-scale capacity doesn't help; per-key throughput does.
  • Ingestion/aggregation: driver/rider events flow through a partitioned log keyed by cell; pre-aggregate demand/supply counts at the edge of the pipeline (windowed counts, not raw events, cross the network); pricing recomputes per cell on a short cadence — by design a rate-limited consumer, immune to input spikes.
  • Read path: surge multipliers and ETAs served from replicated caches with short TTLs and request coalescing (one recompute per cell per tick, thousands of readers share it); app refresh jitter and client-side backoff flatten the herd; static fallbacks (last-known multiplier with staleness cap) if the pricing service lags.
  • Consistency split: displayed price/ETA — bounded staleness (seconds) is fine; committed trip price — locked at request time: the trip creation transaction snapshots the quote (signed/versioned), so a surge tick between tap and commit never surprises the rider or the ledger.
  • Duplicate protection: trip creation is idempotent (client-generated request key, atomic check-and-create); rage-taps and retries collapse to one trip; offers to drivers similarly idempotent.
  • Shedding order and UX: drop analytics/telemetry first, widen ETA refresh intervals, coarsen pricing granularity (cell → zone), queue match requests with honest wait messaging — never drop committed trips or corrupt pricing; capacity signals (queue depth, cache hit-rate, per-cell RPS) drive automation and dashboards.

The underlying concept

Geographic load is power-law bursty, and sharding by geography converts a citywide non-event into a per-key crisis — so spike architecture is about absorption: aggregate early (turn N events into one count), coalesce reads (turn N queries into one compute), backpressure producers, and shed along an explicit value ladder. The consistency principle is asymmetric like every marketplace's: advertisements may be stale within bounds, commitments must be exact and idempotent — and the commit point is where the system snapshots truth. Graceful degradation is designed, not discovered: decide in peacetime what fails first.

Source

Distilled Prep canon — curated from Uber's public work on surge infrastructure and real-time marketplace reliability.

Source: Distilled Prep canon (curated)

difficulty 4/5 ML system designML engSoftware enggeospatialml-platformlogistics-optimizationscalabilityJul 2026

Design the real-time dispatch and matching system that pairs riders with drivers in a dense city — from request to accepted match in under a few seconds.

Practice against the follow-up probes
  • What are you optimizing, exactly? Nearest driver is the naive answer — what's wrong with it?
  • Why batch requests into matching windows instead of matching greedily?
  • What does the geospatial layer need to do, and how do you index a world of moving points?
  • Locations are stale and GPS is noisy. Where does that bite, and what absorbs it?
  • How do you evaluate a new matching policy before risking a city on it?
Show answer guide

What the interviewer is probing

Whether the candidate sees dispatch as a global optimization under latency constraints: greedy nearest-match is locally fine and globally wasteful (assigning a driver to rider A can strand rider B), which is why systems batch into short windows and solve assignment problems. Plus the systems substrate — geospatial indexing of moving objects, staleness tolerance, and simulation-first evaluation for changes too risky to A/B naively.

Strong answer outline

  • Objective: multi-term — rider wait (ETA to pickup), completion probability (acceptance/cancel behavior), driver utilization and earnings fairness, and system efficiency; nearest-driver ignores future demand, driver heading, acceptance likelihood, and the opportunity cost of assignments.
  • Batched matching: accumulate requests/supply over a short window (seconds) per area, then solve a bipartite assignment (Hungarian- style or min-cost flow with predicted-ETA edge weights and behavior- adjusted scores); batching converts myopic greed into near-global optima at negligible added wait.
  • Candidate generation + scoring: geospatial index (hexagonal grid cells) maintains driver presence per cell with in-memory, sharded state; candidates from expanding cell rings; scores from real-time features (road-network ETA, driver state, acceptance model) served within tight budgets.
  • Noise and staleness: map-match GPS to the road network; treat locations as estimates with age — score with uncertainty, re-check on offer; retries/declines re-enter the next window; idempotent offer protocol so network flakiness never double-books a driver.
  • Reliability: shard matching by geography (city/region cells) for blast-radius containment; degraded mode falls back to simpler greedy matching locally rather than failing requests; surge events handled by backpressure on window size.
  • Evaluation ladder: offline simulation replaying historical supply/demand under the new policy (the workhorse — marketplace interference makes naive A/B misleading); then switchback experiments in live cities; guardrailed rollout with automatic rollback on wait/cancel regressions.

The underlying concept

Matching markets punish myopia: each assignment consumes shared supply, so sequential greedy decisions compound into global waste — batching into windows recreates a small assignment problem where optimization is tractable, trading milliseconds of wait for system-wide efficiency. The engineering mirror: moving-object geospatial state wants cell-sharded in-memory indexes, and every distributed step must tolerate stale inputs and retries by design. Evaluation completes the lesson — when treatment units share a marketplace, simulation and switchbacks replace unit-level A/B as the honest instruments.

Source

Distilled Prep canon — curated from Uber's public work on dispatch, matching, and marketplace systems.

Source: Distilled Prep canon (curated)

difficulty 4/5 ML system designData scienceML englogistics-optimizationmarketplace-dynamicsml-platformJul 2026

You run growth marketing at a large ride-sharing and delivery marketplace. You have millions of eligible drivers and couriers, hundreds of concurrent incentive programs (sign-up bonuses, streak rewards, quest challenges), and a set of team-level quarterly budgets — one per line of business — that are hard caps. Your current approach is first-come, first-served: whichever incentive program registers a user first wins, and budget is managed manually at the end of each period.

You've been asked to design a system that replaces this with an optimized, automated allocation: given predicted uplift per user-incentive pair from your ML models, select which incentive to assign to which user (or no incentive at all) to maximize total predicted ROI across all lines of business without violating any team's budget.

Walk me through the optimization formulation, the solver you'd choose at this scale and why, and how you'd keep spend inside hard quarterly budgets when your cost predictions drift.

Practice against the follow-up probes
  • Your uplift models give you predicted ROI, but ROI for a delivery incentive might cannibalize ride bookings for the same driver. How do you represent and optimize for net marketplace impact rather than siloed metric gains?
  • Budgets are quarterly, but you're running assignments daily or weekly. How do you pace spend so you neither blow the budget in week one nor leave 40% unspent in week twelve?
  • You originally modeled costs as time-series curves over each incentive's duration, but that caused the solver to time out. What went wrong, and what trade-off did you make to fix it?
  • Your LP solver works fine on 10,000 users but takes over 24 hours on 100,000. What's the underlying cause, and what class of solver would you switch to and why?
  • A new product line has poor immediate engagement metrics but is strategically important. How does your system avoid always starving it of budget in favor of well-established, high-ROI programs?
Show answer guide

What the interviewer is probing

This question tests whether the candidate can bridge ML prediction with combinatorial optimization at scale — recognizing that 'pick the highest-uplift treatment per user' is wrong when budgets couple decisions across millions of users. It probes metric judgment (cross-vertical ROI, strategic weights), architecture (prediction layer decoupled from valuation layer, budget feedback control), and scale-and-failure reasoning (solver choice, time-series cost complexity, pacing under model drift). Strong candidates will identify the NP-hard nature of the assignment problem and reason about the solver trade-off without needing to know CP-SAT by name.

Strong answer outline

Problem framing - Clarify: How many users, levers, budget buckets? What's the assignment cadence? Are assignments one-per-user or can a user receive multiple incentives? - The core constraint: this is a multiple knapsack problem — knapsacks are team budgets, items are user-incentive pairs with predicted cost and value, goal is to maximize total value subject to per-knapsack budget constraints. - Naive per-user greedy (assign each user their highest-uplift option) ignores coupling: high-cost incentives burn budget that could serve more users at lower cost.

ROI signal design - Wrong turn: predict a single engagement metric per incentive. Fails because a delivery incentive that pulls a driver away from rides improves one metric while hurting another — net effect is negative. - Better: predict a vector of metric uplifts (rides trips, eats orders, driver utilization, earnings per hour) using uplift models trained on randomized experiment data. - Apply a strategic weight vector — set by business context — to convert the metric vector to a scalar ROI via dot product. Weights for a new market expansion emphasize growth; mature markets emphasize efficiency. Separating prediction (objective) from valuation (subjective) lets the same model serve different strategic priorities without retraining. - Guardrails: include cross-vertical cannibalization as a negative-weight term. Monitor net marketplace metrics, not just primary metrics, in holdout evaluation.

Budget pacing across time - Problem: quarterly budgets with weekly or daily assignment cycles. ML cost predictions drift; if predictions underestimate cost, you overspend early. - Control loop design: at each cycle, compute remaining_budget = configured_budget - observed_spend - predicted_liability, where predicted liability is the forecasted future cost of already-assigned active incentives not yet paid out. - This self-corrects: if actual costs exceed predictions, the pacer tightens the cap for future cycles, smoothing over the quarter. - Trade-off on cost modeling: modeling cost as a daily time-series over the incentive duration is accurate but explodes solver dimensionality (N users × T days constraints vs. N scalar constraints) and creates artificial bottlenecks when a predicted spike on one day blocks otherwise-viable assignments. Collapsing total predicted cost to the assignment day sacrifices granularity but makes the solver tractable and dramatically improves budget utilization.

Optimizer design - Scale challenge: with millions of users and hundreds of levers, the candidate space is the Cartesian product — potentially billions of user-incentive pairs. - Why LP fails at scale: LP relaxes the binary assignment decision to a continuous variable, then rounds. For large combinatorial problems the LP relaxation's solution is far from integer-feasible, and branch-and-bound search explodes. Runtime can exceed 24 hours on 100K users. - Better fit: constraint programming solvers (e.g., CP-SAT) natively handle discrete, binary assignment variables and use propagation + intelligent pruning to eliminate infeasible branches early. Same 100K-user instance solved in minutes. - Plug-and-play solver interface: abstract the problem definition (variables, constraints, objective) from the solver implementation so you can swap solvers as problem structure evolves without rewriting business logic. - Common wrong turn: trying to scale a greedy heuristic (rank by ROI/cost ratio, assign greedily until budget exhausted). This is fast but suboptimal and provides no optimality guarantees or constraint flexibility.

System architecture - Offline/batch flow: cron-triggered orchestrator → fetch eligible user pools from segmentation → generate user × lever candidate pairs → score with ML platform (uplift, cost) → pacer computes available budget cap → optimizer solves MKP → push assignments to downstream execution services. - Latency: optimization is offline/batch, so SLA is minutes to hours, not milliseconds. Decouple from real-time serving. - Scale pressure points: candidate generation (Cartesian product can be billions of rows — pre-filter ineligible pairs before scoring), ML scoring (batch inference at scale), solver memory (large binary programs; may need to shard by geography or time window). - Failure modes: solver timeout (set a time limit, return best feasible solution found); ML model staleness (monitor feature drift; degrade gracefully to simpler heuristic if model is stale); budget overrun from late-arriving cost signals (pacer's predicted liability must account for settlement lag).

Evaluation - Offline: simulate allocations on historical data; compare total assigned ROI and budget utilization vs. FIFO baseline. - Online: holdout experiment — randomly assign a fraction of users to the optimizer vs. baseline; measure net marketplace metrics (trips, earnings, utilization) per dollar spent, with guardrails on cross-vertical cannibalization. - Exploration vs. exploitation: current system requires manual intervention to test new incentive structures. Flag as open problem: auto-allocate a small exploration budget to novel incentives, gather uplift signal, retrain models, inject validated structures — closing the loop.

The underlying concept

Incentive allocation at scale is a multiple knapsack problem (MKP): you must assign binary decisions (give user U incentive I or not) to maximize a global objective subject to coupling budget constraints, which makes the decisions across users non-independent. This is fundamentally combinatorial and NP-hard, which is why greedy or LP approaches break down as the problem scales — LP's continuous relaxation poorly approximates the integer solution when the problem is highly combinatorial, while constraint programming solvers exploit problem structure (propagation, pruning) to find near-optimal integer solutions efficiently. The two-layer ROI design — predicting metric uplifts separately from applying strategic weights — is a classic separation of concerns: the prediction layer is a calibration problem (train once, reuse), while the valuation layer is a business policy problem (change without retraining). Budget pacing as a feedback control loop is the standard engineering answer to the tension between probabilistic ML predictions and hard financial constraints: rather than trusting the model's cost forecast, continuously reconcile predictions against observed reality and adjust the constraint fed into future optimization runs.

Source

Derived from Beyond Prediction: Solving the Multiple Knapsack Problem at Scale: How Uber Optimizes Incentives

difficulty 3/5 Product caseData sciencemarketplace-dynamicsexperimentationforecastingJul 2026

Uber Eats' estimated delivery times got more accurate and slightly faster on average — yet order conversion and repeat ordering declined. Diagnose the apparent contradiction.

Practice against the follow-up probes
  • What's the difference between an estimate being accurate and being attractive?
  • Build the metric tree from browse to reorder. Where could the decline enter?
  • How would you distinguish a selection effect from a true regression?
  • Which segments would you cut, and what would each tell you?
  • What experiment settles it?
Show answer guide

What the interviewer is probing

Whether the candidate spots that displayed ETAs are simultaneously a prediction and a promise that shapes demand: honest (longer-tail) estimates can be more accurate yet less attractive, suppressing conversion among time-sensitive customers — a selection effect that also changes who orders and thus measured satisfaction. Metric-tree discipline plus mechanism thinking, in Uber's marketplace flavor.

Strong answer outline

  • Core hypothesis: accuracy improved partly by raising displayed estimates that were previously optimistic — customers see honest 40-minute quotes instead of hopeful 30s; conversion drops among the time-sensitive; the remaining orders skew less time-sensitive, changing repeat-rate composition.
  • Metric tree: browse → restaurant view → cart → checkout (conversion); delivered experience (quoted vs. actual, lateness) → satisfaction proxies (ratings, support contacts) → reorder. Localize which edge declined and when relative to the ETA rollout.
  • Distinguish mechanisms: (a) display effect — check conversion as a function of displayed ETA, holding merchant/distance constant, pre/post; (b) actual-experience effect — did realized lateness or delivery times worsen for any segment despite average gains?; (c) measurement/selection — reorder rates computed on a different ordering population aren't comparable without adjustment.
  • Segment cuts: time-of-day (lunch = time-sensitive), market density, distance bands, new vs. tenured customers, merchant type; the display-effect story predicts the decline concentrates where displayed ETAs rose most.
  • The settling experiment: randomize the display policy (e.g., quantile shown) holding the underlying model constant — separates prediction quality from promise attractiveness; measure conversion, realized lateness against promise, satisfaction, and reorder by cohort.
  • Decision frame: the answer is rarely "revert to optimistic quotes" — it's choosing the displayed quantile that optimizes long-run value: conversions gained by attractive promises vs. trust lost by broken ones.

The underlying concept

A displayed prediction is an intervention: customers act on it, so its optimal presentation is a decision-theory problem distinct from its accuracy. Systems that "improved" a model can regress the business by changing the promise distribution — and the composition of who transacts shifts with it, corrupting naive before/after comparisons of downstream metrics (selection on unobserved time-sensitivity). The durable practice: separate model quality (calibration, error) from display policy (which quantile, how framed), and experiment on them independently.

Source

Distilled Prep canon — curated from Uber's public work on ETA prediction and marketplace conversion.

Source: Distilled Prep canon (curated)

difficulty 4/5 Product caseData scienceexperimentationcausal-inferencemarketplace-dynamicsJul 2026

A city launches a new driver incentive that guarantees a minimum hourly earning during peak periods. Design the evaluation plan to decide whether the program should be expanded to other cities.

Practice against the follow-up probes
  • What are your objectives and guardrails across riders, drivers, and the platform — and which one is the decision metric?
  • Would you randomize at the rider level, driver level, use switchbacks, geo experiments, difference-in-differences, or synthetic control? Why?
  • Drivers can see the incentive and migrate across zones or shift their hours in anticipation. How does that contaminate your design?
  • How do you estimate incrementality — supply that exists because of the program — rather than just measuring that supply went up?
  • The program has a fixed budget. How does that change what "success" means?
Show answer guide

What the interviewer is probing

Whether the candidate recognizes this as an interference problem before choosing a method: driver-level randomization is the intuitive answer and it's wrong here, because treated and control drivers compete in one marketplace and the incentive changes behavior of both. Strong candidates frame the business decision first (expand or not, at what cost per incremental supply hour), pick a design that matches the interference structure, and are honest about what each design cannot identify.

Strong answer outline

  • Frame the decision: expansion is a cost-effectiveness question — dollars per incremental supply-hour during peak, and downstream effects on rider wait times, completed trips, and driver retention. Guardrails: driver earnings dispersion, off-peak supply cannibalization, rider price effects.
  • Rule out naive designs aloud: driver-level randomization suffers spillovers (control drivers face more competition, inflating apparent effects); pre/post comparison confounds seasonality and city trends.
  • Prefer designs matching the interference structure: geo-randomization at the city or zone-cluster level if enough units exist; switchbacks (time-based alternation) if the effect onset/decay is fast; synthetic control or diff-in-diffs against comparable cities when only one launch city exists — which is the realistic case here.
  • Name anticipation and learning effects: announce dates create pre-period contamination; drivers take time to respond, so define a burn-in and an effect window.
  • Incrementality: compare supply-hours against the counterfactual, then decompose — new drivers activated vs. existing drivers shifting hours from off-peak (cannibalization) vs. hours shifted from neighboring zones (displacement). Only the first is cleanly incremental.
  • End with a decision rule: expand if cost per incremental peak supply-hour beats the alternative levers (e.g. surge subsidy) at comparable guardrail impact, validated in 2-3 structurally different cities before general rollout.

The underlying concept

The Stable Unit Treatment Value Assumption (SUTVA) — that one unit's treatment doesn't affect another unit's outcome — fails almost everywhere in a marketplace, because participants compete for shared demand and supply. When SUTVA fails, the choice of randomization unit is the real design decision: you must randomize at the level that contains the interference (zones, cities, time blocks), even though this slashes your sample size and statistical power. That power-vs-validity trade-off, and the discipline of measuring incrementality against a counterfactual rather than a before/after, is the core of applied marketplace causal inference.

Source

Distilled Prep canon — curated from Uber's public work on marketplace experimentation and causally-informed optimization.

Source: Distilled Prep canon (curated)