Bird
Raised Fist0
HLDsystem_design~20 mins

Search and metadata in HLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Search and Metadata Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Architecture
intermediate
2:00remaining
Designing a scalable search system for metadata-rich documents

You need to design a search system that indexes documents with rich metadata (tags, authors, dates). Which architecture best supports fast, scalable search with frequent metadata updates?

AUse a distributed search engine like Elasticsearch with separate indices for metadata and content.
BUse a relational database with full-text search and update metadata in place.
CStore documents in a NoSQL key-value store and perform search by scanning all keys.
DUse a file system with metadata stored in separate JSON files and search by reading files sequentially.
Attempts:
2 left
💡 Hint

Think about systems optimized for search and handling frequent updates efficiently.

scaling
intermediate
2:00remaining
Estimating capacity for a metadata search service

Your metadata search service expects 10 million documents with an average of 20 metadata fields each. You expect 1000 queries per second. What is the best way to estimate the required hardware capacity?

AEstimate index size for metadata, average query complexity, and use benchmarks of similar systems to size CPU and memory.
BCalculate storage size for all metadata and content, then multiply by query rate to get CPU needs.
CCount number of documents only and assign one CPU core per 1000 documents.
DIgnore metadata size and focus only on network bandwidth for query traffic.
Attempts:
2 left
💡 Hint

Consider both data size and query complexity, and use real-world benchmarks.

tradeoff
advanced
2:00remaining
Choosing between inverted index and graph database for metadata search

You must choose a data structure for searching documents by metadata. Which option best fits a use case with complex relationships between metadata (e.g., authors collaborating, hierarchical tags)?

AUse a relational database with multiple join tables for metadata relationships.
BUse an inverted index optimized for keyword search across metadata fields.
CUse a simple key-value store with metadata serialized as JSON strings.
DUse a graph database to model and query complex relationships between metadata entities.
Attempts:
2 left
💡 Hint

Consider which data structure naturally represents relationships and supports complex queries.

🧠 Conceptual
advanced
2:00remaining
Understanding metadata freshness impact on search results

In a search system with frequent metadata updates, what is the main tradeoff when choosing between real-time indexing and batch indexing?

AReal-time indexing reduces query latency but increases network bandwidth; batch indexing reduces bandwidth usage.
BBatch indexing improves freshness but requires more storage; real-time indexing reduces storage needs.
CReal-time indexing improves freshness but increases system load; batch indexing reduces load but delays updates.
DBatch indexing allows partial updates; real-time indexing requires full reindexing each time.
Attempts:
2 left
💡 Hint

Think about how update frequency affects system performance and data freshness.

component
expert
3:00remaining
Request flow in a distributed metadata search system

Trace the request flow when a user searches for documents by metadata in a distributed search system with multiple shards and a metadata cache layer. Which sequence correctly describes the flow?

A1, 3, 4, 2, 5, 6
B1, 2, 3, 4, 5, 6
C1, 2, 4, 3, 5, 6
D1, 3, 2, 4, 5, 6
Attempts:
2 left
💡 Hint

Consider cache lookup before querying shards and updating cache after aggregation.