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
Software Engineering Fundamentals
Software Engineer
Amazon
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

0

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
Low-Level Design
Queues
OOP
Time-Based Expiry
Dependency Injection
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. 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 Problems
Sample 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) with available count, a deque of waiting member ids, and offer (member, expires_at) or None.
  • Library(clock) exposes borrow, return_loan, accept_offer, and `tick...

Submit Your Answer
Markdown supported