# 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.

TC: \$71K
YOE: 11 mo.

• Looks like you are overthinking this. Good luck!
Nov 6 0
• Intel V6ene
I wouldn't care that much about saying N^2 instead of N*M. Someone who had worked in CS for a long time may understand. Now you can only wait. Alea jacta est. Good luck.

What was the question on the interview?
Nov 6 2