Freeing Shelves
Reported by candidates from Microsoft's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Microsoft's March 2025 OA included a problem called Freeing Shelves, and you've got 24-72 hours to nail it. The problem name alone suggests a state-space or graph traversal challenge, likely involving optimal removal or rearrangement logic. Without the full problem text, the most common shape here is either a simulation with constraints or a shortest-path variant. If you blank during the live assessment, StealthCoder will read the exact problem on screen and surface the pattern in real time, so you're not walking in blind.
Pattern and pitfall
Shelf problems at Microsoft typically encode one of two patterns: either a greedy/simulation approach where you identify which items can be freed under certain constraints, or a graph/BFS problem where each shelf configuration is a state. The word 'freeing' hints at removal or unlocking, not rearrangement. Look for dependencies: can item X only be removed if item Y is gone first. If the input is a list of items with weights or constraints, you're likely sorting or using a priority queue to find the safe removal order. If it's a grid or tree-like shelf structure, expect DFS or BFS to explore valid transitions. StealthCoder will parse the constraints instantly and flag whether you're looking at ordering logic or traversal. The trick is not overthinking; most shelf problems reduce to 'what can I safely remove now' repeated until done.
Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.
You can drill Freeing Shelves cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Microsoft's OA.
Microsoft reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Freeing Shelves FAQ
Is this a sorting or graph problem?+
Likely both. You'll probably need to understand the constraints first (sorting/order), then find the sequence of valid states (graph). Start by asking: what makes an item freeable right now. That usually reveals the pattern.
How much time do I have to solve it?+
Microsoft OAs typically run 60-90 minutes for 2-3 problems. Assume 25-40 minutes for this one if it's medium difficulty. If the problem text is short and constraints are clear, it's likely a 20-minute solve. Budget time to read carefully.
What's the most common mistake on shelf problems?+
Forgetting that removal order matters. Candidates often try to remove all items simultaneously or ignore dependencies. Build the solution iteratively: remove one item, update state, repeat. That simple discipline solves most of these.
Should I expect a custom data structure?+
Possibly. Microsoft likes to test whether you can model a problem cleanly. Don't over-engineer. A list, a set for tracking freed items, and a helper function to check if an item is freeable usually suffice.
Is this still asked in 2025?+
Yes. Shelf and container problems are perennial at Microsoft. The exact wording changes, but the core patterns stay the same. If you've seen a 'remove items' or 'valid ordering' problem before, this is in that family.