Skip to content

Queue problems,
and the tell.

The first thing in has to come out first: layers, scheduling, a buffer, a BFS frontier. 30 problems in the catalogue carry this tag, from first-week easy to interview hard.

Free to start. Running and submitting a solution never costs credits.

How the pattern actually works.

One mechanism, and the mistake that costs people the problem.

The tell. The first thing in has to come out first: layers, scheduling, a buffer, a BFS frontier.

The mechanism. Enqueue at the back, dequeue from the front, both in constant time. A deque adds the other two ends, which is what a sliding window maximum needs.

What goes wrong. Using a plain list and removing from the front. That shifts every element and turns constant time into linear.

The ones asked most often.

By how often the catalogue records them being set, not by our opinion.

  1. Count Subarrays With Fixed BoundsHardasked at 4 companies
  2. Time Needed to Buy TicketsEasyasked at 2 companies
  3. Jump Game VIMediumasked at 1 companies
  4. Find Consecutive Integers from a Data StreamMediumasked at 1 companies
  5. Dota2 SenateMediumasked at 1 companies
  6. Number of People Aware of a SecretMediumasked at 2 companies
  7. Constrained Subsequence SumHardasked at 1 companies
  8. Delivering Boxes from Storage to PortsHardasked at 1 companies
  9. Zigzag IteratorMediumasked at 2 companies
  10. Design Snake GameMediumasked at 2 companies

Read it, watch it, then solve it.

The order that makes a pattern stick.

Everything in the app, in one place.

Practice, interviews and the tools, all free to start. Swipe to see the rest.

Free to start: 100 AI credits when you sign up and 100 every month. Start free in the app

About queue problems.

Free to start, no card.

Start practising
How do I know a problem is a queue problem?

The first thing in has to come out first: layers, scheduling, a buffer, a BFS frontier.

How many queue problems should I solve?

Enough to stop needing the hint, which is usually ten to fifteen across the levels, not the whole list. The catalogue tags 30, split roughly 7 easy, 14 medium and 9 hard in the sample we show, so work up rather than across.

What goes wrong most often in queue problems?

Using a plain list and removing from the front. That shifts every element and turns constant time into linear.

Is practising by pattern better than a problem sheet?

A sheet tells you what to solve. A pattern tells you why those problems sit together, which is the part that carries over to the problem you have not seen. That is why the app files every problem under its pattern.