Meta logo

Meta Frontend Engineer Interview Questions

39 practice questions for Meta Frontend Engineer interviews

Meta frontend engineer interviews emphasise JavaScript, DOM manipulation, CSS, accessibility, browser APIs, and UI component architecture.

All Roles Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer
coding Hard Verified Question #1

1. OA[CodeSignal] Cloud File Storage System


Category: Graph coding problem
# Question Your task is to implement a simple in-memory cloud storage system that maps objects (files) to their metadata (name, size, etc.). You...
Input: Graph (nodes and edges)
Output: Array
coding Hard Verified Question #2

2. OA[CodeSignal] Design Banking System


Category: Graph coding problem
# Question Design a banking system that supports account management, transactions, and various financial operations.
Input: Graph (nodes and edges)
Output: Computed result
coding Medium Verified Question #3

3. Friend Requests Sent


Category: Algorithm coding problem
# Question Given a list of ages representing users in a social network, calculate the total number of friend requests each user will send based on...
Input: List
Output: Computed result
coding Hard Verified Question #4

4. Minimum Prefix Subset


Category: Tree coding problem
# Question Given a list of strings, find the minimum subset of prefixes that can represent the entire input set. A string is "represented" if it...
Input: Array of strings
Output: Integer
coding Medium Verified Question #5

5. Shortest Substring with Alphabet


Category: Sliding window coding problem
*This is a popular twist Meta interviewers often put on the classic leetcode problem to find a minimum window substring.* Given an input string and...
Input: String
Output: Integer
coding Medium Verified Question #6

6. Shortest Substring with N Unique Characters


Category: String coding problem
# Shortest Substring with N Unique Characters *This is a variation of the leetcode problem* Given a string s and an integer n, find the length of...
Input: String
Output: Computed result
coding Hard Verified Question #7

7. OA[CodeSignal] In-Memory Database


Category: Graph coding problem
# Description Implement a simplified in-memory database that supports record manipulation with various operations. The system should handle basic...
Input: Graph (nodes and edges)
Output: Array
coding Easy Verified Question #8

8. [CodeSignal] Count Non-Dominant Elements


Category: Array coding problem
# Question Given an array of integers numbers, count all elements that are not equal to numbers[0] or numbers[1] (if those indices exist in the...
Input: Array of integers
Output: Computed result
coding Easy Verified Question #9

9. [CodeSignal] Sort Words By Vowel Consonant Difference


Category: Array coding problem
# Question You are given a string text consisting of unique lowercase English words separated by spaces. For each word, compute the absolute...
Input: Array
Output:** Computed result
coding Medium Verified Question #10

10. [CodeSignal] Warehouse Robot Commands


Category: Matrix coding problem
# Question In a highly automated warehouse, a robot organizes packages stored in a rectangular grid. The grid is represented as a 2D list of integers...
Input: Matrix (2D array)
Output: Computed result
coding Hard Verified Question #11

11. [CodeSignal] House Segments After Destruction


Category: Array coding problem
# Question You are monitoring the building density in a district of houses. The district is represented as a number line, where each house is located...
Input: Array of integers
Output: Array
coding Medium Verified Question #12

12. Distribution Center Placement


Category: Array coding problem
A logistics company is expanding its distribution network along a single highway. You are given an array of integers locations representing the...
Input: Array of integers
Output: Computed result
coding Hard Verified Question #13

13. Expression Simplifier


Category: String coding problem
Given an algebraic expression string containing single lowercase-letter variables, the operators + and -, and parentheses ( and ), simplify...
Input: String
Output: Computed result
coding Medium Verified Question #14

14. Minimum Sum Tree Path


Category: Binary tree coding problem
# Minimum Sum Tree Path
Input: Binary tree
Output: Computed result
technical Medium Verified Question #15

15. How to pass AI Enabled Coding Rounds From FAANG Interviewer


Category: Algorithm coding problem
# Tips For AI Coding Rounds AI coding rounds are not as different from regular coding rounds as you might think. The interviewer still needs to get...
Input: Given input
Output: Computed result
coding Hard graph #1

1. [OA] Depth First Search — Optimize friend suggestion algorithm for Meta's social network

In a social media platform, suggesting friends from mutual connections increases user engagement. This problem mimics exploring connections in a graph representation of users.
Problem statement: Given a list of user connections represented as edges, determine the number of mutual friends between two given users using Depth First Search (DFS).
- Method Signature: mutualFriends(connections: [number[], number[]], userA: number, userB: number): number
Example 1:
Input: connections = [[1, 2], [2, 3], [3, 4], [1, 4], [2, 4]], userA = 1, userB = 2
Output: 2
Explanation: Mutual friends for users 1 and 2 are [4].
Example 2:
Input: connections = [[1, 2], [2, 3], [3, 1]], userA = 1, userB = 3
Output: 1
Explanation: The mutual friend is 2.
Constraints:
- 1 <= connections.length <= 10^4
- 1 <= userA, userB <= 10^5
coding Medium sliding window #2

2. [OA] Sliding Window — Optimize News Feed loading for Meta's social platform

As users scroll through their news feeds, loading efficiency is crucial to enhance user experience. This problem simulates a situation in which you need to efficiently fetch a subset of posts based on the number of visible posts and the current scroll position.
Problem statement: Given an array of integers representing the post IDs and a k representing the number of posts to load, return an array containing the k most recent post IDs starting from the specified index.
- Method Signature: getRecentPosts(posts: number[], startIndex: number, k: number): number[]
Example 1:
Input: posts = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], startIndex = 2, k = 4
Output: [3, 4, 5, 6]
Explanation: Starting from index 2, the next 4 posts are from IDs 3 to 6.
Example 2:
Input: posts = [1, 2, 3, 4, 5], startIndex = 3, k = 2
Output: [4, 5]
Explanation: Starting from index 3, the next 2 posts are 4 and 5.
Constraints:
- 1 <= posts.length <= 10^5
- 0 <= startIndex < posts.length
- 1 <= k <= 10
system design Medium api design #3

3. [OA] Class Design — Create a centralized Notification System for Meta's messaging platform

Managing notifications across different platforms and ensuring a user-friendly interface is paramount for keeping users engaged. This design focuses on a central notification management system.
Problem statement: Implement a class NotificationSystem that supports sending notifications and retrieving them by user.
- Method Signatures:
- constructor() — initializes the notification system.
- sendNotification(userId: string, message: string): void — sends a notification to the specified user.
- getNotifications(userId: string): string[] — retrieves notifications for the specified user.
Example 1:
Input: system = new NotificationSystem(); system.sendNotification('user1', 'Welcome!');
Output: system.getNotifications('user1') => ['Welcome!']
Constraints:
- 1 <= userId.length <= 10^5
- 1 <= message.length <= 500
system design Medium api design #4

4. [OA] Class Design — Design a client-side Image Carousel for Meta's photo sharing application

Displaying images efficiently in a carousel format is essential for user engagement in photo-sharing apps. This design focuses on class structure that manages the image data, current state, and transition logic for the carousel.
Problem statement: Create a class ImageCarousel that manages images and transitions between them.
- Method Signatures:
- constructor(images: string[]) — initializes the carousel with the provided image URLs.
- next(): string — moves to the next image and returns the URL.
- prev(): string — moves to the previous image and returns the URL.
- getCurrentImage(): string — returns the URL of the current image.
Example 1:
Input: carousel = new ImageCarousel(['img1.jpg', 'img2.jpg', 'img3.jpg'])
Output: carousel.getCurrentImage() => 'img1.jpg'
Output: carousel.next() => 'img2.jpg'
Constraints:
- 1 <= images.length <= 100
- All strings in images are valid URLs.

Related Meta Frontend Engineer interview prep

Start practicing Meta questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free