Engineer Software Interview Questions

419,802 engineer software interview questions shared by candidates

Given an N x M matrix A of non-negative integers representing the height of each unit cell in a continent, the "Blue lake" touches the left and top edges of the matrix and the "Red lake" touches the right and bottom edges. Water can only flow in four directions (up, down, left, or right) from a cell to another one with height equal or lower. Find the number of cells from where water can flow to both the Blue and Red lake.
avatar

Software Engineer

Interviewed at Google

4.4
Aug 9, 2021

Given an N x M matrix A of non-negative integers representing the height of each unit cell in a continent, the "Blue lake" touches the left and top edges of the matrix and the "Red lake" touches the right and bottom edges. Water can only flow in four directions (up, down, left, or right) from a cell to another one with height equal or lower. Find the number of cells from where water can flow to both the Blue and Red lake.

Write a function that given an array of numbers, return the highest occurrence of a number. Say 6 showed up the most (8 times) return 8. I over thought the question. This is in C and I'm guessing they just wanted a me to allocate a full array (256 for 8 bit) and +1 an entry whenever that number occurs (histo[number]++) while keeping the highest occurrence in a return variable if (histo[number] > highest) highest++;. I thought the solution was way too simple (like 6 lines tops) so I thought of a solution that would work for very large numbers for which a full array couldn't be allocated (64 bit = 2^64 array for instance). It wasn't as memory and computationally efficient as allocating a full array for lower bit number ranges (8, 16, 32) but it was a more robust and complete solution. Anyways, I guess he didn't see it that way. They turned me down. 8( So warning.. don't overthink a question on the phone interview. They're more likely to just want the 6 line quick answer on the phone interview. I think the phone interview is purely to weed out the complete idiots. If you overthink what they think is an easy problem then you look like a complete idiot. Onsite is be more challenging. I did the onsite a few years ago and the solutions and implementation required some thought.
avatar

Software Engineer

Interviewed at Google

4.4
Nov 10, 2016

Write a function that given an array of numbers, return the highest occurrence of a number. Say 6 showed up the most (8 times) return 8. I over thought the question. This is in C and I'm guessing they just wanted a me to allocate a full array (256 for 8 bit) and +1 an entry whenever that number occurs (histo[number]++) while keeping the highest occurrence in a return variable if (histo[number] > highest) highest++;. I thought the solution was way too simple (like 6 lines tops) so I thought of a solution that would work for very large numbers for which a full array couldn't be allocated (64 bit = 2^64 array for instance). It wasn't as memory and computationally efficient as allocating a full array for lower bit number ranges (8, 16, 32) but it was a more robust and complete solution. Anyways, I guess he didn't see it that way. They turned me down. 8( So warning.. don't overthink a question on the phone interview. They're more likely to just want the 6 line quick answer on the phone interview. I think the phone interview is purely to weed out the complete idiots. If you overthink what they think is an easy problem then you look like a complete idiot. Onsite is be more challenging. I did the onsite a few years ago and the solutions and implementation required some thought.

Viewing 2971 - 2980 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 419,802 interview questions and reports from Engineer software interviews. Prepare for your interview. Get hired. Love your job.