Implement Expiration-Aware Retrieval Across Storage Levels
Last updated: August 26, 2026
Quick Overview
The candidate is asked to implement a class with methods for storing and retrieving items while considering expiration and priority based on weight.
Optiver
August 26, 202630
0
303 solved
The candidate is asked to implement a class with methods for storing and retrieving items while considering expiration and priority based on weight.
This question is typically asked in the HR screen round for a software engineering role at Optiver to evaluate the candidate's understanding of object-oriented design and their ability to implement complex logic in code. The interviewer is looking for the candidate's problem-solving skills, attention to detail, and ability to follow specific requirements in their implementation.
What the Interviewer Expects
- Clear implementation of the class with an init function.
- Correct logic in the store method to handle item storage.
- Accurate retrieval logic that respects expiration and weight priority.
- Handling edge cases such as expired items and storage levels.
- Well-structured and readable code with appropriate comments.
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you optimize the retrieval process for large datasets?
- Can you explain your choice of data structures for this implementation?
- What would you change if the requirements included multi-threading support?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
The task requires implementing a class that can store items with a timestamp and weight. The retrieval method must check if items are expired and prioritize retrieval based on weight. Additionally, it...
High-Level Design
The class will have a list to store items, where each item is a tuple containing the timestamp, weight, and the level it belongs to. The store method will append items to this list, while the retrieve...