Design a real-time clickstream analytics pipeline
PremiumData pipelineMedium
- Clickstream
- Event time windows
- Watermarks
Quick answer
This data pipeline interview question asks you to design a real-time clickstream analytics pipeline. Aim for a design that moves data from sources to consumers reliably and on time, then explain ingestion, processing, storage and trade-offs. Interviewers want to see how you handle volume, late or bad data and failures along the way.
The problem
Design a real-time clickstream analytics pipeline for a large shopping site: every page view, click and add-to-cart from web and mobile apps reaches live dashboards within seconds and lands in a data lake. The hard parts are event-time windows, late mobile events and sessions at 100,000 events per second.
Product and growth teams watch the dashboards during sales: active users, the conversion funnel per minute, top pages and errors. The same events are also the raw history that every batch job reads later.
What must a real-time clickstream analytics pipeline do?
- Live metrics: Show active users (last 5 minutes) and page views, add-to-cart and checkout counts per minute, sliced by country, platform and page type.
- Sessions: Group each user's events into sessions that end after 30 minutes of inactivity, with session count, duration and pages per session.
How well must it do it?
- Freshness: A new event shows in dashboard metrics within 30 seconds at p95.
- Lateness: Events up to 10 minutes late are counted live in the right minute; events up to 24 hours late are fixed by a batch correction.
What scale should you design for?
Use these numbers in your estimates.
The scale numbers unlock with this questionUnlock
Key concepts
- Clickstream
- Event time windows
- Watermarks
- Sessionization
- Kafka
- Real time OLAP
How you’ll practise
- Requirements
- Data volume
- Ingestion
- Storage and processing
- Serving and freshness
- Wrap-up
Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.
What do interviewers look for?
In any data pipeline design round.
- Clarifies sources, consumers and freshness needs
- Chooses batch, streaming or both with reasons
- Handles late, duplicate and malformed records
- Makes each stage safe to retry
- Explains storage formats and partitioning
- Plans monitoring, backfills and data quality checks
Questions people ask about this interview question
- Which design type is this question?
- It is a data pipeline question. You design a real-time clickstream analytics pipeline and explain your choices the way you would in an interview.
- Is this question asked at entry level?
- It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
- What should I cover first?
- Start with the data sources, the consumers and how fresh the data must be. Agree on scope with the interviewer before you design anything.
- Can I practise it for free?
- It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.
Related questions
Updated · Written by the SevyDevy team