PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/Shopify

Design a rare-book lending and returns system

Last updated: Apr 8, 2026

Quick Overview

This System Design question evaluates architecture and domain modeling skills including distributed systems, transactional integrity, concurrency control, identity and authorization, inventory reconciliation, and compliance-focused auditability for managing rare physical assets across multiple branches.

  • hard
  • Shopify
  • System Design
  • Software Engineer

Design a rare-book lending and returns system

Company: Shopify

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Design a system to manage borrowing and returning rare books across multiple library branches. Specify functional requirements (catalog search, reservations, waitlists, appointment-based access, in-library-only restrictions, identity verification, staff overrides, condition inspection with photos, chain-of-custody and audit logs, fines for late/damaged/lost items, incident reports, RFID/barcode check-in/out, inventory reconciliation). Define APIs (e.g., create user, place/modify/cancel hold, check out, check in, report damage/loss, schedule appointment), data model (users, items/copies, holdings, policies, transactions, audits), and consistency/transaction guarantees to prevent double-booking limited copies. Propose an architecture (services, databases, caches, queues, search index) with strong authorization, encryption, and tamper-evident audit trails. Address scale assumptions, read/write QPS, hot titles, concurrency control, idempotency, failure handling, background jobs, notifications, and SLA/RTO/RPO. Discuss monitoring, alerting, cost trade-offs, and how you would extend the design for inter-library loans and offline operations.

Quick Answer: This System Design question evaluates architecture and domain modeling skills including distributed systems, transactional integrity, concurrency control, identity and authorization, inventory reconciliation, and compliance-focused auditability for managing rare physical assets across multiple branches.

Related Interview Questions

  • Design and implement a word-guessing game - Shopify (medium)
Shopify logo
Shopify
Jul 16, 2025, 12:00 AM
Software Engineer
Onsite
System Design
55
0

System Design: Rare Books Circulation Across Multiple Branches

Context

Design a system to manage borrowing and returning rare books across multiple library branches. Rare items have special handling (limited copies, in-library-only policies, appointments, inspections) and strong compliance needs (tamper-evident audit trails). The system must prevent double-booking the same copy and scale to many branches and users.

Requirements

Functional Requirements

  • Catalog & Discovery
    1. Full-text search and faceted browse across titles, authors, subjects, branches, availability.
    2. Variant records: title-level records and copy-level metadata (condition, restrictions, branch location).
  • Reservations & Access 3. Place/modify/cancel holds at title level; assign to a copy when actionable (e.g., appointment confirmed). 4. Waitlists with fair ordering and promotion rules; expiration of offers. 5. Appointment-based access for reading rooms; time-slot scheduling and capacity limits per branch. 6. Policy enforcement: in-library-only vs. loanable; max loan periods; user eligibility; fines.
  • Identity & Staff Controls 7. Identity verification (membership, ID verification at branch) and digital consent/signature capture. 8. Staff overrides (break-glass) with reason codes and elevated auditing.
  • Circulation & Integrity 9. RFID/barcode check-in/out; gate integration for in-library-only items. 10. Condition inspection at check-out/check-in with photos, notes, and damage codes. 11. Chain-of-custody and tamper-evident audit logs for all custody transitions. 12. Fines for late/damaged/lost items; incident reports for disputes. 13. Inventory reconciliation: periodic RFID sweeps, discrepancy reporting, cycle counts.

APIs (examples)

  • Users: create/update user; verify identity; attach credentials.
  • Holds: place/modify/cancel hold; list user holds; accept/decline offer.
  • Appointments: create/modify/cancel; check availability.
  • Circulation: check out; check in; transfer between branches; mark in-reading-room custody.
  • Condition/Incidents: report damage/loss; upload inspection photos; file incident.
  • Admin/Staff: staff override action; reconcile inventory; manage policies.

Data Model (high level)

  • Users, Items (title-level), Copies (physical holdings), Policies, Holds, Appointments, Transactions (circulation), Fines, Incidents, Audits (append-only), Media (photos).

Consistency & Transactions

  • Prevent double-booking limited copies and time slots.
  • Atomic state transitions for holds, appointments, and check-out/check-in.
  • Idempotent APIs to handle retries.

Architecture

  • Services: Catalog/Search, Reservations, Appointments, Circulation, Identity & AuthZ, Policies, Audit/Compliance, Notifications, Media, RFID/Edge Gateway.
  • Data stores: relational DB for core transactions; search index; cache; queues; object storage; WORM/append-only audit store.
  • Security: strong authorization, encryption at rest/in transit, tamper-evident audits.

Non-Functional & Operations

  • Scale assumptions; expected read/write QPS; handling hot titles.
  • Concurrency control; failure handling; background jobs; notifications.
  • SLA/SLO, RTO/RPO; monitoring & alerting.
  • Cost trade-offs.
  • Extensions: inter-library loans; offline branch operations.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Shopify•More Software Engineer•Shopify Software Engineer•Shopify System Design•Software Engineer System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.