I was doing this coding round with a guy who asked me counting problem. I solved it with recursion. Then, showed the subproblems are over-lapping and there is optimal substructure, we should DP. Hence, I gave an approach when I cache the results in the recursion. He told this is not DP, and this is recursion + caching which is not DP! I am like what? I was confused by the guy for 10 mins. I didn't disagree with him, I thought that would be rude. He is very adamant so I don't think he was testing me by saying something wrong. Then I figured out he thought DP means only bottom-up approaches, I gave bottom-up approach and coded it. He is like this is good. What would you do in this situation? Would you disagree with the interviewer? I wasted 10 mins confused what to say. YOE: 1 year TC: $0(Got laid off recently)
You should never disagree with the interviewer, especially with your TC level.
Hahaha.
It’s fine in that you did it in coding round. If it be system design where answers are way more subjective things could be way more interesting. Maybe both sides would think the other side being incredibly dumb.
Agree that it should not work out right away and then walked out the door is the first time you slap the person with insults
What company was the interview at op? Seems like they have some real idiots
Probably Google or Facebook. They like to ask dynamic programming questions.
Was a small 40 person startup in SF. I don’t want to shame the company here, hope you understand.
They're both DP but some people think a solution with a 2D matrix/1D array is the only "real DP" lol
pedantic distinction since the time complexity and space complexity are usually the same.
You should just say got it and divert the topic to your needs
It depends on the context. In your case, I would have asked the interviewer to define the terms they are using to make sure we are both talking about the same thing.
Cars
Yesterday
1905
Why are Americans obsessed with SUV?
Tech Industry
Yesterday
48225
Goog Employees Arrested
Tech Industry
17h
2394
Go woke, go broke: Google fires 28 employees involved in pro-Hamas protest
Tech Industry
Yesterday
1568
How prestigious is databricks?
2024 Tax
10h
1672
Biden’s new tax proposal is wild
He's right, if you used recursion, then that's memoization (top down). Bottom up is dynamic programming.
Don’t you do memorization in bottom up?
https://stackoverflow.com/questions/6184869/what-is-the-difference-between-memoization-and-dynamic-programming