← Questions
Design a user activity query system
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Airbnb's system design round, last asked Dec 2025. It tests event storage, time series and queries.
Design a system that stores user activity events at large scale and lets internal services and tools query them: everything one user did in a time range, filtered by event type, and activity in an area over a time window.
Requirements
- Functional: ingest activity events (searches, views, bookings, messages, logins) with a timestamp, user ID, type and optional location; query by user and time range with type filters; query by place and time; paginate results.
- Non-functional: high write volume; low-latency queries for recent data; long retention for older data at lower cost; privacy controls and audit of who queried what.
Clarifying questions
- How many events per second, and how long must they be kept?
- Which queries are latency-sensitive, and how fresh must results be?
- Who may query, and what personal data do events carry?
- Do deletion requests have to reach every copy?
What a strong answer covers
- API design: query by user and time range with type filters and cursor pagination; query by area and time.
- The write path: a durable log, then writers into the serving stores; idempotent writes keyed by event ID.
- Storage and partitioning: a wide-column or key-value store keyed by
(user_id, time bucket)with rows sorted by time for per-user queries; a second index keyed by geohash and time bucket for place queries; hot partitions for very active users. - Tiering: recent data in the low-latency store, older data in columnar files in object storage queried by batch engines.
- Consistency: eventual consistency between the log and the indexes, and what readers may see.
- Privacy and audit: access control per query type, logging every query, data minimization, deletion by user across stores.
Follow-ups
- One user has millions of events. How do you keep their queries fast?
- Support "count events of type X per day for this user" without scanning.
- A deletion request arrives. Walk through how the data is removed everywhere.
Where it's asked
- Airbnb · System design · Last asked Dec 202560 min · Design discussion
What it tests
event storage · time series · queries
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing
