Meta onsite US | Infra | E4 | Passed

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-03-11Added By Anonymous
Source: Link

Company: Meta
Role: E4
Interview Stage: Onsite
Location: US
Year: unknown

Original Post Content:

Screening

1.#347 Top K Frequent Elements [Medium|No variant]: Explained brute-force approach and complexity, explained heap approach and complexity. Interviewer was okay with the heap solution so I coded that. Minor follow-ups at the end like what if we want to return the freq as well etc.
2.#408 Valid Word Abbreviation [Easy|No variant]: Explained the linear solution and gave complexities. Coded, went through 3-4 test cases. No follow ups.

Onsite

Coding 1

1.#215 Kth Largest Element in an Array [Medium|No variant]: Gave the heap solution straight away and asked if they wanted something more efficient, they were okay with heap. Gave complexities, although I mentioned O(N) mistakenly instead of O(Nlogk) but the interviewer corrected me. Coded and went through a few test cases.
2.#1047 Remove All Adjacent Duplicates In String [Easy|Variant]: The variant was to remove all adjacent duplicates (candy crush) but interviewer gave me two options - "abbbaa" can either end in "" or "a" - both solutions acceptable. I explained the stack solution and gave complexities. But while coding, I fumbled at a few places and ended up writing atleast 4-5 if-else statements. The time was less but I managed to go through 3 test cases and convince the interviewer that the code was correct but can be made cleaner by removing some if statements.

Coding 2

1.#129 Sum Root to Leaf Numbers [Medium|No variant]: I asked some questions to understand the constraints, interviewer told me that the number will only be positive single digits (1-9). I explained him the DFS approach and complexity and started coding. I used a global variable to keep track of the final result and went through the test cases. At the end, he asked me to not use the variable and keep track of the result inside DFS. I coded that solution and went through another test case.
2.#227 Basic Calculator II [Medium|Variant]: Variant was to just use + and *. Explained him the solution that used last_number and current_num to keep track of the operand. It took me a lot of explaining as he was not able to understand, but because of the time constraint, I went ahead with the coding. I coded the solution just when 5 minutes were left in the interview and he asked me if there was anything I would change in the solution. I could not find anything wrong but then he mentioned that it could be done by just using one variable to store the number instead of two. I could only say "okay" at the instance.

System Design

Top-k service: I saw a few videos for this one and thought its too tough and might not be asked in the interview, and I did not prepare. In the interview, I went though the usual - functional req, non-functional req, core entities, APIs, high level design etc. He kept asking a lot of questions in between. Asked me about authentication of APIs, do back-of-the-envelop calculations and tell him how many servers might be needed, what will be the DB schema, which DB - sql or no-sql, how to expire count after 7 days etc.

At the end, I thought I did a really poor job as I was not able to focus on a lot of the other aspects of the design due to time constraints.

Behavioral

Skipped the tell me about yourself question

1.Favorite project - how did you measure the results/performance - what challenges you faced and how you handled them - in hindsight, what would you do differently
2.Time you made a mistake and what you learned from it
3.Time you faced pushback on your design
4.Time you got a tough feedback
5.Time when a project grew out of scope - how did you manage the stakeholders for extra time
6.Time when a project didn't produce expected outcomes - what would you have done differently

Preparation

Coding: Leetcode meta tagged questions, Coding with Minmer
System Design: Hello Interview
Behavioral: Youtube mostly

Comments