Bird
0
0

You are designing a search system for a large online store with millions of products. To support fast search by keywords and handle high user traffic, which combination of design choices is best?

hard📝 Trade-off Q15 of 15
LLD - Design — Library Management System
You are designing a search system for a large online store with millions of products. To support fast search by keywords and handle high user traffic, which combination of design choices is best?
AUse a simple list of products and filter by keywords on the client side
BStore all product data in a single SQL table and scan it for each search
CUse an inverted index stored in a distributed NoSQL database with caching layers
DBuild an index only for the top 10 products and search others sequentially
Step-by-Step Solution
Solution:
  1. Step 1: Consider scalability and speed needs

    Millions of products and high traffic require fast, scalable search with distributed storage and caching.
  2. Step 2: Evaluate options

    Use an inverted index stored in a distributed NoSQL database with caching layers uses inverted index (fast keyword lookup), distributed NoSQL (scalable), and caching (speed). Others are slow or incomplete.
  3. Final Answer:

    Use an inverted index stored in a distributed NoSQL database with caching layers -> Option C
  4. Quick Check:

    Inverted index + distributed storage + cache = scalable fast search [OK]
Quick Trick: Combine inverted index, distributed DB, and cache for scale [OK]
Common Mistakes:
MISTAKES
  • Choosing full table scan for large data
  • Filtering on client side for millions of items
  • Indexing only a small subset of data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes