Hi everyone, i recently got an offer from FB london for E5 role. This community has been of tremendous help and now i’m trying to do my part in helping others.
Can’t share the exact questions because of NDA so please don’t ask but they were from top asked questions on FB tagged list.
Sharing my interview exp first and then will explain how i prepared for it.
Interview process/exp
Recruiter reached out to me in July. Standard questions around why do you want to change and my current role.
Then he explained that i’ll have one telephonic screening round and if i pass that then i’ll have 4 onsite rounds.
Telephonic round
I took 6 weeks to prepare for telephonic round.
Had two questions (both are on LC):
1 easy 1 medium - Was able to solve both in time and discussed the time complexity and edge cases.
Got an email shortly after that the feedback was positive and i’ll be advancing to onsite rounds.
Recruiter explained about the on site loop and how to prepare for it and told me to take as much time as possible.
I took another 7 weeks for this.
4 rounds were divided over 2 days. First day i had behav and product design and on second day i had 2 coding rounds.
ONSITE
Behav: Standard questions around challenging projects, conflicts, strengths, time i had to convince other team to make changes etc. I felt that this round went good.
Product design: Again a popular question. Was very nervous in the beginning but got hold of the flow with time. Try to focus on building and achieving the end goal. Don’t talk too much about complex technical terms/jargons. I was able to build the end product but felt like i didn’t do a good job at scaling it, so was feeling 50/50 after this round.
Coding 1st round: 2 LC medium questions. Was able to solve both in time and answered the followup questions as well as explained the time/space complexity correctly. I absolutely nailed this round.
Coding 2nd round: 2 LC medium questions. Took a little bit too much time on first question as interviewer kept interrupting me and was very thorough with the dry run of a very complex test case. I had less time for second question but thankfully i was able to complete that as well. Had mixed feeling about this round as well because of first question.
After few days i got an email saying that the feedback was good and they would like to make an offer.
How i prepared for it:
Coding:
Here are some of the links that i found useful:
DP: https://leetcode.com/discuss/general-discussion/458695/dynamic-programming-patterns
Recursion/backtracking:
https://leetcode.com/problems/permutations/discuss/18239/A-general-approach-to-backtracking-questions-in-Java-(Subsets-Permutations-Combination-Sum-Palindrome-Partioning)
A thing about backtracking solutions is that most of the solutions use “for" loops inside recursion which i find very confusing and unnecessary. Also it makes harder to reason about time complexity.
For eg: for the subsets problem (https://leetcode.com/problems/subsets/) even the official solution is using for loop which is not needed.
The way you can solve these type of questions is as follow:
var subsets = function(nums) {
const result = [];
const backtrack = (index, currentSet) => {
if(index == nums.length){
result.push([...currentSet]);
return;
}
// Don't include this element
backtrack(index + 1, currentSet);
// include this element
currentSet.push(nums[index]);
backtrack(index + 1, currentSet);
currentSet.pop(); // remove for backtracking
};
backtrack(0,[]);
return result;
};this is much simpler and we can see quickly that the time complexity is 2^n as we are calling the recursive method two times.
**Monotonic queue: **
https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/discuss/204290/Monotonic-Queue-Summary
https://leetcode.com/list/9o8a426j
Sliding window:
https://leetcode.com/problems/minimum-window-substring/discuss/26808/Here-is-a-10-line-template-that-can-solve-most-'substring'-problems
Top K frequent/near/shortest/largest etc: Hope eveyone knows that heap is the way to go but there is another way to do this which is more efficient. See the second approach here
https://leetcode.com/problems/top-k-frequent-elements/solution/
Graphs:
I used the graph course of leetcode and found it really good. Would recommend.
Here’s what you need to cover:
Prefix sum : https://leetcode.com/problems/path-sum-iii/solution/
Product design:
General resources: gro*** ing, Alex Xu, DDIA (not needed for product design but amazing for system design), YouTube
Give mock sessions as much as you can. Sign up on pra** mp and start doing it ASAP.
I started by reading the gro** ing course. it’s good but i found it a bit shallow as it did not do a good
job at explaining why they take some decisions that they do.
For product design: assume that database scaling isn’t an issue. Maybe learn a bit about sharding and how to chose a good shard key but that’s it. Don’t go into consistent hashing, replication etc.
I did it and it was a waste of time. I even read two chapters of DDIA ffs. It’s not needed even though it’s an amzing read.
Focus more on API design, pagination, caching at both client and server side, privacy, security, monitoring, audit systems, telemetry.
You’d feel you are not doing good in interview but don’t lose focus and keep your composure. It’s not about just building the product but the decision that you make and why. Always
list trade-offs everywhere. Using REST ? Why? Using Redis? Why? Building a cron job? Why - explain every decision.
Also when you read about a topic do a deep dive: for eg: everyone likes to add a message queue in their system but then when asked followup quesions they don’t have any answer. What if the queue fails, retries, ensuring order and guarantee? Duplicates? so on. Do learn about these things as they are not explained in your general reading/learning materials. (I think they are explained in DDIA but then again that book has everything and some more).
Practice design questions from these lists:
Behavioural
My only advice is that don’t take this lightly and be genuine. Don’t lie, you are not fooling anyone. Take one week to prepare for this. Go over your resume and think of the times where you had faced challenges, your achievements, failures, conflicts etc.
YOE: 6.5
Thanks and let me know if you have any questions.