脸熟NG店面挂经

The phone screen was a video call phone screen interview, spanning for 45 minutes.

First 5 minutes were introductory, about myself, what i currently do and all that.

第一题
https://leetcode.com/problems/merge-k-sorted-lists/ But with arrays, instead of linked lists.

I Spoke about the brute force approach, then discussed a solution using a heap. He agreed with the heap solution and I proceeded to code it out. While testing, discovered some bugs involving indexes and figured them out. Took a few minutes to debug and small hint from the interviewer to discover the bug. Interviewer was satisfied and I pointed out a separated edge case that we both hadn’t considered. I coded out a fix for that edge case ( just an if statement ).
Gave the right time and space complexities for the solution and he agreed.
In Total, Took about 20 minutes

第二题 https://leetcode.com/problems/longest-substring-without-repeating-characters/

I Spoke about the brute force approach, n^3 but we both knew that was too slow then we spoke about an n^2 solution using a hashtable and he asked me to code it out.
After coding it out, we had about 6 minutes left but I still brought up a potential sliding window solution with O(N) runtime. He asked me to discuss how I would implement this and i did this. He seemed satisfied and we ended the problem.

The last 6 minutes were just me asking questions about his work and facebook and why he works for FB.

45 minutes:

1st question is tax brackets, see Q1 of https://leetcode.com/discuss/interview-experience/272412/Facebook-Onsite-Interview-Experience

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
Big O for both questions

2nd question is task dependency

Given the following table

Task, Time, Dependencies
A, [B, C], 6
B, [], 1
C, [], 4
D, [E], 5
E, [], 1

Find the time it takes to execute a task

For A it will be the time it takes to execute A + B + C which is 6 + 1 + 4

Status: Rejected (I couldn’t believe it)

First question I was able to code out in 20 mins

Second question I suggested topological sort, interviewer let me implement it and verified it worked. At the very end he asked if there is a better and I asked is the task guaranteed to finish and he said yes so I suggested DFS. He agreed it’s the optimal solution and I asked if I can implement it on the spot and he said there is no time left.

Just learned that I got rejected. I thought I did pretty well.