Graphs & Trees
A Cash App payment is an edge in a graph. One account sends money to another. That single transfer becomes a line between two nodes, and across millions of users the structure gets enormous. Fraud teams score how money moves between accounts to catch scams, and the shape underneath that work is a graph question: who connects to whom, and how far the connection reaches. The coding round almost never uses the word graph. It hands you a stream of transfers, a list of seller locations, or a grid a delivery has to cross, and recognizing the traversal is the job.
This lesson bundles the traversal patterns that round out Block's medium bar. BFS and DFS over a graph, the same search over a grid as a step-by-step simulation, tree aggregation, and the lighter dynamic programming that surfaces onsite. Where the structure is textbook, the foundational version lives in the free course. This page stays on the Cash App and Square problems Block reaches for and the escalating follow-ups that carry the grade.
- 2 problems, worked step by step
- about 14 min
Premium lessonBlock 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
Block interview guideKnow what Block asks before you walk in.
13 coding · 5 system design · 14 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.