American Express is a good company. I took an online test for this company during a campus placement drive.
The test was pretty simple and comprised of three questions. Two of them were based on 2D matrix problems, and the last question was a medium-level string problem.
Second Question:
Given a 2D matrix of m rows and n columns, a cleaner robot is placed at position (0,0). The robot moves in the forward direction, cleaning tiles ('.') until an obstacle ('#') or the border of the matrix is encountered. It then turns clockwise and moves forward until another obstacle is encountered. Following these rules, the robot forms a cleaning path for itself.
Output the maximum number of tiles the robot can clean for a given matrix.
Constraints:
arr[i][j] is either '#' or '.' 1 <= m <= 20, 1 <= n <= 20 The starting point will always be a tile ('.')
The following metrics were computed from 1 interview experience for the American Express Online Test role in Chandigarh, Chandigarh.
American Express's interview process for their Online Test roles in Chandigarh, Chandigarh is extremely selective, failing the vast majority of engineers.
Candidates reported having very good feelings for American Express's Online Test interview process in Chandigarh, Chandigarh.