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.