I've interviewed at Google and Facebook before and bombed it. I used MIT OCW Introduction to Algorithms and some CLRS to prepare. This was before I heard about Leetcode. Now I see that Leetcode is the most popular place to practice for interviews, and that the ability to solve 2 problems in 45 minutes is not unheard of from FANG. I've been contacted by Google and Facebook again, and I'm using Leetcode now but I sense a weird paradox here. Many Leetcode problems, especially dynamic programming ones, cannot be reasonably derived and implemented in 45 minutes. In fact, my team recently implemented an optimization feature using DP that took a least 3 hours of meetings and a few days of programming to solve and get right. Modern interviews seem to be more about optimal pattern matching for specific classes of problems than problem solving for day to day work. I'm thinking the best way to prepare using Leetcode may be to internalize the solutions to each class of problem, then continuously try to reimplement from scratch until you can't get it wrong. What do you think? TL;DR: The best way to use Leetcode is to internalize the solution to problems, then continuously try to solve them only using active recall.
It’s an unfair world . You need to adapt. I agree with you. But if you don’t go with the flow, some loser will get that job because he had memorized the solution and could do two questions in 45 mins
That is correct. The person must be seriously talented if he/she can solve streaming median, max path sum in a binary tree, trapping rain water etc. just by reading heaps, trees and arrays from CLRS. Nowadays it’s all about recognizing patterns and in case of hard problems remembering solutions. However, I recently gave onsite interviews for Uber, Google, Apple and a bunch of other smaller companies, I don’t recall a single LC hard. I think companies are also learning.
So how did u solve them? Did they ask you questions for which you came up with a solution immediately? How did things help
Very true
There is no paradox there. A 10x code monkey has memorized solutions to 100 times more problem patterns than a plebxer who thinks she is real people and tries to think about developing solutions (lol they believe they can think so cute). So go on code monkeys. Move fast and break things. Those code mines aren't going to dig themselves
Thats why asking problems as is from leetcode doesn’t tell whether interviewee is genuine. I tweak problem and then boom sometimes it takes next 30 mins figuring out how part and then the real interview start.
I dont get it. None of the interview rounds I had recently were ridiculous LC hard questions (including Google interviews). All of them were reasonable problems with often times multiple approaches for solutions. Very few of the problems were the type of problem that requires some genius intuition or application of algorithms. I either got lucky or people overstate things often. I went through close to 30 rounds of interviews, so I think it's the latter.
I recently cleared G and F phone screens. Questions were pretty easy, I saw them for the first time and was able to code up soln easily. No LC questions AFAIK. In F, I was asked 3 questions, the 3rd was a little hard, still not hard like you see in LC. When the interviewer saw me struggling, he gave me hints which easily led to the soln. The fact that I cleared means it is ok to take hints and he did not take it negatively that I had coded a fix based on hints provided. Similar experiences with other companies, all easy questions. Did you finish onsite? Are questions asked onsite the same difficulty as phone screens. I am yet to do onsite so wanted to understand the expectations.
I didn't do Facebook onsite so I don't know about them but for Google, my onsites were definitely harder than my phonescreen. I got an LC medium on phone screen (literally exact same problem as one on LC), but none of the onsite questions were on LC, and they were also a bit different in terms of style of questions. More complex, multiple layers to the problem, etc.
Many Googlers feel like we got in by sheer luck. Three of my interviewers asked me very similar question, I am pretty sure I would fail an interview otherwise. What I like even more is the fact that I bombed a Twitter phone screen the week I passed Google interview. Either Twitter is much more demanding or those interviews do not reflect with engineering ability.
I don’t think either of your conclusions are true. They do reflect some engineering ability of course but there is a luck component in terms of what questions you receive. With phone screens especially as it’s usually just one question.
*Many* Googlers would be a gross generalization, and most likely untrue. Some yes, many, not sure.
How is this a surprise? Life is about pattern matching. Everything you do is: 1) be in a situation 2) match it to what you have seen in your life before 3) act based on your experience
This is a very broad generalization but anyway, we don’t: 1. Act in 45 mins 2. Are not expected to solve two situations in 45 mins 3. Are not always expected to come up with the optimal solution because no one knows what that is 4. Are not the only ones not knowing the solution, so for the other person too the problem is equally hard 5. Can seek help from internet, people etc. 6. Are not competing with others who have been in a similar situation already 7. Are able to get feedback if we fail so we can improve Add if anyone knows more!
You’re basically expected to memorize a bunch of algorithms, or at least the common parts.
Kinda obvious isn't it? What, you actually think someone could implement an LRU cache in 45 min seeing it for the first time? Or that people come up with the brilliant idea to use fast/slow pointers for cycle detection while holding a whiteboard marker? lmao
So what the hell are we testing for? I get asking algorithm and system design questions, but the heavy use of LC especially seems like the industry is optimizing for the wrong thing.
Ask Gayle McDowell.