I have an interview with Facebook and Google next month and am hoping to get some tips on preparation . I did a self evaluation and here are my findings: 1. I can solve no trick questions quickly without any difficulty. 2. Recursion and backing questions medium/ easy quickly 3. Am able to design and defend system designs questions relatively comfortably. Kind of questions I struggle with : 1. Dynamic Programming especially one with tricks . Ex Max profit selling stocks when k transactions are allowed 2. Trick recursion / back tracking problems EX: remove invalid parenthesis and generate all valid permutations 3. Distribute candy according to rating of children ( google candy question) 4. DNA sequence problem. I recently got a graph question in phone screen to solve in 30 minutes ( variant of topological sort) could not complete code as it took me time to understand the problem and come up with recursive code. No excuses but I hate I had less time. Any tips / suggestions / feedback on preparation and areas to focus .
Honestly, just bash leet code for a few weeks. I'm not even joking. I did that and got past the Google hiring committee. That said, I'm kinda disappointed in the whole Google interview experience. Once you get past the hiring committee you still have to compete with other candidates for an actual spot. They call it team matching. I've been in that phase for nearly 2 months and when I told them I'm going to look elsewhere they started shotgun matching me into "warm body required" positions. TL;DR leetcode > Google interview but it doesn't matter because the experience sucks after that anyways
Did you focus on medium/ easy or even hard ones. How much time did it take you to get through leetscode
Thanks ! Great feedback
50% of google coding questions were dynamic programming. Just practice it a bit it is not that much harder than recursion.
True. Just read the answers to the DP problems on leetcode. Walk through them on paper so you understand them. Come back another day and try to code the answers from memory so that you know you know the concepts. Do like ~10 or so and you most likely will have seen something similar when it comes time to interview.
Thanks for the feed back! Should I usually struggle with few medium and mostly hard questions in leets code. Example I struggled solving stock sale to maximize profit with k transactions but was able to do longest subsequence , palindrome etc easily. I am definitely not into competitive programming
Reading your points 1 and 2 together sets off alarm bells in my head. Recursion isn't a "trick". I don't ask trick questions, but some recursion is often required just for the warm-up. If you can't do it in your sleep, you need more practice.
Understood. Not worried about recursion / backtracking in general . There are a few tricky recursion questions that takes some time to formulate. I completely agree recursion is not trick did not mean to imply that .
Please understand, I didn't intend to criticize your writing, only to highlight a possible concern and give some flavor for interview styles. If you stumble even a little over things like recursion, asymptotic complexity, constraint satisfaction or BnB, then there's a good chance you won't make it to HC, because there won't be enough time to get to the meat of the question. Depends on the target level, of course.
well if you solve the max profit with K transactions allowed with a DP, then you're doing it wrong 😁 there are better and/or easier solutions :) that being said, interviews can be fun, but they are not meant to be, so unfortunately the best is just to practice a lot as people mentioned. the good news is, there are but that many DP or graph problem that one can reasonably ask for a 45min interviews, at the end they are all the same, ask using a small set of tricks, you just gotta learn them even if you will never use them in your work, it's sad, but you gotta do it (that being said I have used DP or recursive graph algorithm many times for my work, they do have concrete applications)
Thanks ! I solved the problem ( at most K transactions allowed using DP) definitely need to find better solution which I could not . But that is exactly my point in 45 mins if I take convoluted path I am toasted as it is hard for me to know that there may exist a simple solution and even if it comes to me in a while I have already lost valuable time .
A good example where I really struggled was Google Candy problem.
Facebook cares about speed, interviews are short so you don't have much time anyways! Leetcode definitely helps, but make sure you find the best and most optimized solution
I hardly think the interviewer always know and/or expect the most optimized solution. on the first problem he mentioned of the K transactions, I'm pretty sure a linear solution is not expected.
I agree, I got a FB offer and questions are not super difficult but needs to write code fast.
You better update this thread after your interviews.
I don't think it requires a lot of prep up for Uber interviews nowadays
I have interviewed with Google, Facebook multiple times. in process at one of them... Contrary to what people say...I have never had any difficult questions asked. most are leet code medium. none require a very complicated data structure. never been asked dynamic programming. disclaimer: I have 9 years exp....so the above may not apply to recent graduates. I feel recent graduates may get tougher questions because there is nothing else to rank them for (experience, leadership etc)
Thanks . Sorry forgot to add .I have 9 years backend + ML experience