InterviewLegend

Graphs & Grids

Alex Chen20 min readUpdated 387 real interview reports

Graphs show up regularly in Apple's coding rounds, and two problems carry most of the grid-and-graph cluster. Counting a Premium question in a grid is the top grid question by candidate reports, asked as the clean classic with no exotic twist. A Premium question, the question of whether a set of tasks with prerequisites can be ordered at all, recurs in the same loops. Both sit in the medium band that the loop lives in, so the bar is correct, tested code that handles its edges. A clever trick nobody has seen before earns no extra credit.

The two cluster together because each one is really a graph problem with the graph hidden behind the setup, and spotting it underneath is the only hard part. A grid of land and water is a graph where every cell connects to its four neighbors. A list of course prerequisites is a directed graph where an edge means "do this one first." One traversal pattern and one ordering pattern cover both. Once you know which graph the prompt hides, the only open question is which skeleton fits, and the rest is careful typing.

What's inside
  • 3 problems, worked step by step
  • about 20 min

Premium lessonApple 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 Apple interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Apple interview guide

Know what Apple asks before you walk in.

22 coding · 4 system design · 30 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.