Facebook/Meta | SWE Intern
Anonymous User
2544

Screening round

Q1: Given a string of parenthesis, find the minimum number of parenthesis required to balance the string. Provided a stack based approach, the interviewer further asked if the space complexity could be improved i.e. if it can be done without using stack

Q2: Given a dictionary (list of words) along with a start and end word, find a path from the start to the end word using the dictionary words such that the adjacent words differ by only 1 character. Provided a BFS approach, was further asked to explain any differenced if DFS was used.

Onsite-round

Q1: Find if array a can be escaped i.e., if the array bounds can be exceeded by jumping from a position => a[i] = no. of jumps possible from position i
Initially provided brute force approach, can be done using DP. Provided an O(n^2) time complexity solution

Ex: [3,0,2,1,5,0,2,4,0,0], output=true

Q2: Given meeting schedules of n people, find the common free time for all the n people. Used idea similar to https://leetcode.com/problems/interval-list-intersections/

I would like to thank the leetcode community from which I have learnt a lot. Hope this helps others who are preparing!

Comments (2)