Bird
Raised Fist0

You are designing a search system that must filter products by multiple attributes (material, size, brand) with minimal latency at scale. Which design approach is most suitable?

hard📝 Trade-off Q8 of Q15
LLD - Design — Hotel Booking System
You are designing a search system that must filter products by multiple attributes (material, size, brand) with minimal latency at scale. Which design approach is most suitable?
AStore all products in a relational database and perform sequential scans
BUse a multi-dimensional bitmap index combined with a distributed query engine
CUse a single inverted index on product descriptions only
DCache all possible filter combinations in memory
Step-by-Step Solution
Solution:
  1. Step 1: Understand requirements

    Need fast multi-attribute filtering at scale with low latency.
  2. Step 2: Evaluate options

    Relational DB with sequential scans is slow; inverted index on descriptions doesn't support attribute filters well; caching all combinations is infeasible at scale.
  3. Step 3: Best approach

    Multi-dimensional bitmap indexes efficiently support multiple attribute filters and scale well with distributed query engines.
  4. Final Answer:

    Use a multi-dimensional bitmap index combined with a distributed query engine -> Option B
  5. Quick Check:

    Bitmap indexes excel at multi-attribute filtering [OK]
Quick Trick: Bitmap indexes enable fast multi-attribute filtering [OK]
Common Mistakes:
MISTAKES
  • Relying on sequential scans for large datasets
  • Using inverted index only for attribute filters
  • Attempting to cache all filter combinations

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes