XPO Logistics Software Engineer Fresher
Anonymous User
283

Experience #1-0709232021

Round 1: The Online Test was taken on CoderByte Platform.

Question 1: Arrays

Given an array. For each of the elements return integer smaller/same than that and whose index is most closest to that. If smaller/same integer is not found on any of the indexes before that, then return -1 for that index.
eg. Input: 9 3 2 6 3 8 1
O/P: -1 -1 -1 2 2 3 -1

Question 2: Matrix

In a 2D Matrix with Values as 0 or 1, check if there is any path (i.e. path containing cells with only 1 and no zero) to reach from top left to bottom right. Movement in left,right,top,bottom directions are allowed and not diagonally.
If yes - return true.
If no - check if there is any path in which only replacing a single zero makes it a complete path that is path with all the 1s. If such path exists, return the number of such paths.
else : return "not possible".

Comments (0)