This is a verified interview question from Visa---2026-hackerrank-oa. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Cache Query Handler" covers key patterns like Other.
"Implement a prototype of a simple cache query handler that manages data entries stored in a cache. Each cache entry has the format: [timestamp, key, value] The handler receives queries of the form: [key, timestamp] For each query, you must return the corresponding data value stored in the cache for that exact [key, timestamp] pair. Note: - The same key can appear multiple times in the cache with different timestamps. - For a given timestamp, a key is unique (no duplicate [timestamp, key] pairs). - It is guaranteed that every queried [key, timestamp] exists in the cache. You are given: - cache_entries: a 2D array of strings, where each entry is [timestamp, key, value] - queries: a 2D array of strings, where each query is [key, timestamp] Return an array of integers representing the data values (converted from string to int) for each query."
Join thousands of developers practicing for Visa---2026-hackerrank-oa.