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.

Google
Statistics & Math
Software Engineer
Google
November 29, 2026
Software Engineer
Phone Screen
Statistics & Math
Easy

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
binomial coefficients
lattice paths
complementary counting
dynamic programming
inclusion-exclusion
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. 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 Questions
Sample 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 (0,0)(0,0) and the end is (5,4)(5,4). A closed intersection cannot be visited....

Approach

A route is determined by which 4 of the 9 moves are N, so there are (94)\binom{9}{4} routes. Routes through (2,2)(2,2) factor into a route to (2,2)(2,2) times a route from (2,2)(2,2) to (5,4)(5,4). Subtract those....


Submit Your Answer
Markdown supported