InterviewLegend

Intervals & Custom Sorting

Alex Chen22 min readUpdated 43 real interview reports

Intervals come up more at Pinterest than the topic's reputation would suggest. A Premium question and its harder cousins land in phone screens. One onsite turned up a restaurant-seating capacity twist: find every window that can seat N guests given reservations and a room size. And the most-viewed Pinterest thread anyone has shared is a masonry-grid problem called "a Premium question." None of it is exotic. It is the same a Premium question, Insert Interval, Non-overlapping Intervals, My Calendar family you would drill for anywhere, in board-and-feed framing.

So treat this lesson as pattern reps, not as a Pinterest secret. The payoff is that two templates cover nearly every interval prompt you will see, and a third skill, writing a custom comparator and trusting it, quietly decides half of them. Get those three reflexes solid and the product framing stops mattering, because once you strip the Pin language off "a Premium question" you are looking at greedy interval scheduling and nothing more.

The Pinterest angle
When a prompt arrives framed as Pins, boards, or a scrolling feed, your first job is to find the interval underneath. A pin with a top and bottom pixel coordinate is an interval. A scroll session with an enter and exit position is an interval. A reservation with a start and end time is an interval. Say the translation out loud, "each pin is a span [top, bottom], and two pins collide when their spans overlap", before you write anything. It pins the problem down for the interviewer and stops you from inventing feed-specific machinery the question never needed.
What's inside
  • 3 problems, worked step by step
  • about 22 min

Premium lessonPinterest interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your Pinterest interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Pinterest interview guide

Know what Pinterest asks before you walk in.

14 coding · 5 system design · 16 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.