Had a phone screen with Facebook last week. Want share some of what I learned with anyone new to the process. I got a DP problem. It could be solved without DP but it would be very slow. I started by solving it the slow way. I'm not sure if there would have been another question as I ran out of time just as I solved it the slow way. I had no time to add DP. First thing I learned is that time is your enemy. 5 minutes for intro, 5 for questions at the end and 5-10 for questions/clarifications. So u'll have less than 30 minutes to design and and solve 1 or 2 questions. Next, I learned that talking while figuring out a solution is hard. Probably requires either a lot of practice and/or that you have seen the question before. I'm leaning towards u need to have seen a very similar question. But I could be wrong/slow at solving. Funny thing is that Facebook has a workshop and they give a demonstration where the guy gets a problem and solved it perfectly in 5-10 minutes. That problem was much easier than what I got. And they probably have done it before. Similarly, just talking about your solution after you gave figured it out is time consuming. For this, practice is definitely the key. On the positive side, I learned that I can learn. I did like 70 leetcode, like 90% easy. And I watched a lot of YouTube examples. So I wasn't very prepared but the topics start to stick after a while. So I hadn't seen the question before, but I was able to use the methods I had learned to figure it out. And so I think that if I leetcode more and practice some mock interviews, then my chances of getting an offer are pretty good. I used to think this leetcode stuff was crazy and a waste of time. Now I'm all for it. And I just failed lol So my advice, keep leetcoding and time yourself on problems. I think once uve done a few hundred and you feel comfortable with medium, you should be ready. I'm still a bit uncomfortable with medium so I was definitely not ready. But it was a good learning experience. Yoe 15 TC 200
Yep! The key is basically to have seen the problem before. Remember they are not testing your ability to code. I struggle because I keep wanting to show I can code great things. They are testing your memory. You need to be able to recognize problems fast and regurgitate a solution.
I respectfully disagree. While you might be able to pass using that method, what they are really after is to understand how you think and how you solve problems.
Sure that’s the intent but the reality is that giving someone a dynamic programming problem which they haven’t been actively thinking about and practicing and then expecting a bug-free perfect solution in 20 minutes likely means the person looked at a bunch of similar problems beforehand and knows roughly what the answer is. I get the intent is to find those few people who really are that gifted analytically but that’s not what winds up happening in real life.
Better luck next time! Was that question from Leetcode?
70 Leetcode? Try 700
I respect time. Whenever I do interview I just start with question and tell the candidate that lets leave last 10minutes for any questions. This way some candidate takes 45, 50, 55 minute to complete the question and based on how much time left we do other intro talks. I feel we should give ample time to candidate rather than just assume that it should be solve in 20-25 mins and if it is prepare one more question.
Get your mind out of the gutter and punch a wolf in the mouth.
Congrats, most people don't even ever have one fisting experience
Let alone fisting with DP.
All the very best in your interviews!!
I totally agree with the need to practice or having seen a similar problem argument. Its possible that a miniscule portion of programmers can do these on their first go without any practice whatsoever.But I think that's what these interviewers are actually after.. but in the process they don't have a good way to assess rest of them. I have been working for past 10 years and in a few companies and at work my managers and peers always seem to give me the best reviews.But when I start interviewing I always struggle. I think real work and Interview process are 2 different things..We are better of not fighting that and keep practicing and give our best in interviews.. Good luck !
Yep. Interviewing is a separate skill than programming. It’s really weird to think that the interview wouldn’t be assessing on the job expertise but that’s the world we are in.
First phone screen with fb and they DPed you? I doubt it. You probably read the problem wrong. There is probably a more efficient solution w/o using DP.
Pretty sure. Recursive solution with multiple recursive branches. Many calls were duplicated and could save the answer easily in some sort of container and reuse the answers. It was probably one of the easier DP problems. Next time I see something similar I can solve in 15 minutes so I think it's fair to ask this one.
Just had a Facebook phone screen and got word break from leetcode. Easy DP
Very helpful !