
Implement a cluster status tracker. Design a class with methods: update(nodeId, status, timestamp) to record node status updates that may arrive out of order or be duplicated; getCurrent(nodeId) to return the most recent status; getAt(nodeId, t) to return the status effective at time t; getClusterSummaryAt(t) to return counts of nodes by status at time t, where a node is considered OFFLINE if it has not reported in the last TTL seconds. Use last-write-wins by (timestamp, nodeId) for conflict resolution. Aim for O(log n) per update/query and memory efficiency for up to 100k nodes and 10M updates/day. Describe data structures (e.g., per-node ordered maps, indexes for aggregation), handling of out-of-order events and idempotency, and a strategy to compact/expire historical data. Follow-ups: (