← Amazon questions

Rat in a Maze problem

Filed under Amazon · Also reported at Aricent, Chubb Business Services LLP, DE Shaw, Grofers, Yatra.com

Consider a rat placed at (0, 0) in an n x n square matrix `m`. It has to reach the destination at (n - 1, n - 1). Find all possible paths the rat can take to reach the destination, moving only in the…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.