Design a DoorDash-like homepage recommendation system for local stores/restaurants.
Request context
-
The online request contains very little information:
user_id
and the user's current latitude/longitude.
-
The system must return a ranked list of stores for the app home feed.
Hard constraints
-
A recommended store must be
within the user's delivery/service area
.
-
A recommended store must be
currently open
.
-
The system is latency-sensitive and must support very low end-to-end serving time.
Tasks
-
Propose the
end-to-end architecture
for retrieval, filtering, ranking, and serving.
-
Explain how you would design
candidate retrieval
given sparse online inputs.
-
Describe how to use
geographic caching
(for example, Geohash or a grid-cell system) so that offline-computed local hot-store lists can be reused online through a KV store such as DynamoDB.
-
Suppose each retrieval source has an extremely tight timeout budget (for example, about
15 ms
). How would you optimize
parallel fan-out, caching, fallbacks, and concurrency
?
-
Design the
ranking layer and feature platform
:
-
How would you store different feature types such as embeddings, numerical features, and categorical features?
-
What keys would you use for user, store, and user-store features?
-
How would you support
hourly offline refreshes
while preserving efficient online reads for inference?
-
Explain how the infrastructure should support
model evolution
, such as moving from model V1.1 to V2.0 with additional features.
-
Discuss the trade-offs between
real-time features
and
batch/offline features
under strict latency requirements, including failure modes such as timeouts, missing values, feature freshness issues, and training-serving skew.
-
What online and offline metrics would you monitor to judge system quality, latency, and marketplace health?