Product Engineer Interview Questions

7,062 product engineer interview questions shared by candidates

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 will represent numbers 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 that 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 which 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.
avatar

Product Engineer

Interviewed at Asana

4.1
Nov 20, 2018

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 will represent numbers 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 that 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 which 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.

Viewing 731 - 740 interview questions

Glassdoor has 7,062 interview questions and reports from Product engineer interviews. Prepare for your interview. Get hired. Love your job.