Am I expected to know Bellman Ford algo or will DFS/BFS solution be accepted in a real interview? I understand that getting the code accepted by leetcode.com is different from a real interview. 20 yoe and not once in my experience have I used Bellman Ford or Djikstra.
BF is 5 lines of code
People saying in real life we never use algorithms or any data structure are being very naive. Point is you should be able to communicate get requirement and collaborate well with good code quality. Why you think omg they ask BF. There are very limited ds and algo concept you will be getting topics to cover before interview as well. stop being lazy ass and read it once.
Have been in the industry long enough (20 yrs). BF is an advanced algo and so are data structures like segment and binary indexed trees. They've very limited usage in the industry. Other stuff I do use on my job. My question was if a DFS based solution would be acceptable for this problem. Stop being a LC monkey and be smart. In the interview you won't know if your DFS solution is giving TLE :-). Hence the question. Memorizing algorithms to get problems accepted by LC seems foolish to me.
Again I am not debating on the usage of any particular algo. The concensus has been problem solving is currently one of better way to judge someone is fit for software engineer. Coming to specific of it Dfs algo may or may not work with some company. For google i have given no hire and lean hire for l4 candidates for not optimal solution. But it depends on other signal as well during interview.
You're asked KMP in Leetcode 214 and FFT in Leetcode 835
Wow. So, as per @knoweee just get off your lazy ass and learn them :-) Hahahaha
There's also one with gradient descent
In the last 10 mins you should ask interviewer for aho corasick algorithm and if they fail you get to take their job? 😂
I get asked Bellman ford everytime I interview at Google.
They specifically call out Bellman ford?
Graph traversal with some negative paths. They didn't call it out it's just the only way to solve it. YMMV