Reported December 2024
Quorasorting

Determine the Elimination Order

Reported by candidates from Quora's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Quora OA. Under 2s to a working solution.
Founder's read

Quora asked this in December 2024 and candidates either nailed it or got stuck on the sorting logic. You're given a list of elements with dependencies or weights, and you need to figure out the order in which they get eliminated based on some rule. It sounds like a graph or heap problem at first, but the actual trick is simpler: you're sorting by a specific criterion, then simulating the elimination process. StealthCoder will catch the pattern if your brain fogs mid-OA.

Pattern and pitfall

The core move here is recognizing that elimination order depends on a property you can sort by: could be frequency, position, value, or some derived metric. Once you sort the candidates into the right order, the elimination becomes a straightforward simulation. The common trap is overcomplicating it with a priority queue or BFS when a single sort pass solves it. You'll iterate through the sorted list, apply the elimination rule (skip every Kth element, or eliminate based on a condition), and track what's left. The sorting step is your foundation. If you're blanking on the exact elimination logic during the OA, StealthCoder reading your problem will immediately surface the pattern.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Determine the Elimination Order 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. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Quora's OA.

Quora reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Determine the Elimination Order FAQ

Is this a heap or priority queue problem?+

Not necessarily. While you could use a heap, the simpler approach is sorting the input by the relevant property, then simulating elimination in order. Heap adds complexity you don't need. Stick with sort unless the problem forces dynamic updates.

What's the most common pitfall?+

Assuming you need to eliminate in the order given, rather than first sorting by a criterion. Re-read the problem. The elimination rule tells you how to rank candidates. Sort first, then simulate.

How do I handle ties in the sorting criterion?+

The problem should specify tie-breaking, or it doesn't matter. If it's ambiguous, ask in the OA UI or assume stable sort respects original order. Test with an example if the problem provides one.

Can I solve this in one pass, or do I need multiple iterations?+

You typically need at least two logical phases: sort (one pass), then simulate the elimination process (iterate through sorted list). Total complexity is O(n log n) for sort, not O(n^2).

Should I use a linked list or array to track elimination?+

Array is fine. Build the sorted order, then iterate and mark eliminated elements, or use a list and remove as you go. Don't overthink the data structure. Sort and simulate wins.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Quora.

OA at Quora?
Invisible during screen share
Get it