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

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-06-07Added By Anonymous
Source: Link
Facebook interview experiences - All Combined from LC - Till Date 07-Jun-2020

1. Phone Screen:
1. https://leetcode.com/problems/find-all-anagrams-in-a-string/
2. A string / array problem involving distinct characters and window
3. https://leetcode.com/problems/shortest-bridge/
4. https://leetcode.com/problems/partition-equal-subset-sum/
5. https://leetcode.com/problems/valid-palindrome-ii/
6. https://leetcode.com/problems/kth-smallest-element-in-a-bst/
7. You are given a m*n grid. You are asked to generate k mines on this grid randomly. Each cell should have equal probability of k / m*n of being chosen. Your algorithm should run in O(m) time.
8. https://leetcode.com/problems/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.)
9. https://leetcode.com/problems/verifying-an-alien-dictionary/
10. https://leetcode.com/problems/alien-dictionary/
11. https://leetcode.com/problems/course-schedule/
12. https://leetcode.com/problems/interval-list-intersections/
13. https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/
14. https://leetcode.com/problems/plus-one/
15. https://www.geeksforgeeks.org/find-index-maximum-occurring-element-equal-probability/
16. https://leetcode.com/problems/range-sum-of-bst/
17. Similar strings ("face", "eacf") returns true if only 2 positions in the strings are swapped. Here 'f' and 'e' are swapped in the example.
18. https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph
19. https://leetcode.com/problems/add-binary/
20. Given two binary search trees how do we merge everything so it prints inorder. The answer I gave was to run inorder on both trees and use "merge" from merge-sort.
21. https://leetcode.com/problems/valid-palindrome
22. https://leetcode.com/problems/add-strings
23. https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
24. https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree
25. https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/
26. https://leetcode.com/problems/binary-tree-paths
27. https://leetcode.com/problems/minimum-window-substring
28. How to remove duplicates from a list
29. https://leetcode.com/problems/maximum-subarray
30. https://leetcode.com/problems/valid-parentheses
31. https://leetcode.com/problems/merge-intervals
32. https://leetcode.com/problems/task-scheduler/
33. https://leetcode.com/problems/clone-graph/

2. Coding Round 1:
1. https://leetcode.com/problems/insert-interval/
2. https://leetcode.com/problems/convert-a-number-to-hexadecimal/
3. https://leetcode.com/problems/rotate-array/
4. https://leetcode.com/problems/k-closest-points-to-origin/
5. https://leetcode.com/discuss/interview-question/124759/
6. https://leetcode.com/problems/product-of-array-except-self
7. https://leetcode.com/problems/find-all-anagrams-in-a-string/
8. https://leetcode.com/problems/minimum-window-substring/
9. https://leetcode.com/problems/closest-binary-search-tree-value/
10. https://leetcode.com/problems/insert-delete-getrandom-o1/
11. https://leetcode.com/problems/fraction-to-recurring-decimal/
12. https://leetcode.com/problems/powx-n
13. https://leetcode.com/problems/subarray-sum-equals-k
14. https://leetcode.com/problems/best-time-to-buy-and-sell-stock
15. https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii
16. https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv
17. https://leetcode.com/problems/add-and-search-word-data-structure-design
18. https://leetcode.com/problems/sudoku-solver/
19. https://leetcode.com/discuss/interview-question/338948/Facebook-or-Onsite-or-Schedule-of-Tasks
20. https://leetcode.com/problems/binary-tree-maximum-path-sum
21. https://leetcode.com/problems/maximum-subarray
22. https://leetcode.com/problems/move-zeroes
23. https://leetcode.com/problems/valid-number
24. https://leetcode.com/problems/first-bad-version/

3. Coding Round 2:
1. https://leetcode.com/problems/valid-number/
2. You have an API to check if is it 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.
3. https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
4. https://leetcode.com/problems/group-shifted-strings/
5. https://leetcode.com/problems/task-scheduler/
6. Calculate tax if Salary and Tax Brackets are given as list in the form
[ [10000, 0.3],[20000, 0.2], [30000, 0.1], [null, .1]]
null being rest of the salary
7. Is there a way to reach (0,0) from a mXn matrix to (m-1,n-1) position and give the path.
8. https://leetcode.com/problems/simplify-path/
9. 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.
10. https://leetcode.com/problems/product-of-array-except-self/
11. https://leetcode.com/discuss/interview-question/432086/Facebook-or-Phone-Screen-or-Task-Scheduler/394783
12. https://leetcode.com/problems/find-all-anagrams-in-a-string
13. https://leetcode.com/problems/is-graph-bipartite
14. https://leetcode.com/problems/merge-sorted-array
15. https://leetcode.com/problems/maximum-subarray
16. https://leetcode.com/problems/serialize-and-deserialize-binary-tree
17. https://leetcode.com/problems/remove-invalid-parentheses/
18. https://leetcode.com/problems/subarray-sum-equals-k/
19. https://leetcode.com/problems/binary-tree-level-order-traversal/
20. https://leetcode.com/problems/longest-increasing-path-in-a-matrix/
21. https://leetcode.com/problems/custom-sort-string
22. https://leetcode.com/problems/read-n-characters-given-read4
23. https://leetcode.com/problems/remove-invalid-parentheses
24. https://leetcode.com/problems/palindrome-permutation
25. https://leetcode.com/problems/max-consecutive-ones-iii
26. https://leetcode.com/problems/range-sum-of-bst
27. https://leetcode.com/problems/exclusive-time-of-functions
28. https://leetcode.com/problems/search-in-rotated-sorted-array/
29. https://leetcode.com/problems/search-in-rotated-sorted-array-ii/

4. Design:
1. Design Google search
2. Some question related to caching and balancing. Not exactly the "design twitter" type of question, but expect to talk about different components, latency, throughput, consistency and availability.
3. A remote server is not responding. Debug the issue. Needed to cover entire TCP/IP stack(fragmentation/icmp/etc) + machine metrics (vmstat,iostat,strace etc). Describe virtual memory in terms of demand paging.
4. 2 machines are connected, suddenly 1 machine is responding slowly. Why ?
We had a good discussion in which we discussed everything under the sun, from NFS being bad to Networking being wrong to Kernel running out of resources(buffer-cache/inodes/virtual memory). Interviewer was interested to know the commands that i would use (strace, lsof, readlink, cat /proc/pid etc).
5. Copy some resource from N sources to M sinks. where N could be < 10 and M could be 10k/Millions etc.
6. Design File Storage System. Like Dropbox, Google Drive
7. Not any fancy one like design Twitter or Uber. More on scheduling service side and i designed using SQL appraoch. Discussed concuurency issues, Table schemas, composite keys etc.
8. Design recommendation of celebrities to user on Instagram
9. Design search for Twitter
10. Design a Content publishing site with privacy restrictions.
11. System Design of Uber. He liked my design. He was really nice guy, i felt he was interested in my success.
12. Design a type ahead features for a website. We discussed various data structures, advantage /disadvantages. Lot of different cases, scenario to handle etc.
13. Design instagram client side.
14. Design a leetcode contest, leadership board system
15. Design Instagram
16. Design keyword search in FB Posts
17. There are music providers like spotify, apple music etc. Design a service for these providers to display top 10 songs played by each user. Was aked to write ER tables and API's.
18. Design a system like Hacker Rank for a programming contest and their ranking.

5. Behavioral:
1. Work experience, past projects, standard "tell me about a time" questions, hypothetical scenario questions
2. Usual stuff around things that I am proud of/ projects that I regret etc
3. Tell me about your current role
4. Tell me about a projects you are proud of
5. Tell Me About A Time When You Had To Give Someone Difficult Feedback. How Did You Handle It?(What kind of feedback you give ?)
6. Tell me about a time when you had a conflict with a manage and how you resolved it
7. What's the most difficult/challenging problem you have had to solve?
8. Which environment is best to you to work ?
9. Tell about best decision in your life from childhood ? Decision that changed your life
10. On which topics you want improve? What are doing to impoving on that topics ? Did you try build project on that topics ?
Comments