Skip to content

Sorting problems,
and the tell.

The answer gets easy once the data is in order, or the question is about rank, median or the k-th largest. 259 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 answer gets easy once the data is in order, or the question is about rank, median or the k-th largest.

The mechanism. Sort first, then the problem usually becomes one pass. Sometimes you do not need a full sort: a heap gives you the top k in n log k, and counting sort beats comparison sort when the values are small.

What goes wrong. Sorting when you did not have to. It costs n log n, and a hash map or a heap often answers the same question in linear time.

The ones asked most often.

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

  1. Intersection of Two ArraysEasyasked at 12 companies
  2. Maximum Performance of a TeamHardasked at 5 companies
  3. Count Zero Request ServersMediumasked at 5 companies
  4. Rank Teams by VotesMediumasked at 4 companies
  5. Minimum Deletions to Make Character Frequencies UniqueMediumasked at 3 companies
  6. Mark Elements on Array by Performing QueriesMediumasked at 2 companies
  7. Largest Submatrix With RearrangementsMediumasked at 2 companies
  8. Minimum Cost of Buying Candies With DiscountEasyasked at 2 companies
  9. Sell Diminishing-Valued Colored BallsMediumasked at 2 companies
  10. Sort an ArrayMediumasked 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 sorting problems.

Free to start, no card.

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

The answer gets easy once the data is in order, or the question is about rank, median or the k-th largest.

How many sorting 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 259, split roughly 34 easy, 124 medium and 42 hard in the sample we show, so work up rather than across.

What goes wrong most often in sorting problems?

Sorting when you did not have to. It costs n log n, and a hash map or a heap often answers the same question in linear time.

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.