PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

Practice a Optiver coding interview problem focused on implement a level-aware expiring inventory store. The prompt emphasizes edge cases, clean implementation, and verifiable test behavior without revealing the solution.

  • medium
  • Optiver
  • Coding & Algorithms
  • Software Engineer

Implement a Level-Aware Expiring Inventory Store

Company: Optiver

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Take-home Project

Implement an inventory store with levels, weights, timestamps, and expiration. `store` adds an item. `retrieve(timestamp)` returns and removes the highest-weight active item from the highest level where at least 50 percent of all items ever stored on that level are still active. Implement: ```python def process_inventory_operations(operations: list[list]) -> list[str]: pass ``` Return one item id for each retrieve, or an empty string if none is eligible.

Quick Answer: Practice a Optiver coding interview problem focused on implement a level-aware expiring inventory store. The prompt emphasizes edge cases, clean implementation, and verifiable test behavior without revealing the solution.

Process store and retrieve operations with level eligibility, expiration, and highest-weight retrieval.

Examples

Input: {"operations":[["store","a",1,5,0,None],["retrieve",1]]}

Expected Output: ["a"]

Explanation: Basic retrieval.

Input: {"operations":[["retrieve",1]]}

Expected Output: [""]

Explanation: Empty store.

Input: {"operations":[["store","a",1,5,0,None],["store","b",2,1,0,None],["retrieve",1]]}

Expected Output: ["b"]

Explanation: Higher eligible level wins.

Input: {"operations":[["store","a",1,5,0,None],["store","b",1,9,0,None],["retrieve",1]]}

Expected Output: ["b"]

Explanation: Highest weight on level.

Input: {"operations":[["store","a",1,5,0,2],["retrieve",2]]}

Expected Output: [""]

Explanation: Expired at timestamp 2.

Input: {"operations":[["store","a",1,5,0,10],["store","b",1,9,0,1],["retrieve",2]]}

Expected Output: ["a"]

Explanation: Level still 50 percent active.

Input: {"operations":[["store","a",1,5,0,1],["store","b",1,9,0,1],["retrieve",2]]}

Expected Output: [""]

Explanation: No active items.

Input: {"operations":[["store","a",1,5,0,None],["retrieve",1],["retrieve",2]]}

Expected Output: ["a",""]

Explanation: Retrieved item removed.

Last updated: Jul 4, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Maintain Price Levels For A Single-Symbol Order Book - Optiver (medium)
  • Build and Validate a Binary Tree from Parent-Child Pairs - Optiver (medium)
  • Days Between Two Calendar Dates - Optiver (medium)
  • Thread-Safe Stock Inventory: Buy and Sell Without Overselling - Optiver (medium)
  • Find missing numbers in sequences - Optiver (hard)