Count Cable Routes Across a Datacenter Floor With Blocked Racks

Last updated: November 29, 2026

Quick Overview

An Azure datacenter floor is a grid where some cells hold racks that cables cannot cross. Count the distinct cable routes from the top-left cell to the bottom-right cell that only move right or down.

Microsoft
Coding & Algorithms
Software Engineer
Microsoft
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


An Azure datacenter floor is a grid where some cells hold racks that cables cannot cross. Count the distinct cable routes from the top-left cell to the bottom-right cell that only move right or down.

A grid DP warm-up in the style of Microsoft phone screens for Azure infrastructure teams. The interviewer is checking that the candidate sees the overlapping subproblems, handles blocked start or end cells, and can compress the table to one row.

What the Interviewer Expects
  • Define ways[r][c] as routes reaching cell (r, c)
  • Set blocked cells to zero ways
  • Initialize the first row and column carefully, since one block cuts off everything after it
  • Compress to a single row of length cols
  • Mention overflow for large grids
Key Topics to Cover
2D dynamic programming
grid paths
space optimization
Azure datacenter scenario
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Return the count modulo 1e9+7 on a 1000 by 1000 grid.
  • Allow diagonal moves as well. What changes?
  • Return the minimum-length route that passes through a required patch panel cell.
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements
  • grid is a list of rows, 0 = open, 1 = blocked rack.
  • Moves: right or down only.
  • Output: number of distinct routes; 0 if the start or end is blocked....
High-Level Design

Every route into (r, c) arrives from above or from the left, so ways[r][c] = ways[r-1][c] + ways[r][c-1] for open cells and 0 for blocked ones. A single array works: before updating column c in row ...


Submit Your Answer
Markdown supported