Meta Onsite
Summary
I recently interviewed onsite at Meta for an unspecified role, going through four rounds covering data structures, algorithms, system design, and behavioral questions. I believe I performed well, coding and dry running all problems, and am now awaiting the results.
Full Experience
I had my onsite interview at Meta, which consisted of four challenging rounds.
- Round 1 focused on data structures and algorithms. I was asked to implement the left and right view of a binary tree, and then to merge three sorted arrays while also removing any duplicate elements.
- Round 2 was a behavioral round where I answered questions about my past experiences and how I handle various situations.
- Round 3 was a system design interview where I had to design a system for ad recommendations.
- Round 4 involved more coding, specifically implementing a basic calculator that handles only addition and multiplication, and then designing a data structure that supports insert, delete, update, and getRandom operations all in O(1) time.
I was able to code everything and dry-run several examples for each problem. I'm currently waiting for the final results.
Interview Questions (5)
Given a binary tree, I had to implement algorithms to find its left view and its right view. The left view includes the nodes seen when looking from the left side, and the right view includes nodes seen when looking from the right side, typically the first node at each level.
I was given three already sorted arrays and tasked with merging them into a single sorted array. An important constraint was to remove any duplicate elements in the final merged array.
I was asked to design a system that can provide relevant ad recommendations to users. This involved discussing various components like data collection, user profiling, ad selection algorithms, ranking, serving infrastructure, and considerations for scalability and latency.
I needed to implement a basic calculator that could evaluate an expression string involving non-negative integers, addition ('+'), and multiplication ('*') operators. The key was to correctly handle operator precedence (multiplication before addition).
The task was to design a data structure that supports four operations—inserting an element, deleting an element, updating an existing element, and retrieving a random element—all with an average time complexity of O(1).