Hi guys, Just like the title says - I recently had a Facebook onsite and it was quite easy and yet I got rejected (Not mad, I'm sure there are far better candidates than me) Anyways, I just wanted to retell my experience and someone might be able to point out, what I did wrong, despite of it being an easy interview. If nothing else, someone might be able to gain some insight for their upcoming onsite. Hope this helps. Phone Screen: 1. Asked me a question about an expression e.g.- (){}[]{{}}} expressed as a Tree, and how I would express it as a Sting. (I was stuck initially, but then I was able to solve it using recursion) 2. Follow up: Given the above expression as a flat DS e.g. - Array, how I would convert that into a tree. (Once I had solved 1. this was just very easy. You can use a stack/dequeue to solve this problem) Onsite: Coding1: P1: Given an array representing building heights, and an ocean to the right of the Array. Which buildings have view of the ocean. (This was easy. One pass from right and keep track of the highest building seen so far. Initially I solved it using O(n) space, using a boolean array to mark true/false for visibility. Then single pass from 0th index to return the indexes in ascending order. After the problem, I did mention that I could have used a Stack and reduced the O(N) space complexity) P2: Given a numeric expression e.g. - 123, return the list of all possible character combos {{abc}, {lc}, {aw}} (I had seen this problem before, and I solved it using recursion) (I was able to solve everything within 40 minutes. Chatted the remainder of the 5 mins. Very friendly) Coding2: P1: Given a LinkedList, return the sorted non-decreasing list. [Rules: Node class has no public constructor, can't use any other container D.S, performance doesn't matter and can pick any algorithm you see fit] (Interviewer asked me, if I had seen this problem before. I say yes. He says okay. lol. I solved it using recursion. It's a very easy problem. You go all the way to the n-1 Node of the list, and swap them if necessary. On return from the call stack, just iterate to the point where the current Node fits, and return the list) P2: Given an array of length N and an integer K, return the Kth largest value from the list. (I have seen this Heap problem too. Use PriorityQueue for this solution. He says, can you think of another solution. I say, yes, I think we can use a BST, and since we are looking for the Kth largest value, we keep going Right on the tree, once we can't anymore, we retract and go Left. But every time we retract from the previous call stack, keep subtracting 1 from the K, and then IF K==0 is the sentinel value. Whatever the current Node value was when K==0, should be the Kth largest value. I also add, I have never tried this solution.So this is just my hypothesis. Also I tell him this has NLogN runtime, vs NLogK runtime for the PriorityQueue. Anyways, he says, let's go with the PriorityQueue solution. Solved it under 40 minutes. Chit chat and so on) Behavioral: I honestly had prepared using the '22 most asked questions at Facebook' behavioral round. Most of the questions asked were variations of those 22 questions. (Personally, I feel I screwed up on this one. Although it must be said, the interviewer's Internet was atrocious. So much so, at one point we had to turn off our videos so that audio would stop buffering for the interviewer. I'm on the west coast, but not sure where the interview was at) System Design I had studied using Grokking System Interview and the system design book by Alex Wu. But then again, I think someone on LC discussion mentioned (a week before my interview) that they were asked to design FB Live Comment. So I went though the design and got a basic understanding. And yes, I was asked to build FB Live Comments lol (Just text, no emojis, gifs, etc.) Just so you know, I didn't just parrot everything I read about a similar solution on the internet. So I just gave a solution using WebSocket. I have had built chat applications using WebRTC before, so this wasn't very difficult. (Interviewer was very friendly and really chill dude. I was done under 50 minutes. Remainder of the buffer time ... we just chatted about our hobbies) Final Thoughts: It was one of the best interview loops I have been through. But please stop using ExcaliDraw for System Design interviews lol. Honestly, I thought this went very well and was expecting a positive outcome. To be honest, the questions were more on the easy-to-medium side of things. Had it been LC hard, I don't think I could have solved them. 3 days later my recruiter emailed me saying, they have decided to not go forward my candidacy. I felt a bit sad but it's alright. Happens. I pressured for feedback, but she said - let's reconnect in a year and then we can go over it. I left it at that. So, if they come back with a rejection that fast, does that mean - it didn't even make it to HC ? I'm just curious. I'm sure I'm doing something wrong, and I just don't want to repeat it on my next interviews, wherever that might be. With that being said, can someone provide referrals to other FAANG or similar companies ? That would be much appreciated! YOE: 6+ #tech #facebook #google #microsoft #apple #paypal #faang #amazon
Kth largest - O(n) pivot , system design - did you discuss trade offs
Discussed trade offs on the system design. With the Kth largest problem, no. It was more like - alright, let's just code the PriorityQueue solution ... and I was like, Okay. Sorry, I suppose I should have followed up on that.
Quickselect has a worst case of n^2 but is a good option that should have been proposed.
I had the same experience with Apple onsite back in 2019. I solved all the questions with 15 mins to spare each round. Questions also were easy and medium level like valid parentheses, LRU etc. Interviewers were cool with my solutions. Got rejected next day and didn't receive any feedbacks. I was sad but gotta move on with amazon. I have had onsite with Google Apple Amazon and I think Apple was easiest.
Some of your interviews sound solid, some are questionable or I'm confused about. Phone screen - I'm not really sure what kind of tree structure you're talking about so can't comment. But you passed this round so probably doesn't matter. Coding 1: P1 is pretty good, except you can't get the space below O(n), even with what you describe. And there's no need to specify a stack when you just need a list. P2 it is not clear in your problem spec how the numeric expression is used. Coding 2: P1 this is a fun problem, I've never heard it before. It's unclear why you used recursion, you basically implemented insertion sort just recursively. The recursion doesn't really simplify much if anything in the implementation, and is definitely not core to the implementation. But sure, would work. You might have got dinged for this. Perhaps also if you didn't realize this was just a recursive implementation of insertion sort, depends on if your interviewer cares. (Bubble sort is the easiest solution here imo.) P2 your first solution is great. Surprised your interviewer asked for a different one, not sure what they were hoping for. Not sure if your second solution would work or not. Maybe your interviewer was also unsure/confused. One solution to this is basically like quicksort, partition your values based on a pivot and throw out one partition or another - which might be basically your tree solution. Of course the obvious (inefficient) answer is sort the values and return the kth element. Maybe you had more bugs in your solutions than you realized. Maybe your behavioral really didn't go so great. Maybe your system design interview didn't go so great. Idk. Gl in the future. Your leetcode seems moderately solid, though maybe some of those "inaccuracies" / "imperfections" are holding you back. Hard to say, could have been your other interviews.
Thank you for taking the time to respond. Yeah, I have an inkling that I bombed my behavioral round. Coding 1, P2 is the problem Decode Ways under LC. Yeah, I have been thinking that my code might have had more bugs than I realized. I was rushed to finish it so I have enough time for the 2nd problem and that might have lead me to write some erroneous code. I suppose that's what they are looking for - finesse under duress. I will probably do some mock interviews, in the future, just so I can keep my composure during these interviews.
Decode Ways is a DP problem so it shouldn’t be solved with recursion. BSTs can’t have duplicate elements so your solution for that one might not work depending on how you dealt with duplicates. Ideally you’d talk about the trade offs of the heap solution vs quick-select, pointing out the potential O(n^2) complexity of quick-select in the worst case. In the sorting question, recursion is probably not right. If the interviewer didn’t allow you to use a separate container, they probably wanted an O(1) space solution so you needed to do it iteratively.
When was your interview and in how many days did you get feedback?
3 days
Sorry to hear. Did you go through test cases?
yup, I did. Maybe I didn't communicate it well enough ? We'll never know.
FB’s hiring bar is not at interviewing, but sustainability
Not sure I understand. Can you elaborate ?
It’s comparably easier to pass Fb’s interview, but harder to sustain with constant high expectation in working cycles. Fb’s hire policy is to hire fast, and fire fast the ones who don’t fit. My 2 cents
Could be your code quality was bad or hard to read? Could be your system design had obvious flaws that aren’t obvious to you? Could just be bad luck and one interview didn’t like you and was biased. If you got an answer so fast likely means you got either 1. One strong no, no strong yes 2. Multiple leaning no
No, I think the code quality was pretty decent. I had seen the System Design question before, so I knew all the pitfalls, what clarifying questions to ask and how to drive the design conversation. So I had the roadmap, somewhat. But maybe that wasn't enough ? So there is that shimmer of possibility. Not going to deny that. Could be bad luck and maybe one interviewer indeed didn't like me. Although I didn't sense it in their demeanor. But who knows ? I keep thinking I botched my behavioral round, add to that the crappy internet the interviewer had... who knows how much of I said the interviewer could hear. I suppose going forward, I will just have to do more mock interviews to get better at it. I think, even when you have all the right answers - interviewing is still a skill. Some candidates come off as more amiable than others. I could be wrong.
OP, where is the "22 most asked questions at Facebook" material?
Look it up on YouTube or even google it. Look for the content creator named Dan Croitor.
Thx
Yes , once I had asked 1 easy questions on onsite. For design they gave me pastbin. Behavior round was smooth too. I got offer the next day . . . And then I woke up.
Imagine this, had you not woken up ... you'd still be working there ;)
What level were you interviewing for? Just so we get an idea of the relative importance of each round. System design matters less for E4 compared to E5, for instance.
The fb recruitment dashboard didn't mention anything, and on my first call with the recruiter, she said mid-level. I actually never specifically asked E4/E5. Sorry. It was for the Infrastructure Team in Seattle.
Gotcha. Mid-level means E4. With the coding rounds, how well did you communicate your solution before jumping into the implementation? Did you get the time and space complexities spot on for any solution you described (regardless of whether it was the one you ended up implementing)? Did you test the code with examples by yourself before declaring that you were done? While doing so, did you call out all the edge cases that you could think of to ensure you had accounted for them? Just thinking out loud here.