Today, I had an interview with doordash. They gave me medium level program to solve it. First I gave the approach and data structure to be used. He asked me why I was using a list. Then I said we could use 2 d int array which might be efficient in problem. O(N) vs O(1) in searching, he liked my answer. I wrote the program and explained the logic. This was audio zoom call, I could sense he was doing something else. He gave five unit test cases in Java ( he did not have in C#). I took sometime in converting the inputs of Java to C#. ( I usually get confused jagged array vs multidimensional array). He asked me to google which I did. Out of five unit test case, three have been passed. Two unit test must be passed if I had more time. My issue is that here I gave optimal solution within 45 to 50 minutes with good design. He knows I struggled in syntax issues. Next thing I know within hour of interview, they did not find something which they are looking. I am pissed man..
Don’t waste your energy. Their loss. They don’t have tat high engineering bar but they pretend to have it in their irrational interviews.
Way to go
You should've went with the BFS/DFS approach. It's much easier to implement. Sorry. :( I had the same problem and spent maybe 15 minutes on it. I intentionally went slow with it too. Interviewer asked me to implement recursive and non-recursive solutions and then implement not just 4-direction but 8-direction search... I was done within 25-30 minutes easily even with some minor tripping over my feet with the non-recursive solution. Left plenty of time to just chat. Next time, look at questions on LC that are tagged for the company and freshen up on approaches. It doesn't mean you need to memorize solutions - just be familiar with the approaches and be able to notice how to approach a problem very quickly when reading it. Also - use a language everyone is more familiar with. C# isn't the most widely used in SF AFAICT... Python is very frequently used at least in startups. I interview with it exclusively because everyone knows it to some extent and it's widely supported across all interviewing platforms. (I work full-time in JS)
I went with BFS approach and finished the coding.. issue was I did not the api for multiple dimensions array in C#. I finished the coding in 15 mins. Api issue took most of my time
One thing I have noticed on a lot of posts is why are these amazon people so bitter about everything DD does ?
Sounds like you didn’t ask any clarifying questions, like moving diagonal
I had a very similar experience. Same problem and I got to the solution. Still rejected. I’m pissed.
a 40-45 mins for a medium is long. Do you mind post the question? Amazon asks you to do the medium-hard after their LP which is around 20-25 mins. FB asks 2 medium-hard within 40-45. If you solve a medium with 40-45 mins and did not pass all test cases, even considering syntax issue...
You have int array. We need to find the maximum sequence of any number repeating adjacent to same row or column. Ex: [ [1,2,2],[1,3,2],[1,1, 1]] answer is 5.
My program passed three test case.