Facebook onsite
✅ Facebook | E5 | Phone Screen + Virtual Onsite
sr software engineer e5Facebook | E4 | London | Interview Experience
E4Facebook E5 London Offer
Lead Engineer📌 Facebook | E5 | Bay Area | Phone Screen
Software Engineer E51 more experiences below
Summary
I'm sharing my onsite interview experience at Facebook, outlining the specific LeetCode problems I encountered. Additionally, I've provided a comparison of interview difficulties across various tech giants, and I'm happy to report that I ultimately received an offer from Google.
Full Experience
I recently navigated the onsite interview process at Facebook, and I've detailed the specific LeetCode problems I encountered during my rounds below. Having also interviewed with Google, Amazon, and Apple, I've developed a perspective on the relative difficulty of securing a position at each. In my experience, Facebook felt somewhat more accessible than Google, particularly if one has thoroughly prepared using the Facebook-tagged questions on LeetCode; I personally didn't encounter any questions that weren't already on LeetCode. On a difficulty scale, I'd rate Google around a 9, Facebook a 7 (or even a 5 if you've mastered their tagged questions), Apple a 5, and Amazon a 2 or 3, as it primarily focused on fundamental concepts. Although this post recounts my Facebook experience, I ultimately accepted an offer from Google, and things have been going great there. To anyone currently interviewing, keep up the excellent work – you'll achieve your goals!
Interview Questions (4)
You are given two strings, order and s. All the characters of order are unique and were sorted in some custom order previously. Permute the characters of s so that they match the order that order was sorted. More specifically, if a character x occurs before a character y in order, then x should occur before y in the permuted string. Return any such string.
Preparation Tips
My primary preparation strategy for Facebook was to thoroughly review and practice all the Facebook-tagged questions available on LeetCode. I found this approach highly effective, as I encountered no non-LeetCode questions during my entire interview process.
Summary
I recently completed my virtual onsite interview with facebook for the Sr Software Engineer (E5) position. The process included a phone screen and several onsite rounds covering coding, system design, and behavioral aspects. I received positive feedback from my interviewers and am currently awaiting the final decision from the hiring committee.
Full Experience
Last week, I had my virtual onsite interview with facebook for the Sr Software Engineer (E5) position. The overall experience was great.
Phone Screen
This was a 45-minute round where the interviewer asked two coding questions. I focused on understanding the problem, clarifying any ambiguities, and then verbally explaining my solution along with its time and space complexity. Once the interviewer was satisfied, I quickly implemented the solution and performed a dry run with test cases, including corner cases, finally explaining the complexity of my written code.
Virtual Onsite
The virtual onsite consisted of four 45-minute rounds: two Coding Rounds (Ninja), one System Design Round (Pirate), and one Behavioral Round (Jedi).
Coding Round 1:
Similar to the phone screen, I was given two coding problems to solve, applying my structured approach of understanding, verbalizing, implementing, and verifying.
System Design Round:
I was asked to design the privacy settings at facebook. I spent approximately 40 minutes discussing the design, and used the remaining 5 minutes to ask questions about facebook's culture.
Coding Round 2:
This round also involved two coding questions, where I applied my standard approach for solving them.
Behavioral Round:
The interviewer started by asking me about myself, my current project, and significant accomplishments. I was also asked if I had ever managed conflicting priorities and if I had received constructive feedback from a colleague. For each behavioral question, I provided a supporting anecdote from my past experiences, ensuring my answers aligned with facebook's mission and core values. Interestingly, this round also included one coding question.
Two days after my virtual onsite, I received a call from the recruiter informing me that the feedback from my interviewers was good, and they are still waiting for the hiring committee to make the final decision.
Interview Questions (10)
Have you ever had to manage conflicting priorities? Describe the situation and how you handled it.
Have you ever received constructive feedback from a colleague? How did you respond to it?
Preparation Tips
My general approach for answering coding questions involved:
- Thoroughly understanding the problem and asking clarifying questions.
- Verbally explaining my proposed solution, including the expected time and space complexity.
- Once the interviewer was satisfied with the verbal explanation, quickly implementing the solution.
- Performing a dry run with a few test cases, covering corner cases.
- Explaining the time and space complexity of the written solution.
For behavioral questions, I focused on providing supporting anecdotes from my experience and making sure my answers were in-line with facebook's mission and core values.
Summary
I interviewed with Facebook for an E4 role in London, tackling various coding challenges, system design, and behavioral questions across multiple rounds, and I am currently awaiting the outcome.
Full Experience
Hey Everyone,
I interviewed with Facebook for an E4 role in London. I am currently waiting to hear back from them regarding the outcome of my interviews.
Phone Screen:
This round involved two coding questions. I felt confident in my ability to solve both on time.
- Binary Tree to Doubly linked List.
- Evaluating expression (Only with +/* operators).
Onsite Coding 1:
I successfully solved both problems presented in this round within the given time frame.
- Multiplying 2 strings.
- Course Schedule problem on LeetCode.
Onsite Coding 2:
Only one question was asked in this round. I was able to solve it on time, even though I required one hint from the interviewer. Overall, the interviewer seemed convinced by my solution.
- LFU Cache Implementation.
Behavioral:
This round consisted of standard behavioral questions and some inquiries about my past work experience. I managed to tackle all the questions well, with only one or two proving to be a bit tricky.
System Design:
The challenge here was to design a system similar to Google Drive. I was able to approach the problem, but the interviewer continuously introduced new scenarios. I could answer some of these, but got stuck on others. I feel this round went below average to average.
Interview Questions (6)
Convert a binary tree into a circular doubly linked list in-place. The left and right pointers of the tree nodes should be used as previous and next pointers respectively in the doubly linked list.
Implement a basic calculator to evaluate a simple expression string that may contain integers and the operators '+' and '*'. The expression string does not contain any parentheses, division, or subtraction. Assume the given expression is always valid.
There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai. Return true if you can finish all courses. Otherwise, return false.
Design and implement a data structure for a Least Frequently Used (LFU) cache. It should support get and put operations with O(1) average time complexity. When the cache reaches its capacity, it should invalidate the least frequently used item. If there is a tie in frequency, invalidate the least recently used item among them.
Design a system like Google Drive, focusing on aspects such as file storage (e.g., block storage, deduplication), synchronization across multiple devices, versioning of files, access control and permissions, and overall system scalability and reliability.
Preparation Tips
For my preparation, I primarily used LeetCode for algorithm and data structure questions. For System Design, I relied exclusively on YouTube resources.
Summary
I successfully navigated the E5 Lead Engineer interview process at Facebook in London, securing an offer after a series of technical, behavioral, and system design rounds.
Full Experience
I had an interview for an E5 Lead Engineer position at Facebook in London. My experience level was 12 years.
Talk with the recruiter (30 mins):
This discussion was crucial for setting my expectations and understanding the interview process. The recruiter provided valuable insights and resources for preparation. I treated this as an interview itself, asking all my questions about the preparation process.
Technical Phone Screen (45 mins):
I was asked two coding questions in this round. Both were relatively easy, and the key was to articulate my thought process clearly. I made sure to test my code immediately after writing it, which impressed the interviewer.
Virtual Onsite (4 rounds):
Behavioral (45 mins):
This round focused on my past experiences in teams and how I handled technical challenges. The questions were open-ended, and each answer led to follow-up questions. I wasn't asked any coding questions in this round. My recruiter had mentioned that a strong positive signal in this round is critical, as a negative signal here can lead to a 'no-hire' decision even with strong technical performance.
System/Product Design (45 mins):
I was tasked with designing a file-sharing system similar to Dropbox. During requirement gathering, I pointed out a potential security issue with auto-sync, which seemed to impress the interviewer. My proposal for staggered scale-up based on usage trends also received positive feedback. I drove the discussion, answering clarification questions and providing high-level differences between SQL and NoSQL without getting bogged down in details.
Coding 1 (45 mins):
This round was similar to the phone screen but with a higher bar. I tackled two coding problems. The first involved a LeetCode problem, where I used Breadth-First Traversal and discussed follow-up questions on parallelization and memory constraints. The second was another LeetCode problem, which I solved very quickly.
Coding 2 (45 mins):
I faced two more coding questions here. For the first, which involved checking interval coverage, I initially missed a boundary case but caught and fixed it during testing without prompting, which was viewed positively. For the second, finding connected sub-graphs in an undirected graph, I used Depth-First Traversal. I ran out of time to complete the code, but because I had modularized my solution, I could clearly outline the remaining implementation details for the interviewer.
The next day, I received positive feedback from my recruiter for all four rounds and was informed that I would proceed to the review board. The offer came through the day after that.
Interview Questions (7)
Given a binary tree of integers, write a function that returns the sums of all the root-to-leaf paths.
Given a string representing an arithmetic expression with only addition and multiplication operators, return the result of the calculation.
Design a file sharing system similar to Dropbox. I discussed potential security issues with auto-sync, proposed staggered scale-up based on usage trends, and drove the design discussion, keeping it high-level and focused on requirements.
Given two integers X and Y (X<Y) and a list of intervals [(i,j)...] (where i is the start and j is the end of the interval), find if the intervals completely cover the given integer range [X,Y]. The intervals are sorted according to their start value. Example1: X=1, Y=6, List: [[1, 3], [3, 5]], output: true; Example2: X=3, Y=5, List: [[1, 4], [4, 7]], output: false.
Given an undirected graph (represented by pairs of nodes), list all connected sub-graphs (components).
Preparation Tips
Tips from my experience:
- Treat the recruiter call as an interview and an opportunity to ask about preparation resources and tips. Recruiters can be very helpful.
- For behavioral interviews, being genuine and self-critical goes a long way. Have significant projects from your CV ready with narratives, and be prepared for follow-up questions.
- For system design, keep the design high-level unless specifically asked to dive deeper. Stay focused on requirements and design a working solution. It's crucial to understand concepts in depth; avoid name-dropping technologies you can't elaborate on. At the same time, keep the big picture in mind and don't get lost in details.
- For coding rounds, always talk through your thought process and test your code without waiting for the interviewer to prompt you. This creates a positive impression.
Recommended Resources:
- Video on approaching problems and testing: https://www.youtube.com/watch?v=1wMBw38rAlw&t=358s
- System Design Reference Video (SQL vs NoSQL): https://www.youtube.com/watch?v=qI_g07C_Q5I&t=2130s
- Michail Smarchchok's YouTube channel: https://www.youtube.com/channel/UC9vLsnF6QPYuH51njmIooCQ (for concepts like caching, queues)
- Gaurav Sen's YouTube channel: https://www.youtube.com/channel/UCRPMAqdtSgd0Ipeef7iFsKw (for consistent hashing, hyperloglog, quad trees, bloom filters)
- Facebook live commenting talk (trade-off decisions): https://www.youtube.com/watch?v=IO4teCbHvZw&t=2300s&ab_channel=InfoQ
- Video on keeping design simple and confident communication: https://youtu.be/Z-0g_aJL5Fw
Summary
I successfully navigated my phone screen interview at Facebook for an E5 role in the Bay Area, demonstrating optimal solutions for two coding problems and ultimately receiving an offer.
Full Experience
I had my Facebook E5 phone screen interview, which lasted for 45 minutes. We started with a brief 3-5 minute introduction. The interviewer then clarified that the majority of the time would be dedicated to problem-solving, reserving the last 5 minutes for my questions.
The first question I encountered was Add Binary. Having practiced this problem before, I immediately explained the optimal approach, achieving a time complexity of O(max(l1, l2)). The interviewer was satisfied with my algorithm, and I quickly proceeded to code the solution in Java. After coding, I walked through my solution with a few examples. This entire segment, including discussion and coding, was completed within 10-15 minutes.
/** * Time Complexity: O(max(l1, l2)) * Space Complexity: O(max(l1, l2)) * l1 = Length of string A, l2 = Length of string B. */ public String addBinary(String a, String b) { if (a == null && b == null) { return "0"; }StringBuilder result = new StringBuilder(); int i = a.length() - 1; int j = b.length() - 1; int carry = 0; while (i >= 0 || j >= 0) { int sum = carry; if (i >= 0) { sum += a.charAt(i) - '0'; i--; } if (j >= 0) { sum += b.charAt(j) - '0'; j--; } result.append(sum % 2); carry = sum / 2; } if (carry == 1) { result.append('1'); } return result.reverse().toString();
}
Following that, the second question was Merge Intervals. Again, I was familiar with this problem and presented the optimal O(NlogN) approach. Once the interviewer approved the algorithm, I implemented the solution in Java and demonstrated its functionality with test cases. This question took approximately 20-25 minutes to complete.
/** * Time Complexity O(N log N) * Space Complexity: O(N) (Including the List<int[]> result) * N = Length of input array. */ public int[][] merge(int[][] intervals) { if (intervals == null || intervals.length <= 1) { return intervals; }Arrays.sort(intervals, (a, b) -> (a[0] - b[0])); List<int[]> result = new ArrayList<>(); int start = intervals[0][0]; int end = intervals[0][1]; for (int i = 1; i < intervals.length; i++) { if (intervals[i][0] <= end) { end = Math.max(end, intervals[i][1]); } else { result.add(new int[] { start, end }); start = intervals[i][0]; end = intervals[i][1]; } } result.add(new int[] { start, end }); return result.toArray(new int[result.size()][2]);
}
With a few minutes remaining, I took the opportunity to ask the interviewer two questions about their current work at Facebook. I was thrilled to later receive a call from the recruiter informing me of positive feedback from the hiring committee and that an offer would be extended.
Interview Questions (2)
Preparation Tips
My preparation focused on completing as many LeetCode questions as possible, especially those recently tagged with Facebook. This approach proved highly beneficial, allowing me to solve both interview problems optimally and within the strict time constraints.
Summary
I recently completed a virtual onsite interview for an E5 Software Engineer role at Facebook in the Bay Area, which consisted of two coding rounds, one system design round, and a behavioral round that also included a small coding problem.
Full Experience
I recently had a virtual onsite interview with Facebook for an E5 Software Engineer role in the Bay Area. The process involved four 45-minute rounds: two focused on coding, one on system design, and a behavioral round which surprisingly also included a small coding problem.
1st Coding Interview
The first coding round started with a problem similar to Intersection of Two Linked Lists, but presented in the context of a binary tree. I was asked to find the Lowest Common Ancestor (LCA) of two nodes in a binary tree, where each node only had a parent pointer. Initially, it took me a moment to connect it to the linked list intersection concept, but I eventually figured it out without any hints. I implemented a two-pointer solution in Java, achieving O(n) time complexity and O(1) space complexity. After walking through my code with a few examples, the interviewer seemed pleased. We then moved to a second coding question: Leftmost Column with at Least a One, which was identical to the problem found on LeetCode. I provided an optimal solution for this as well.
2nd Coding Round
In my second coding round, I tackled two problems. The first was Range Sum of BST, and the second was Trapping Rain Water. Both were exactly as they appear on LeetCode. I developed optimal solutions in Java for both. For the first question, the interviewer requested a few examples and base cases to test my solution. Unfortunately, we ran out of time before I could thoroughly walk through the solution for the second problem.
System Design Interview
The system design interview challenged me to design a Proximity Server. The core requirement was to, given a location's latitude and longitude, find all nearby places within a specified radius. I began by clarifying the essential features and discussing the design goals and potential scale. I then outlined a high-level design of the APIs. A significant portion of my discussion focused on the data structures and algorithms for efficiently finding nearby places; I proposed using a Quad Tree to represent geographical grids and store locations. I also delved into sharding strategies, briefly explaining Consistent Hashing, and the importance of caching for quick data retrieval. Additionally, I touched upon the application layer, mentioning stateless machines and load balancers. I later found a helpful video on this topic here.
Behavior Round
The behavioral round primarily centered on my projects at my current company. The interviewer also posed questions related to conflict resolution, how I've made an impact outside my immediate team, and my approach to problem-solving when faced with limited information. For each of these, I drew upon my past experiences to provide concrete examples. Towards the end, a simple coding problem was introduced: Valid Palindrome. I believe I performed well in this round, effectively communicating my experiences and solving the coding challenge.
Overall, I feel the interview went quite well. I've received an email from the recruiter indicating that it might take up to a week to hear back about the result. So, I'm keeping my fingers crossed!
Interview Questions (7)
Questions covered my projects at my current company, conflict resolution, demonstrating impact outside the team, and approaching problems with limited information.
Preparation Tips
My preparation journey was significantly aided by the LeetCode Community. Their support and resources over the past few months were invaluable in honing my skills. For a more detailed breakdown of my strategy, I've shared my full interview preparation journey here.