Think I just blew the Google Phone Screen
I applied for a new grad SWE role since my 11 months of experience in consulting as a dev have been pretty boring.
Prepped a lot of leetcode while keeping track of the actual working thought process, because i found that more interesting than just counting the number of problems i solved.
The question i got wasn’t on leetcode but definitely sounds like a standard medium problem. the problem basically gave me a grid’s dimensions to work with. I came up with a brute force solution but foolishly said the runtime was O(N^3) when i forgot the dimensions aren’t even equal. then i used DP to actually build a grid with extra space and reduce the time to O(N^2) but again N != M every time so rip.
the interviewer didn’t question the runtime and space complexity at any point but i can’t assume he didn’t notice that mistake either. he said he liked the optimized solution but he didnt have time to ask a follow up. later on found the solution on geeksforgeeks which is basically a one line math function to do it all in constant time and space. thought maybe this is not the solution they’d expect because they’d want something algorithmic and only a math enthusiast could create that. so theres another way to calculate it in O(min(N,M)) time and constant space.
just didn’t seem like my day at all because i’ve done so many interviews on pramp until i couldn’t be paired up with other users. i have not made this complexity analysis mistake either in these mock interviews, plus i didnt get to the follow up question, so im just speechless right now. shouldve been way faster at coming up with the 2 solutions.
YOE: 11 mo.