InterviewDB
Question
Book Store System Design: Search, Inventory, Cart, and Checkout at Scale
phone
Question Details
Round 1 System Design
Problem
Design an online bookstore serving 1 million daily active users. The system must support:
-
Catalog search: full-text search by title, author, ISBN, genre. Results ranked by relevance and rating.
Inventory management: each book has a stock count. Prevent overselling.
Cart and checkout: users can add books, apply promo codes, and complete purchase.
Order history: users can view past orders and download receipts.
Walk through your high-level architecture, key data models, and the trickiest consistency problem in this system.
Key entities:
Book(id, title, author, isbn, price, stock_count)
User(id, email, address)
Cart(user_id, items: [{book_id, qty}])
Order(id, user_id, items, total, status, created_at)
Follow-ups
- Two users add the last copy of a book to their carts simultaneously. How do you handle checkout to prevent overselling? Walk through your locking or reservation strategy.
- Search must return results in under 100ms. Where does Elasticsearch fit, and how do you keep it in sync with your primary DB?
- How would you implement "frequently bought together" recommendations without a full ML pipeline?
- Design the promo code system: each code can be single-use, limited-count, or percentage-based. Where is validation enforced?
Full Details
Round 1 System Design
Problem
Design an online bookstore serving 1 million daily active users. The system must support:
-
Catalog search: full-text search by title, author, ISBN, genre. Results ranked by relevance and rating.
Inventory management: each book has a stock count. Prevent overselling.
Cart and checkout: users can add books, apply promo codes, and complete purchase.
Order history: users can view past orders and download receipts.
Walk through your high-level architecture, key data models, and the trickiest consistency problem in this system.
Key entities:
Book(id, title, author, isbn, price, stock_count)
User(id, email, address)
Cart(user_id, items: [{book_id, qty}])
Order(id, user_id, items, total, status, created_at)
Follow-ups
- Two users add the last copy of a book to their carts simultaneously. How do you handle checkout to prevent overselling? Walk through your locking or reservation strategy.
- Search must return results in under 100ms. Where does Elasticsearch fit, and how do you keep it in sync with your primary DB?
- How would you implement "frequently bought together" recommendations without a full ML pipeline?
- Design the promo code system: each code can be single-use, limited-count, or percentage-based. Where is validation enforced?
Free preview. Unlock all questions →
Topics
Onsite
Phone
System Design
More from Databricks
1p3a
Databricks SDE II Interview Experience: Fibonacci Trees CIDR and LLD
Reddit
New Grad Interview Experience at Databricks?
1p3a
Databricks Onsite Interview Experience for SDE Position
1p3a
Databricks Onsite SDE Interview: Encoding and SnapshotSet Coding Challenges
1p3a
Revenue Tracking System with Referrals