Get Query Answers

Problem Overview

  • Build a cache query handler that returns the stored value for a given key at a specific timestamp.
  • Input: cache_entries (n×3: timestamp, key, value) and queries (q×2: key, timestamp); Output: int array of q values.
  • Constraints: up to 1e5 entries/queries, hh:mm:ss timestamps, alphanumeric keys, pair always present.
  • Real-world: time-stamped cache lookup; a coding interview problem and interview question from Ibm interviews.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: