OpenAI·Software Engineer·Technical Phone Screen
- Design a GPU credit ledger class that supports adding credits, charging credits, and querying the balance at any given timestamp. Events can arrive out of order, and the balance at a given time must reflect all events up to that timestamp processed in chronological order, with charges only succeeding if the balance is sufficient at the time they're processed.
“The out-of-order timestamp part is what got me initially.”