Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020

Posted
7 Jun 2020
332 reads

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.

How it went

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.

Questions asked (94)

  1. 01

    Find All Anagrams in a String

    Data Structures & Algorithms

    Open the problem
  2. 02

    Shortest Bridge

    Data Structures & Algorithms

    Open the problem
  3. 03

    Partition Equal Subset Sum

    Data Structures & Algorithms

    Open the problem
  4. 04

    Valid Palindrome II

    Data Structures & Algorithms

    Open the problem
  5. 05

    Kth Smallest Element in a BST

    Data Structures & Algorithms

    Open the problem
  6. 06

    Generate K Random Mines on Grid

    Data Structures & Algorithms

    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.

  7. 07

    Continuous Subarray Sum

    Data Structures & Algorithms

    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.

    Open the problem
  8. 08

    Verifying an Alien Dictionary

    Data Structures & Algorithms

    Open the problem
  9. 09

    Alien Dictionary

    Data Structures & Algorithms

    Open the problem
  10. 10

    Course Schedule

    Data Structures & Algorithms

    Open the problem
  11. 11

    Interval List Intersections

    Data Structures & Algorithms

    Open the problem
  12. 12

    Minimum Remove to Make Valid Parentheses

    Data Structures & Algorithms

    Open the problem
  13. 13

    Plus One

    Data Structures & Algorithms

    Open the problem
  14. 14

    Range Sum of BST

    Data Structures & Algorithms

    Open the problem
  15. 15

    Check for Two-Swap Similar Strings

    Data Structures & Algorithms

    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).

  16. 16

    Number of Connected Components in an Undirected Graph

    Data Structures & Algorithms

    Open the problem
  17. 17

    Add Binary

    Data Structures & Algorithms

    Open the problem
  18. 18

    Merge Two BSTs Inorder

    Data Structures & Algorithms

    Given two binary search trees, merge everything so it prints inorder.

  19. 19

    Valid Palindrome

    Data Structures & Algorithms

    Open the problem
  20. 20

    Add Strings

    Data Structures & Algorithms

    Open the problem
  21. 21

    Serialize and Deserialize Binary Tree

    Data Structures & Algorithms

    Open the problem
  22. 22

    Lowest Common Ancestor of a Binary Tree

    Data Structures & Algorithms

    Open the problem
  23. 23

    Smallest Subtree with all the Deepest Nodes

    Data Structures & Algorithms

    Open the problem
  24. 24

    Binary Tree Paths

    Data Structures & Algorithms

    Open the problem
  25. 25

    Minimum Window Substring

    Data Structures & Algorithms

    Open the problem
  26. 26

    Maximum Subarray

    Data Structures & Algorithms

    Open the problem
  27. 27

    Valid Parentheses

    Data Structures & Algorithms

    Open the problem
  28. 28

    Merge Intervals

    Data Structures & Algorithms

    Open the problem
  29. 29

    Task Scheduler

    Data Structures & Algorithms

    Open the problem
  30. 30

    Clone Graph

    Data Structures & Algorithms

    Open the problem
  31. 31

    Insert Interval

    Data Structures & Algorithms

    Open the problem
  32. 32

    Convert a Number to Hexadecimal

    Data Structures & Algorithms

    Open the problem
  33. 33

    Rotate Array

    Data Structures & Algorithms

    Open the problem
  34. 34

    K Closest Points to Origin

    Data Structures & Algorithms

    Open the problem
  35. 35

    Find All Paths Sum to Target in a Binary Tree (Discussion)

    Data Structures & Algorithms

    Open the problem
  36. 36

    Product of Array Except Self

    Data Structures & Algorithms

    Open the problem
  37. 37

    Closest Binary Search Tree Value

    Data Structures & Algorithms

    Open the problem
  38. 38

    Insert Delete GetRandom O(1)

    Data Structures & Algorithms

    Open the problem
  39. 39

    Fraction to Recurring Decimal

    Data Structures & Algorithms

    Open the problem
  40. 40

    Pow(x, n)

    Data Structures & Algorithms

    Open the problem
  41. 41

    Subarray Sum Equals K

    Data Structures & Algorithms

    Open the problem
  42. 42

    Best Time to Buy and Sell Stock

    Data Structures & Algorithms

    Open the problem
  43. 43

    Best Time to Buy and Sell Stock III

    Data Structures & Algorithms

    Open the problem
  44. 44

    Best Time to Buy and Sell Stock IV

    Data Structures & Algorithms

    Open the problem
  45. 45

    Add and Search Word - Data Structure Design

    Data Structures & Algorithms

    Open the problem
  46. 46

    Sudoku Solver

    Data Structures & Algorithms

    Open the problem
  47. 47

    Schedule of Tasks (Discussion)

    Data Structures & Algorithms

    Open the problem
  48. 48

    Binary Tree Maximum Path Sum

    Data Structures & Algorithms

    Open the problem
  49. 49

    Move Zeroes

    Data Structures & Algorithms

    Open the problem
  50. 50

    Valid Number

    Data Structures & Algorithms

    Open the problem
  51. 51

    First Bad Version

    Data Structures & Algorithms

    Open the problem
  52. 52

    Shortest Path with API Only

    Data Structures & Algorithms

    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.

  53. 53

    Group Shifted Strings

    Data Structures & Algorithms

    Open the problem
  54. 54

    Calculate Tax from Brackets

    Data Structures & Algorithms

    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.

  55. 55

    Path in Matrix from (0,0) to (m-1,n-1)

    Data Structures & Algorithms

    Is there a way to reach (0,0) from a mXn matrix to (m-1,n-1) position and give the path.

  56. 56

    Simplify Path

    Data Structures & Algorithms

    Open the problem
  57. 57

    N-ary Tree True Flag Distance

    Data Structures & Algorithms

    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.

  58. 58

    Is Graph Bipartite?

    Data Structures & Algorithms

    Open the problem
  59. 59

    Merge Sorted Array

    Data Structures & Algorithms

    Open the problem
  60. 60

    Remove Invalid Parentheses

    Data Structures & Algorithms

    Open the problem
  61. 61

    Binary Tree Level Order Traversal

    Data Structures & Algorithms

    Open the problem
  62. 62

    Longest Increasing Path in a Matrix

    Data Structures & Algorithms

    Open the problem
  63. 63

    Custom Sort String

    Data Structures & Algorithms

    Open the problem
  64. 64

    Read N Characters Given Read4

    Data Structures & Algorithms

    Open the problem
  65. 65

    Palindrome Permutation

    Data Structures & Algorithms

    Open the problem
  66. 66

    Max Consecutive Ones III

    Data Structures & Algorithms

    Open the problem
  67. 67

    Exclusive Time of Functions

    Data Structures & Algorithms

    Open the problem
  68. 68

    Search in Rotated Sorted Array

    Data Structures & Algorithms

    Open the problem
  69. 69

    Search in Rotated Sorted Array II

    Data Structures & Algorithms

    Open the problem
  70. 70

    Design Google Search

    System Design

  71. 71

    Debug Remote Server Not Responding

    System Design

    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.

  72. 72

    Debug Slow Responding Machine

    System Design

    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).

  73. 73

    Design Resource Copy N Sources to M Sinks

    System Design

    Design a system to copy resources from N sources (N < 10) to M sinks (M could be 10k/Millions etc.).

  74. 74

    Design File Storage System (Dropbox/Google Drive)

    System Design

  75. 75

    Design Scheduling Service

    System Design

    Design a scheduling service, focusing on a SQL approach. Discuss concurrency issues, table schemas, and composite keys.

  76. 76

    Design Instagram Celebrity Recommendation

    System Design

  77. 77

    Design Twitter Search

    System Design

  78. 78

    Design Content Publishing Site with Privacy

    System Design

  79. 79

    Design Uber

    System Design

  80. 80

    Design Type-Ahead Feature

    System Design

    Design a type-ahead feature for a website, discussing various data structures, their advantages/disadvantages, and different cases/scenarios.

  81. 81

    Design Instagram Client-Side

    System Design

  82. 82

    Design LeetCode Contest & Leaderboard System

    System Design

  83. 83

    Design Instagram

    System Design

  84. 84

    Design Keyword Search in FB Posts

    System Design

  85. 85

    Design Top 10 Songs per User Service

    System Design

    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.

  86. 86

    Design HackerRank-like Programming Contest System

    System Design

  87. 87

    Describe Your Current Role

    Behavioral

  88. 88

    Describe a Project You Are Proud Of

    Behavioral

  89. 89

    Giving Difficult Feedback

    Behavioral

    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?

  90. 90

    Conflict with Manager

    Behavioral

    Tell me about a time when you had a conflict with a manager and how you resolved it.

  91. 91

    Most Difficult Problem Solved

    Behavioral

  92. 92

    Ideal Work Environment

    Behavioral

    Which environment is best to you to work ?

  93. 93

    Best Life Decision from Childhood

    Behavioral

    Tell about best decision in your life from childhood ? Decision that changed your life

  94. 94

    Areas for Improvement

    Behavioral

    On which topics you want improve? What are doing to impoving on that topics ? Did you try build project on that topics ?

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Facebook recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

Be the first to share your thoughts and start the discussion!