One-hour take-home coding challenge.
They care about time and do not want you to exceed it.
They grade you on:
They are pretty communicative about what you did wrong.
A very hungry rabbit is placed in the center of a garden, represented by a rectangular N x M 2D matrix.
The values of the matrix represent the number of carrots available to the rabbit in each square of the garden. If the garden does not have an exact center, the rabbit should start in the square closest to the center with the highest carrot count.
On a given turn, the rabbit will eat the carrots available on the square it is on, then move up, down, left, or right, choosing the square that has the most carrots. If there are no carrots left on any of the adjacent squares, the rabbit will go to sleep. You may assume that the rabbit will never have to choose between two squares with the same number of carrots.
Write a function that takes a garden matrix and returns the number of carrots the rabbit eats. You may assume the matrix is rectangular with at least 1 row and 1 column, and that it is populated with non-negative integers.
The following metrics were computed from 2 interview experiences for the Asana Product Engineer role in United States.
Asana's interview process for their Product Engineer roles in the United States is extremely selective, failing the vast majority of engineers.
Candidates reported having very good feelings for Asana's Product Engineer interview process in United States.