Data Structures & AlgorithmsModerateTCS NQT · Infosys

Problem: In a 3-row Pascal-like grid, a cell holds the number of ways to reach it moving only right or down from (0,0), with a blocked cell at (1,1). What is the number of ways to reach (2,2)?

  1. A. 3
  2. B. 2
  3. C. 1
  4. D. 4

Correct answer: B. 2

Grid path counting with a blocked cell: the blocked cell contributes zero to every cell that would have used it. Forgetting to zero it gives the unobstructed count of 6.

More Coding Interview Problems questions

Exams that ask this topic