Meta (Facebook, Instagram and WhatsApp) interviews software engineers with fast-paced coding rounds, often two problems in 45 minutes, a system or product design round for experienced engineers, and a behavioural round. These Meta interview questions cover the coding patterns Meta asks most, design questions and behavioural questions, with model answers and code.
17 questions · Updated
Reading answers is not the same as saying them.Practise Meta questions out loud and get a score, what you missed and a model answer for each one.
Practise solving two medium problems in 45 minutes. Speed matters at Meta, so aim to recognise patterns quickly and code without long pauses.
Focus on arrays, strings, hash maps, trees, graphs and intervals, and practise the most frequently asked Meta problems from recent lists.
Code cleanly and explain while you code, then test with your own examples. Meta interviewers often do not run your code, so you must verify it yourself.
For experienced roles, practise system design (news feed, messaging) or product design (designing a feature end to end with APIs and data models).
Prepare behavioural stories on impact, conflict, feedback, ambiguity and moving fast, with clear numbers about the results.
Coding round (DSA)
Data structures and algorithms problems solved live, usually in 45 minutes each. Explain your approach before you code.
1. Can a string become a palindrome after deleting at most one character?
Answer flow · 3 steps
1
Use two pointers from both ends.
2
When characters differ, try skipping either the left or the right character and check whether the remaining substring is a palindrome.
3
Only one deletion is allowed, so this happens at most once, giving O(n) time and O(1) space.
def valid_palindrome(s):
def is_pal(i, j):
while i < j:
if s[i] != s[j]:
return False
i, j = i + 1, j - 1
return True
i, j = 0, len(s) - 1
while i < j:
if s[i] != s[j]:
return is_pal(i + 1, j) or is_pal(i, j - 1)
i, j = i + 1, j - 1
return True
2. Count the subarrays whose sum equals k.
Use prefix sums with a hash map counting how often each prefix sum has occurred. For each running sum, the number of subarrays ending here with sum k equals the count of earlier prefix sums equal to the running sum minus k. This handles negative numbers, unlike a sliding window, and runs in O(n) time.
def subarray_sum(nums, k):
count, running, seen = 0, 0, {0: 1}
for x in nums:
running += x
count += seen.get(running - k, 0)
seen[running] = seen.get(running, 0) + 1
return count
3. Remove the minimum number of parentheses to make a string valid.
Answer flow · 5 steps
1
Scan left to right with a stack of indices of unmatched "(".
2
For each ")", pop a matching "(" if there is one; otherwise mark the ")" for removal.
3
After the scan, any indices left in the stack are unmatched "(" and are also removed.
4
Build the result without the marked indices.
5
This is O(n) time.
def min_remove(s):
stack, remove = [], set()
for i, ch in enumerate(s):
if ch == "(":
stack.append(i)
elif ch == ")":
if stack:
stack.pop()
else:
remove.add(i)
remove.update(stack)
return "".join(ch for i, ch in enumerate(s) if i not in remove)
4. Return the values visible from the right side of a binary tree.
Answer flow · 4 steps
1
Do a level order traversal and take the last node of each level.
2
Alternatively, run a DFS visiting the right child first and record a node's value whenever you reach a new depth for the first time.
3
Both are O(n).
4
Meta often asks for the left side view or the vertical order traversal as a follow-up.
5. Find the k points closest to the origin.
Answer flow · 4 steps
1
Compute each point's squared distance (no need for square roots) and keep a max-heap of size k; when a closer point arrives, replace the farthest.
2
This is O(n log k).
3
Quickselect gives O(n) on average.
4
Mention that comparing squared distances avoids floating-point errors.
6. Return an array where each element is the product of all other elements, without division.
Answer flow · 5 steps
1
Make two passes.
2
In the first, store at each index the product of all elements to its left.
3
In the second, go from right to left with a running product of elements to the right and multiply it in.
4
This is O(n) time and O(1) extra space apart from the output.
5
Explain why division fails with zeros.
7. Find the lowest common ancestor of two nodes in a binary tree.
Answer flow · 5 steps
1
Recurse from the root: if the node is null or equals either target, return it.
2
Recurse into both children.
3
If both sides return a non-null node, the current node is the lowest common ancestor; otherwise return whichever side is non-null.
4
This is O(n) time.
5
For a binary search tree, you can use values to walk down without searching both sides.
8. Merge two sorted arrays in place, where the first has enough space at the end.
Answer flow · 4 steps
1
Fill from the back.
2
Use pointers at the last real element of each array and at the last position of the first array; place the larger of the two values at the back and move the pointers.
3
Copy any remaining elements from the second array.
4
Working backwards avoids overwriting values you still need, giving O(m + n) time and O(1) space.
System design and technical depth
Design questions and computer science fundamentals. Low-level design for freshers, high-level design for experienced engineers.
9. Design the Facebook news feed.
Answer flow · 4 steps
1
Two main approaches: fan-out on write, where a new post is pushed into each follower's feed cache (fast reads but expensive for users with millions of followers), and fan-out on read, where the feed is built when requested.
2
Use a hybrid: push for normal users and pull for celebrities.
3
Rank posts with a scoring service using signals such as relationship, recency and engagement.
4
Cache feeds, paginate with cursors, and store posts in a sharded database with media in a CDN.
10. Design a messaging service like WhatsApp.
Answer flow · 4 steps
1
Clients keep a persistent websocket connection to chat servers.
2
A message goes to the server, is stored, and is delivered to the recipient's connection if online, or queued and sent as a push notification if not.
3
Track sent, delivered and read states with acknowledgements.
4
Use message IDs for ordering and deduplication, a session service to know which server holds each user's connection, and end-to-end encryption, so the server only stores encrypted content.
11. Design the "like" counter for posts with very high traffic.
Answer flow · 4 steps
1
Writing every like directly to one row creates contention for viral posts.
2
Record each like as an event (user, post) so it can be undone and deduplicated, update counts asynchronously through a queue, and use sharded counters for hot posts, summing them when reading.
3
Cache the count and accept a short delay in the displayed number.
4
Store the user-post pair to stop a user liking twice.
12. Design the Instagram photo upload and viewing system.
Answer flow · 4 steps
1
Upload photos directly to object storage using pre-signed URLs, then trigger a pipeline that creates resized versions and stores metadata (owner, caption, location) in a database.
2
Serve images through a CDN.
3
The feed shows photos from followed users, using a feed system like the news feed.
4
Discuss storage estimates, image formats, and how to handle spikes such as festivals.
Behavioural round
Questions about your past work and how you behave in a team. Answer with real stories using the STAR method.
13. Tell me about your most impactful project.
Answer flow · 3 steps
1
Meta focuses on impact.
2
Choose a project where you can quantify results, explain your specific role and decisions, and the trade-offs.
3
For example: "I rewrote our app's image loading to use caching and lazy loading, which reduced load time by 45% and increased daily sessions by 12%." Be ready for deep follow-up questions on any decision.
14. Tell me about a time you had a conflict with a coworker.
Answer flow · 3 steps
1
Show maturity and resolution.
2
Describe the disagreement, how you understood their perspective, the conversation you had and the outcome, including what you learned.
3
Avoid stories where you simply proved the other person wrong.
15. Tell me about a time you moved fast and had to accept trade-offs.
Answer flow · 3 steps
1
For example: "We had two days to ship a fix for a bug affecting sign-ups.
2
I shipped a minimal fix behind a feature flag with monitoring, then wrote a proper solution the following week.
3
Sign-ups recovered the same day." Show you can balance speed with responsibility, and that you followed up on any shortcuts.
16. Tell me about feedback you received that changed how you work.
Answer flow · 4 steps
1
Choose real feedback and show the change.
2
For example: "My lead said I was too quiet in design reviews, so my good ideas were missed.
3
I started writing my thoughts in the design document beforehand and speaking first on at least one point per meeting.
4
Two of my suggestions were adopted the next quarter."
17. Tell me about a time you had to work with very little guidance.
Show initiative in ambiguity: how you clarified the goal, found information, made decisions and checked in with stakeholders. End with the outcome and what you would repeat.
Ready to test yourself?Pick your topics and level, answer by voice or text, and get instant feedback. Free.
Company names are trademarks of their respective owners. Interview Ready is an independent practice site and is not affiliated with or endorsed by any company listed here.