How would you design a real-time dashboard?
Practice this questionShort explanation:
A real-time dashboard presents frequently changing summaries without making each browser recalculate the whole dataset. An ingestion or aggregation layer builds the current view, and SSE or WebSockets deliver relevant updates. Clients still need an initial snapshot and a way to recover missed updates after disconnecting.
Key points:
-
Collect events, build summaries and push updates through SSE or WebSockets.
-
Keep expensive aggregation away from every browser request.
-
Show data freshness and reconnect safely; throttle updates for slow clients.
-
Use sequence or version information when needed to avoid applying stale updates over newer data.
-
Define acceptable lag and reduce update frequency for slow clients instead of buffering unlimited messages.
Interview point:
- Explain freshness and reconnection behavior as well as the choice between one-way SSE and two-way WebSockets.