Hi everyone, I just recently blew up my chances to join a FAANG company. I honestly have no idea what the expecation was from me but I really wanted to ask if anyones recognizes similar leetcodes
1.- Create a tree of employees where I keep count of how many subordinates each child has. basically
1
/ | \
2 3 4
/ \
5 6If I ask the amount of employees that 1 manages, it should be 6
2.- you are given an input such as:
Hello world this is "a good day to interview for my new company"
Create a function to parse it as if this were a UNIX command typed from the shell
For example, the above input should output:
[hello][world] [this] [is] [a good day to interview for my new company]
Note how everything that is within "" should be considered a single command.
This is a much detail as it was given originally. I guess part of the question was to come up with additional details such as: what if there is uneven number of " characters, how would I have to parse the command?
Part of the follow up question was to consider a "state machine". Have any of you guys seen anything similar in the past? What should I have read or solved in order to crack the question above?
3.- I have a binary tree and someone puts a malicious edge. Find a way to fix the binary tree
1
/ \
2 3
\
4 -> 5Follow up was to imagine you can have more than 2 children at a time, how would you fix it to become a binary tree again?