System Design · OpenAI · Hard
Design a CreditLedger that tracks GPU compute credits. Grants become active and later expire, while spending attempts may arrive with timestamps that are not in chronological order. A grant has a unique identifier, a positive amount, an inclusive activation time startTime, and an exclusive expiration time endTime. It contributes amount usable credits at every moment $$t$$ such that $$\text{startTime} \le t < \text{endTime}$$. Implement the following API: CreditLedger()…
Checking your access…