Align Telemetry Streams and Publish Versioned Corrections
SpacexSoftware Engineer · Technical ScreenLast updated
Define telemetry subtraction semantics, handle missing or repeated timestamps, and reconcile late events with versioned, idempotent corrections.
Two telemetry streams contain timestamped numeric observations. You need to subtract the streams and then handle late events that can change an earlier result. Explain the timestamp-alignment contract, an ordered-stream processing approach, and a reconciliation protocol that lets consumers distinguish initial results from corrections.
Requirements and Constraints
Within each initially supplied stream, timestamps are nondecreasing. A timestamp may occur in only one stream, and nondecreasing order does not rule out duplicate timestamps. The behavior for a missing counterpart and the meaning of duplicates have not been specified. Identify those decisions before proposing an algorithm. Later events may arrive after an initial result has been emitted.
This is an engineering discussion about defining and maintaining the result contract. No fixed missing-value policy, event schema, lateness bound, or exactly-once delivery guarantee is assumed.
Clarifying Questions
- Are observations independent point measurements, additive contributions, or updates to a value that remains in effect until replaced?
- At a timestamp present in only one stream, should the result be omitted, marked incomplete, interpolated, or computed using a defined default?
- Do repeated timestamps represent distinct measurements, duplicates of one event, or revisions to an earlier value?
- How late can events arrive, and must consumers support replacement values, delta corrections, or both?
Hints
Hint 1
Define the result key before correcting it: A consumer needs to know which earlier output a correction refers to. A timestamp alone may be insufficient if multiple measurements or revisions share that time.
Follow-up questions
- How would a repeated event delivery differ from a genuinely revised measurement at the same timestamp?
- What should happen when an event arrives after the system's chosen reconciliation-retention window?
- If a correction reaches a consumer before the corresponding initial result, how should that consumer converge to the right value?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.