Bird
0
0

You are designing a scalable search and filter system for an e-commerce site with millions of products. Which approach best balances fast search and flexible filtering?

hard📝 Trade-off Q15 of 15
LLD - Design — Hotel Booking System
You are designing a scalable search and filter system for an e-commerce site with millions of products. Which approach best balances fast search and flexible filtering?
ALoad all products into memory and filter using loops
BStore all products in a single SQL table and scan it for every search
CUse a simple key-value store without indexes
DUse a distributed search engine with inverted indexes and faceted filters
Step-by-Step Solution
Solution:
  1. Step 1: Consider scalability and performance needs

    Millions of products require fast, scalable search with flexible filters.
  2. Step 2: Evaluate options for search and filtering

    Distributed search engines with inverted indexes enable fast text search; faceted filters allow flexible attribute filtering efficiently.
  3. Step 3: Eliminate inefficient approaches

    Scanning large SQL tables or in-memory filtering is slow and not scalable; key-value stores lack complex search capabilities.
  4. Final Answer:

    Use a distributed search engine with inverted indexes and faceted filters -> Option D
  5. Quick Check:

    Distributed search + faceted filters = D [OK]
Quick Trick: Use distributed search with faceted filters for scale [OK]
Common Mistakes:
  • Relying on full table scans for large data
  • Ignoring indexing for search speed
  • Using memory-heavy filtering for millions of items

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes