Meta Java Interview Questions 2026
Published July 22, 2026 · Updated July 22, 2026
5 real Java interview questions asked at Meta. Upvoted by engineers who cleared the loop. Covers Technical rounds.
5 questions
149 engineers asked
224 upvotes
Company: Meta
Technology: Java
All Java Questions Asked at Meta
Meta
Hard
Technical round
JavaPythonDistributed Systems
Given Meta's social graph, find all friend-of-friend recommendations for a user that are not already friends.
Discuss BFS at scale, how to prune the search space, and how to rank recommendations by mutual friend count efficiently.
↑ 54 upvotes · 54 engineers asked this · SDE2
Meta
Medium
Technical round
PythonJava
Given a social graph, find all users within K hops of a given user. Implement BFS with a visited set. Then discuss how you would scale this to Meta's 3 billion user graph using partitioning.
↑ 58 upvotes · 37 engineers asked this · SDE1
Meta
Medium
Technical round
PythonJavaJavaScript
Given an array of N integers, find the maximum product subarray. Explain why you need to track both the maximum and minimum product ending at each position, and handle zeros and negative numbers.
↑ 52 upvotes · 33 engineers asked this · SDE1
Meta
Hard
Technical round
5-9 yearsJavaDistributed Systems
Given a social graph, find the shortest chain of mutual connections between two users (like LinkedIn's "degrees of connection"), and explain how bidirectional BFS improves performance over a single-direction BFS at this scale.
↑ 39 upvotes · 14 engineers asked this · Staff Engineer
Meta
Hard
Technical round
3-6 yearsJava
What is a memory leak in Java despite having a garbage collector? Give a concrete example involving a static collection.
↑ 21 upvotes · 11 engineers asked this · Senior SDE
Practice these questions with AI feedback
Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.
Build my study plan →
More Meta Questions
Java Questions at Other Companies
Browse by company
Frequently asked questions
Given Meta's social graph, find all friend-of-friend recommendations for a user that are not already friends.
Given Meta's social graph, find all friend-of-friend recommendations for a user that are not already friends.
Discuss BFS at scale, how to prune the search space, and how to rank recommendations by mutual friend count efficiently.
Given a social graph, find all users within K hops of a given user. Implement BFS with a visited set. Then discuss how you would scale this to Meta's 3 billion user graph using partitioning.
Given a social graph, find all users within K hops of a given user. Implement BFS with a visited set. Then discuss how you would scale this to Meta's 3 billion user graph using partitioning.
Given an array of N integers, find the maximum product subarray. Explain why you need to track both the maximum and minimum product ending at each position, and handle zeros and negative numbers.
Given an array of N integers, find the maximum product subarray. Explain why you need to track both the maximum and minimum product ending at each position, and handle zeros and negative numbers.
Given a social graph, find the shortest chain of mutual connections between two users (like LinkedIn's "degrees of connection"), and explain how bidirectional BFS improves performance over a single-direction BFS at this scale.
Given a social graph, find the shortest chain of mutual connections between two users (like LinkedIn's "degrees of connection"), and explain how bidirectional BFS improves performance over a single-direction BFS at this scale.
What is a memory leak in Java despite having a garbage collector? Give a concrete example involving a static collection.
What is a memory leak in Java despite having a garbage collector? Give a concrete example involving a static collection.