Preparing for an interview? Check out Cracking the Coding Interview
Published on

Facebook (Meta) | E4 | Software Engineer | Passed | November 2023

Author
  • Shared Anonymously

Hello,

I wanted to share my experience as a way of paying it forward. Leetcode helped me a great deal when preparing for interviews, so thanks to everyone who contributed to the Discuss section!

Tech Screen:

  1. https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree-iii
  2. https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses

Onsite:
Coding 1:

  1. https://leetcode.com/problems/kth-largest-element-in-an-array
    I used the min heap (priority queue) solution. I also explained that I could sort the array and then just get the kth element from the end of it. I did not use the quicksort or mergesort solution.

  2. https://leetcode.com/problems/shortest-path-in-binary-matrix
    I used a DFS approach and explained how I could have also used BFS

Coding 2:

  1. https://leetcode.com/problems/merge-k-sorted-lists
    I did not use merge or quick sort for this. I used the continued iteration over the array of lists, and moving the pointer of the smallest element to the next element. Did this until every node in the array was pointing to None(null). O(Nk) complexity. I also explained I could use a min heap, but that would require extra log(k) space, though complexity could be improved a little by making it O(n log k)

  2. https://leetcode.com/problems/integer-to-english-words (I think my interviewer was trolling at this point \uD83D\uDE05)
    I did NOT code the solution for this. The interviewer just wanted to see what approach I would take. I explained to him that it would requiere a lot of pre-computation, and then explained how I would work on that. Coding this really is impossible in less than 45 mins.

System/Product Design:
Design the Facebook post privacy functionality. In other words, if I make a Facebook post, and I have 3 privacy options to choose from (Only Me, Friends Only, Public), design how wold you get the visibility for any Faceook user (ie. can a FB user see the post or not). I DID ask for System Design, but the interviewer did not seem to care lol.

I did have a behavioral round but I do not remember the questions, but they were the generic ones you can expect from any behavioral round.

Result: Heard back from Recruiter one week later. Got approved for an offer!! Will be starting in January as it's not really custom to start during the holiday season.

Thanks again Leetcode. My advice is to keep practicing the most-frequent problems over and over again.

Good luck everyone!

EDIT: Did not expect to see many questions. I have answered some of the most common questions in the post itself.

Location: New York City
YOE: 4.5 years

ReportMark as Helpful