New
The Learning module is now live
See what's new
×
Question Bank
Learning
NEW
Pricing
Blog
Forum
HOT
JobRadar
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Tesla
Coding Question
AI Insights
Quick Summary
Design a fixed-capacity cache that stores items alongside custom metadata like priority and expiration time.
Implement get, set, and evict operations that strictly enforce a tiered removal hierarchy based on expiry, priority, and access recency.
Dynamically update access timestamps on every successful insertion, update, or retrieval.
What This Tests
Synchronizing multiple hash maps to track interrelated attributes efficiently
Implementing multi-criteria selection logic under strict constraints
Handling edge cases such as capacity limits, expired entries, and empty caches
Evaluating time-space trade-offs in cache eviction strategies
Common Patterns
Hashing
Greedy
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Accepted
1.1k
/2.4k
Acceptance Rate
47.9%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.7-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected