HLD Interview Question- Google
Company: Google
Role: l4, l5
Interview Stage: Onsite
Location: unknown
Year: unknown
Original Post Content:
You are designing a cache system for query–catalog candidate scores.
Each query can have up to 5000 candidate IDs (CIDs).
Each candidate has a score and a frequency counter (how many times it has been accessed).
A key is defined as:
Query:version
A value is a set of (CID, score, frequency) pairs.
Requirements
Performance constraint
Task
Design the high-level architecture and data structures for this system.
How would you store the data?
How would you efficiently support inserts, lookups, and evictions?
How would you enforce the per-query and global constraints?
Problem statement was to create a Data structure which will give us a high cache hit and with minimum iops.