← Questions

Can every car park with preferred spots and forward-only overflow

0
MercorCodingLast asked Sep 2026

A coding interview question asked in Mercor's coding round, last asked Sep 2026. It tests arrays, greedy and simulation.

A one-way street has n parking spots in a row, numbered 0 to n - 1 in the direction of travel. Cars arrive one at a time, and car i prefers spot preferences[i].

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Mercor · Coding · Last asked Sep 202645 min · Live coding

What it tests

arrays · greedy · simulation

Your code and the AI tutor open when you unlock this question.