Reported interview periodApr 2026–Sep 2026
Expiring compute-credit ledger
Implement a ledger for compute-credit grants and debits whose events may arrive out of order.
Practice focusEach grant has a unique ID, amount, activation timestamp, and expiration duration. A grant is available through its expiration boundary. subtract(amount, timestamp) consumes credits that expire soonest. get balance(timestamp) returns the balance that would have been available at that point in time by evaluating all applicable events in chronological order. Define deterministic behavior for duplicate IDs, insufficient balance, equal timestamps, and late-arriving events. Preserve enough history to answer past-balance queries correctly. Follow-ups 1.…