Design a Kindle Library Lending System With Hold Queues
Last updated: November 29, 2026
Quick Overview
Design the classes for a library that lends Kindle ebooks with a fixed number of licenses per title. Members borrow if a license is free, otherwise join a first-come hold queue; when a copy is returned it is offered to the next member in the queue, who has a limited time to accept.
Amazon
November 29, 20260
0
0 solved
Design the classes for a library that lends Kindle ebooks with a fixed number of licenses per title. Members borrow if a license is free, otherwise join a first-come hold queue; when a copy is returned it is offered to the next member in the queue, who has a limited time to accept.
A low-level design question in the style of Amazon onsite rounds tied to Kindle and digital lending. The interviewer is checking entity design, correct license accounting, queue fairness, and how you model time-based expiry testably (injecting a clock instead of calling time directly).
What the Interviewer Expects
- Model Title, Member, Loan, Hold and Library
- Track available licenses per title, never letting it go negative
- Use a FIFO queue per title for holds
- Implement offer expiry with an injected clock
- Enforce per-member limits
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you handle a member who is on hold for 30 titles?
- How would you scale this across many library systems?
- How would you notify members and handle notifications failing?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Each title has N licenses. Members may have at most 5 active loans. Loans last 14 days. When a license frees up and holds exist, the next member gets an offer valid for 3 days; if it expires, the next...
High-Level Design
Title(id, licenses)withavailablecount, adequeof waiting member ids, andoffer(member, expires_at) or None.Library(clock)exposesborrow,return_loan,accept_offer, and `tick...