148 questions · from 12 interviews · 14 asked more than once
Facebook interview questions
Every question candidates reported from their Facebook interviews, most frequently asked first. Each links to the write-up it came from, so you can see the round and how it went.
Facebook coding and DSA questions
- 01
Minimum Remove to Make Valid Parentheses
Given a string s of '(' , ')' and lowercase English characters. Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid and return any valid string.
Medium · Asked 3 times · From Facebook onsite
- 02
Merge Sorted Array
Merge two sorted arrays into one sorted array, where the first array has enough space to hold elements from both.
Asked 3 times · From ✅ Facebook | E5 | Phone Screen + Virtual Onsite
- 03
Product of Array Except Self
Given an array of n integers, return an array of n integers where at each position 0 contains the multiplication of all the integers in the original array, except the one at the position i .
Asked 3 times · From Facebook | Android E4 | Remote | Reject
- 04
Valid Palindrome II
Given a string s , return true if it is a palindrome, or if it can be a palindrome after deleting at most one character.
Easy · Asked 3 times · From Facebook | Android E4 | Remote | Reject
- 05
Custom Sort String
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…
Medium · Asked 2 times · From Facebook onsite
- 06
Verifying an Alien Dictionary
Given a sequence of words and an alphabet ordering, determine if the words are sorted lexicographically in the alien language.
Asked 2 times · From ✅ Facebook | E5 | Phone Screen + Virtual Onsite
- 07
Course Schedule
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…
Medium · Asked 2 times · From Facebook | E4 | London | Interview Experience
- 08
Add Binary
Given two binary strings a and b, return their sum as a binary string.
Easy · Asked 2 times · From 📌 Facebook | E5 | Bay Area | Phone Screen
- 09
Merge Intervals
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.
Medium · Asked 2 times · From 📌 Facebook | E5 | Bay Area | Phone Screen
- 10
Range Sum of BST
Given the root of a binary search tree and two integers low and high, return the sum of all node values v such that low <= v <= high.
Easy · Asked 2 times · From 📌 Facebook | E5 | Bay Area | Virtual Onsite
- 11
Valid Palindrome
Given a string s, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
Easy · Asked 2 times · From 📌 Facebook | E5 | Bay Area | Virtual Onsite
- 12
Lowest Common Ancestor of a Binary Tree
During the technical phone screen, I was asked to find the Lowest Common Ancestor of a Binary Tree. I spent around 15 minutes on this question.
Asked 2 times · From 👩💻 Facebook Interview | E5 Level | Bay Area | Accept
- 13
Clone Graph
The second question in the first coding round was 'Clone Graph'.
Asked 2 times · From 👩💻 Facebook Interview | E5 Level | Bay Area | Accept
- 14
Subarray Sum Equals K
During the second coding round, one of the problems presented was 'Subarray Sum Equals K'.
Asked 2 times · From 👩💻 Facebook Interview | E5 Level | Bay Area | Accept
- 15
Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer, which could point to any node in the list or null. Construct a deep copy of the list.
Medium · From Facebook onsite
- 16
Word Search
Given an m x n grid of characters board and a string word , return true if word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where 'adjacent' cells are horizontally or vertically neighboring. The same letter…
Medium · From Facebook onsite
- 17
Lowest Common Ancestor of a Binary Tree III
Given two nodes, node1 and node2, in a binary tree, where each node also has a pointer to its parent. Find their lowest common ancestor.
- 18
Dot Product of Two Sparse Vectors
Implement a method to compute the dot product of two sparse vectors.
- 19
Kth Largest Element in an Array
Find the kth largest element in an unsorted array.
- 20
Convert Binary Search Tree to Sorted Doubly Linked List
Convert a Binary Search Tree (BST) into a sorted circular doubly-linked list in-place.
- 21
Diameter of Binary Tree
Find the length of the diameter of a binary tree.
- 22
Random Pick Index of Highest Number
Given an array of n integers, return using a normal distribution any index i that belongs to the highest integer in the array. This is similar to LeetCode problem 'Random Pick Index', but the target is specifically the highest number in the array.
- 23
Next Permutation
Given an array of n integers, return its next permutation.
- 24
Minimum Add to Make Parentheses Valid
Given a string with parentheses, return how many parentheses we need to add to make it valid.
- 25
Remove All Adjacent Duplicates In String
Given a string, simulate the 'deletion' process similar to Candy Crush in 1D. The resulting string should not contain two identical characters next to each other.
79 more in the Facebook write-ups.
Facebook system design questions
- 01
Design Privacy Settings
I was asked to design the privacy settings system at facebook.
- 02
Design Instagram Home Screen
Design the Instagram home screen, including requirements such as authentication with Facebook, handling a large list of posts (each with one image), like/dislike functionality, displaying user profile photos, and supporting an offline mode.
- 03
Design Google Drive
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.
- 04
Design Newsfeed API
I was tasked with designing an API for a newsfeed, similar to Instagram or Facebook, considering multiple clients.
- 05
Design Live Comments System for Videos
I needed to design a system to handle live comments for videos.
- 06
Design Dropbox
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.
- 07
Design a Load Balancer
Design a system for a load balancer.
From Facebook | E5 | Remote (Menlo Park) | Mar 2021 [Reject]
- 08
Design a Client Library for Mobile Media Downloads
Design a client library for a mobile phone that downloads media files (image, video, music/sound).
From Facebook | E5 | Remote (Menlo Park) | Mar 2021 [Reject]
- 09
Design a Proximity Server
Design a system that, given the latitude and longitude of a location, can find all nearby places within a given radius.
- 10
Design Facebook Status Search
I was tasked with designing the Facebook Status Search system in the system design round. I used an iPad to explain and draw the architecture diagram.
- 11
Design Messenger App
My task was to design a messenger application. During the discussion, I explored and discussed multiple architectural approaches for various components, emphasizing their tradeoffs and scalability implications.
- 12
Design Google Search
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 13
Debug Remote Server Not Responding
A remote server is not responding. Debug the issue, covering the entire TCP/IP stack (fragmentation, ICMP, etc.), machine metrics (vmstat, iostat, strace etc.), and describe virtual memory in terms of demand paging.
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 14
Debug Slow Responding Machine
Two machines are connected, suddenly one machine is responding slowly. Identify potential causes (NFS, Networking, Kernel resources like buffer-cache, inodes, virtual memory) and discuss diagnostic commands (strace, lsof, readlink, cat /proc/pid etc).
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 15
Design Resource Copy N Sources to M Sinks
Design a system to copy resources from N sources (N < 10) to M sinks (M could be 10k/Millions etc.).
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 16
Design File Storage System (Dropbox/Google Drive)
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 17
Design Scheduling Service
Design a scheduling service, focusing on a SQL approach. Discuss concurrency issues, table schemas, and composite keys.
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 18
Design Instagram Celebrity Recommendation
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 19
Design Twitter Search
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 20
Design Content Publishing Site with Privacy
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 21
- 22
Design Type-Ahead Feature
Design a type-ahead feature for a website, discussing various data structures, their advantages/disadvantages, and different cases/scenarios.
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 23
Design Instagram Client-Side
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 24
Design LeetCode Contest & Leaderboard System
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 25
Design Instagram
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
3 more in the Facebook write-ups.
Facebook behavioural and HR questions
- 01
Managing Conflicting Priorities
Have you ever had to manage conflicting priorities? Describe the situation and how you handled it.
- 02
Receiving Constructive Feedback
Have you ever received constructive feedback from a colleague? How did you respond to it?
- 03
Behavioral Questions: Ambiguous Requirements, Disliked Coworker
Behavioral questions involved discussing past experiences, specifically situations where I faced ambiguous requirements or had to work with someone I disliked.
- 04
Overcome Obstacles
Can you tell me about a time you had to overcome obstacles in a project?
From Facebook | E5 | Remote (Menlo Park) | Mar 2021 [Reject]
- 05
Conflict or Disagreement with Colleague
Tell me about a time you had a conflict or disagreement with a colleague.
From Facebook | E5 | Remote (Menlo Park) | Mar 2021 [Reject]
- 06
Change Something Outside Responsibility
Did you ever try to change something outside of your responsibility?
From Facebook | E5 | Remote (Menlo Park) | Mar 2021 [Reject]
- 07
Handle Vague Requirements
How do you handle vague requirements in a project?
From Facebook | E5 | Remote (Menlo Park) | Mar 2021 [Reject]
- 08
Behavioral Questions: Project Impact, Conflict Resolution, and Problem Solving
Questions covered my projects at my current company, conflict resolution, demonstrating impact outside the team, and approaching problems with limited information.
- 09
Describe Your Current Role
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 10
Describe a Project You Are Proud Of
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 11
Giving Difficult Feedback
Tell me about a time when you had to give someone difficult feedback. How did you handle it? What kind of feedback did you give?
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 12
Conflict with Manager
Tell me about a time when you had a conflict with a manager and how you resolved it.
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 13
Most Difficult Problem Solved
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 14
Ideal Work Environment
Which environment is best to you to work ?
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 15
Best Life Decision from Childhood
Tell about best decision in your life from childhood ? Decision that changed your life
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
- 16
Areas for Improvement
On which topics you want improve? What are doing to impoving on that topics ? Did you try build project on that topics ?
From Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
Facebook interview questions FAQ
What questions are asked in Facebook interviews?
Candidates reported 148 distinct questions across 12 Facebook interviews. 104 coding and DSA questions, 28 system design questions, 16 behavioural and HR questions.
Which Facebook interview questions are asked most often?
The most repeated are "Minimum Remove to Make Valid Parentheses" (3 times), "Merge Sorted Array" (3 times), "Product of Array Except Self" (3 times), "Valid Palindrome II" (3 times), "Custom Sort String" (2 times).
How difficult are Facebook interview questions?
Of the questions candidates rated, 27% were easy, 64% medium and 9% hard.