Release Values in Id Order
Asked at Bloomberg · Coding Questions · Difficulty: Easy
Design a class that receives `n` values, each tagged with a unique integer id from `1` to `n`, in any order. The class must hand the values back in increasing id order: a value is released only once every smaller id has already been inserted and released.
Loading the problem…
More Bloomberg interview questions
- Streaming Social-Media Mentions and Aggregation
- Real-time Market Data Distribution System
- Trade Processor with Subscribe / Unsubscribe
- Flatten a Multilevel Doubly Linked List
- Matchsticks to Square Transform
- Train a Next-Word Predictor from Tokenized Sentences