## Direction at last square block

Given a R x C (1 <= R, C <= 1000000000) grid and initial position as top left corner and direction as east. Now we… Read More »

## Find Shortest distance from a guard in a Bank

Given a matrix that is filled with ‘O’, ‘G’, and ‘W’ where ‘O’ represents open space, ‘G’ represents guards and ‘W’ represents walls in a… Read More »

## Find shortest safe route in a path with landmines

Given a path in the form of a rectangular matrix having few landmines arbitrarily placed (marked as 0), calculate length of the shortest safe route… Read More »

## Print K’th element in spiral form of matrix

Given a 2D Matrix of order n X m , print K’th element in spiral form of matrix. See the following examples. Examples: Input: mat[][]… Read More »

## Microsoft Interview experience | Set 102 (On Campus for IDC)

Around 150 students appeared for the test. Round 1 (75 minutes): Online coding round hosted on HackerRank . Three coding questions were asked. Given a… Read More »

## Intuit Interview Experience | Set 11 (On-Campus)

Intuit was the first company to visit our campus. They selected 6 students. Online Round ———————— Only people with CGPA of 9+ were allowed to… Read More »

## Longest Possible Route in a Matrix with Hurdles

Given an M x N matrix, with a few hurdles arbitrarily placed, calculate the length of longest possible route possible from source to destination within… Read More »

## Find if given matrix is Toeplitz or not

Given a square matrix, find if it’s a Toeplitz matrix or not. A Toeplitz (or diagonal-constant) matrix is a matrix in which each descending diagonal… Read More »

## Find size of the largest ‘+’ formed by all ones in a binary matrix

Given a N X N binary matrix, find the size of the largest ‘+’ formed by all 1s. Example: For above matrix, largest ‘+’ would… Read More »

## Count zeros in a row wise and column wise sorted matrix

Given a N x N binary matrix (elements in matrix can be either 1 or 0) where each row and column of the matrix is… Read More »

## Print shortest path to print a string on screen

Given a screen containing alphabets from A-Z, we can go from one character to another characters using a remote. The remote contains left, right, top… Read More »

## Find maximum length Snake sequence

Given a grid of numbers, find maximum length Snake sequence and print it. If multiple snake sequences exists with the maximum length, print any one… Read More »

## A matrix probability question

Given a rectangular matrix, we can move from current cell in 4 directions with equal probability. The 4 directions are right, left, top or bottom.… Read More »

## Print n x n spiral matrix using O(1) extra space

Given a number n, print a n x n spiral matrix (of numbers from 1 to n x n) in clockwise direction using O(1) space.… Read More »

## Return previous element in an expanding matrix

We have a square matrix whose size is continuously expanding by a factor of 2. Given a sequence present in the matrix at position (i,… Read More »