Counting Driving Routes on a Street Grid With a Closed Intersection
Last updated: November 29, 2026
Quick Overview
Google Maps models a downtown grid where a driver must go 5 blocks east and 4 blocks north using only east and north moves. Count the routes, then count them again if the intersection 2 east and 2 north is closed.
0
0
0 solved
Google Maps models a downtown grid where a driver must go 5 blocks east and 4 blocks north using only east and north moves. Count the routes, then count them again if the intersection 2 east and 2 north is closed.
A combinatorics warm-up that Google phone screens use to check counting fundamentals before moving into coding. The interviewer wants the binomial coefficient argument, complementary counting for the closure, and a quick DP that confirms it.
What the Interviewer Expects
- Map each route to a sequence of E and N moves
- Count with a binomial coefficient
- Use complementary counting for routes through the closed point
- Confirm with dynamic programming
- Generalize to several closures
Key Topics to Cover
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
- How would you count routes avoiding two closed intersections?
- How many routes pass through a given intersection, and how is that used for traffic estimates?
- What changes if a road segment, not an intersection, is closed?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Statistics QuestionsSample Answer
Clarify
Moves are only east or north, so every route has exactly 9 moves: 5 E and 4 N. Intersections are lattice points; the start is and the end is . A closed intersection cannot be visited....
Approach
A route is determined by which 4 of the 9 moves are N, so there are routes. Routes through factor into a route to times a route from to . Subtract those....