ORIGINAL COMPANY-CONTEXT PRACTICE
Display quotes with explicit freshness
Original practice scenario inspired by The Charles Schwab Corporation's public business context; this is not a reported interview question or a description of its internal systems. A synthetic investing dashboard receives quotes from a live feed and serves cached snapshots during interruptions. Design the freshness contract and failure behavior for an informational display.
Written for independent practice using company context; this is not a verified question from a company interview.
A REASONED APPROACH
Model answer.
Expose source event time and receipt time with each quote. A responsive cache can still hold old prices, so latency and freshness require separate service measurements and user-visible states.
Work through it
- Define instrument-specific stale thresholds and market-session handling. Sequence or version feed updates so a delayed older quote cannot replace a newer one.
- Serve the last known value only with its as-of time and stale indicator when permitted. Use unavailable status when no trustworthy value exists, rather than substituting zero.
- Detect feed gaps, reconnect with snapshots, and reconcile sequence continuity. Test delayed updates, clock skew, market closure, and a prolonged outage.
Tradeoffs to discuss
- Aggressive refresh increases load without guaranteeing fresher source data. Informational displays and order-execution decisions need different correctness and availability contracts.
Common pitfalls
- Browser receipt time is not the exchange event time.
- A green connection indicator does not prove that every instrument is receiving current quotes.