Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020
Summary
This is a comprehensive collection of interview experiences at Facebook, compiled from various LeetCode posts up to June 7, 2020. It covers questions encountered in Phone Screens, Coding Rounds, Design discussions, and Behavioral interviews, offering insights into the breadth of topics tested.
Full Experience
I've gathered a wide array of questions encountered by candidates interviewing at Facebook, organized by interview rounds. The compilation includes numerous Data Structures & Algorithms problems, often linked directly to LeetCode, as well as custom problem statements. System Design questions cover a range of topics from debugging server issues to designing scalable services like Google Search, Instagram, or file storage systems. Behavioral questions delve into common scenarios, personal experiences, and career aspirations. This collection aims to provide a broad overview of the types of challenges faced in Facebook interviews.
Interview Questions (94)
Find All Anagrams in a String
Shortest Bridge
Partition Equal Subset Sum
Valid Palindrome II
Kth Smallest Element in a BST
Generate K Random Mines on Grid
You are given a mn grid. You are asked to generate k mines on this grid randomly. Each cell should have equal probability of k / mn of being chosen. Your algorithm should run in O(m) time.
Continuous Subarray Sum
Given a list of positive numbers and a target integer k, write a function to check if the array has a continuous subarray which sums to k.
Verifying an Alien Dictionary
Alien Dictionary
Course Schedule
Interval List Intersections
Minimum Remove to Make Valid Parentheses
Plus One
Range Sum of BST
Check for Two-Swap Similar Strings
Given two strings, return true if they are similar, meaning only 2 positions in the strings are swapped (e.g., 'face', 'eacf' -> true because 'f' and 'e' are swapped).
Number of Connected Components in an Undirected Graph
Add Binary
Merge Two BSTs Inorder
Given two binary search trees, merge everything so it prints inorder.
Valid Palindrome
Add Strings
Serialize and Deserialize Binary Tree
Lowest Common Ancestor of a Binary Tree
Smallest Subtree with all the Deepest Nodes
Binary Tree Paths
Minimum Window Substring
Maximum Subarray
Valid Parentheses
Merge Intervals
Task Scheduler
Clone Graph
Insert Interval
Convert a Number to Hexadecimal
Rotate Array
K Closest Points to Origin
Find All Paths Sum to Target in a Binary Tree (Discussion)
Product of Array Except Self
Closest Binary Search Tree Value
Insert Delete GetRandom O(1)
Fraction to Recurring Decimal
Pow(x, n)
Subarray Sum Equals K
Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock III
Best Time to Buy and Sell Stock IV
Add and Search Word - Data Structure Design
Sudoku Solver
Schedule of Tasks (Discussion)
Binary Tree Maximum Path Sum
Move Zeroes
Valid Number
First Bad Version
Shortest Path with API Only
You have an API to check if it's possible to move left, right, up, down and one more method to check if current position is the last one. Find the shortest way to the last position. You don't have any data structure - only API.
Group Shifted Strings
Calculate Tax from Brackets
Calculate tax if Salary and Tax Brackets are given as a list in the form [ [10000, 0.3],[20000, 0.2], [30000, 0.1], [null, .1]], where null represents the rest of the salary.
Path in Matrix from (0,0) to (m-1,n-1)
Is there a way to reach (0,0) from a mXn matrix to (m-1,n-1) position and give the path.
Simplify Path
N-ary Tree True Flag Distance
N-ary Tree with each node having a boolean flag. Traverse all the nodes with only boolean flag = True. Return the total distance traveled from root to all those nodes.
Is Graph Bipartite?
Merge Sorted Array
Remove Invalid Parentheses
Binary Tree Level Order Traversal
Longest Increasing Path in a Matrix
Custom Sort String
Read N Characters Given Read4
Palindrome Permutation
Max Consecutive Ones III
Exclusive Time of Functions
Search in Rotated Sorted Array
Search in Rotated Sorted Array II
Design Google Search
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.
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).
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.).
Design File Storage System (Dropbox/Google Drive)
Design Scheduling Service
Design a scheduling service, focusing on a SQL approach. Discuss concurrency issues, table schemas, and composite keys.
Design Instagram Celebrity Recommendation
Design Twitter Search
Design Content Publishing Site with Privacy
Design Uber
Design Type-Ahead Feature
Design a type-ahead feature for a website, discussing various data structures, their advantages/disadvantages, and different cases/scenarios.
Design Instagram Client-Side
Design LeetCode Contest & Leaderboard System
Design Instagram
Design Keyword Search in FB Posts
Design Top 10 Songs per User Service
Design a service for music providers (like Spotify, Apple Music) to display the top 10 songs played by each user. Includes designing ER tables and APIs.
Design HackerRank-like Programming Contest System
Describe Your Current Role
Describe a Project You Are Proud Of
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?
Conflict with Manager
Tell me about a time when you had a conflict with a manager and how you resolved it.
Most Difficult Problem Solved
Ideal Work Environment
Which environment is best to you to work ?
Best Life Decision from Childhood
Tell about best decision in your life from childhood ? Decision that changed your life
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 ?