Upload Button Icon Add office photos

Facebook

Compare button icon Compare button icon Compare

Filter interviews by

Facebook Software Developer Interview Questions and Answers

Updated 30 Oct 2024

25 Interview questions

🔥 Asked by recruiter 2 times
A Software Developer was asked
Q. How does Facebook store likes and dislikes?
Ans. 

Facebook stores likes/dislikes using a combination of databases and caching systems.

  • Likes/dislikes are stored in a distributed database system like Cassandra or HBase.

  • Each like/dislike is associated with a user and the content being liked/disliked.

  • The database is sharded to handle the large volume of likes/dislikes.

  • Caching systems like Memcached or Redis are used to improve read performance.

  • Likes/dislikes can be s...

🔥 Asked by recruiter 3 times
A Software Developer was asked
Q. How does Facebook implement graph search?
Ans. 

Facebook implements graph search by indexing user connections and content to enable efficient search queries.

  • Facebook indexes user connections and content to build a graph database.

  • The graph database is used to store and retrieve information about users, their relationships, and their content.

  • Graph search queries are executed by traversing the graph database to find relevant connections and content.

  • Facebook uses v...

Software Developer Interview Questions Asked at Other Companies

asked in Amazon
Q1. Maximum Subarray Sum Problem Statement Given an array of integers ... read more
asked in Rakuten
Q2. Merge Two Sorted Arrays Problem Statement Given two sorted intege ... read more
asked in Amazon
Q3. Minimum Number of Platforms Needed Problem Statement You are give ... read more
asked in Cognizant
Q4. Nth Fibonacci Number Problem Statement Calculate the Nth term in ... read more
asked in PhonePe
Q5. Form a Triangle Problem Statement You are given an array of integ ... read more
🔥 Asked by recruiter 3 times
A Software Developer was asked
Q. How does Facebook Chat work?
Ans. 

Facebook Chat is a real-time messaging system that allows users to send and receive instant messages.

  • Facebook Chat uses a client-server architecture.

  • It utilizes long polling or WebSockets for real-time communication.

  • Messages are stored in a message queue for delivery.

  • Chat messages are encrypted for security.

  • Facebook Chat supports features like read receipts, typing indicators, and group chats.

A Software Developer was asked
Q. 

Combination Sum Problem Statement

Given an array of distinct positive integers ARR and a non-negative integer 'B', find all unique combinations in the array where the sum is equal to 'B'. Numbers can be ch...

Ans. 

The task is to find all unique combinations in an array whose sum is equal to a given target sum.

  • Use backtracking to generate all possible combinations

  • Sort the array in non-decreasing order to ensure elements in each combination are in non-decreasing order

  • Start with an empty combination and iterate through the array, adding each element to the combination and recursively calling the function with the remaining sum

  • ...

A Software Developer was asked
Q. Can you explain the concept of demand paging?
Ans. 

Demand paging is a memory management technique where pages are loaded into memory only when needed.

  • Demand paging allows for efficient memory utilization by loading pages into memory on demand.

  • It reduces the amount of initial memory required to start a process.

  • When a page is needed but not in memory, a page fault occurs and the required page is loaded from disk.

  • Demand paging allows for larger virtual memory space t...

A Software Developer was asked
Q. 

K - Sum Path In A Binary Tree

Given a binary tree where each node contains an integer value, and a value 'K', your task is to find all the paths in the binary tree such that the sum of the node values in e...

Ans. 

The task is to print every path of a binary tree with the sum of nodes in the path as 'K'.

  • Traverse the binary tree and keep track of the current path and its sum

  • At each node, check if the sum of the current path equals 'K'

  • If yes, add the current path to the result

  • Continue traversing the left and right subtrees recursively

  • Remove the current node from the path before backtracking

A Software Developer was asked
Q. 

Merging Accounts Problem

Given a list ACCOUNTS where each element consists of a list of strings, with the first element being the name of the account holder, and the subsequent elements being the email add...

Ans. 

The task is to merge accounts belonging to the same person based on common emails and return the merged accounts.

  • Iterate through each account and create a mapping of emails to account holders

  • Iterate through the mapping and merge accounts with common emails

  • Sort the merged accounts and return the result

Are these interview questions helpful?
A Software Developer was asked
Q. 

Binary Tree Construction from Preorder and Inorder Traversal

The goal is to construct a binary tree from given preorder and inorder traversal lists of the tree nodes.

Example:

Input:
preorder = [1, 2, 4...
Ans. 

The task is to construct a binary tree using the given inorder and preorder traversals.

  • Use the preorder traversal to determine the root of the binary tree

  • Use the inorder traversal to determine the left and right subtrees of the root

  • Recursively construct the left and right subtrees

  • Return the root node of the constructed binary tree

A Software Developer was asked
Q. 

Saving Money Problem Statement

Ninja is adventurous and loves traveling while being mindful of his expenses. Given a set of 'N' stations connected by 'M' trains, each train starting from station 'A' and re...

Ans. 

The task is to find the cheapest price from the given source to destination with up to K stops.

  • Read the number of test cases

  • For each test case, read the number of stations and trains

  • Read the details of each train (source, destination, ticket price)

  • Read the source station, destination station, and maximum number of stops

  • Implement a graph data structure to represent the stations and trains

  • Use a modified version of D...

A Software Developer was asked
Q. 

Longest Increasing Path in a 2D Matrix Problem Statement

Given a matrix of non-negative integers of size 'N x M', where 'N' and 'M' denote the number of rows and columns respectively, find the length of th...

Ans. 

The task is to find the length of the longest increasing path in a 2D matrix, where you can move in four directions: left, right, up, or down from each cell.

  • Traverse the matrix and for each cell, find the longest increasing path starting from that cell

  • Use dynamic programming to store the length of the longest increasing path for each cell

  • Recursively explore all four directions from each cell, checking if the next ...

Facebook Software Developer Interview Experiences

5 interviews found

Interview experience
5
Excellent
Difficulty level
Moderate
Process Duration
2-4 weeks
Result
No response

I applied via LinkedIn and was interviewed in Jul 2024. There was 1 interview round.

Round 1 - HR 

(2 Questions)

  • Q1. Why you want to join facebook?
  • Ans. 

    I want to join Facebook because of its innovative technology, global impact, and opportunities for growth.

    • Innovative technology: Facebook is known for its cutting-edge technology and constant innovation.

    • Global impact: Working at Facebook would allow me to contribute to a platform that connects billions of people worldwide.

    • Opportunities for growth: Facebook offers a dynamic and fast-paced work environment with ample opp...

  • Answered by AI
  • Q2. Whats the best feature you like in Facebook?
  • Ans. 

    I appreciate the personalized news feed feature on Facebook.

    • Personalized news feed shows content based on user interests

    • Helps users stay updated on relevant information

    • Allows users to engage with content they are interested in

  • Answered by AI
Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Coding Test 

DSA round was there it was good

I appeared for an interview in Jul 2021.

Round 1 - Coding Test 

(2 Questions)

Round duration - 90 minutes
Round difficulty - Hard

This was an online coding round where we had 2 questions to solve under 90 minutes . Both the questions were preety hard according to me . One has to have a fair share of knowledge in Data Structures and Algorithms to pass this round .

  • Q1. 

    Longest Increasing Path in a 2D Matrix Problem Statement

    Given a matrix of non-negative integers of size 'N x M', where 'N' and 'M' denote the number of rows and columns respectively, find the length of t...

  • Ans. 

    The task is to find the length of the longest increasing path in a 2D matrix, where you can move in four directions: left, right, up, or down from each cell.

    • Traverse the matrix and for each cell, find the longest increasing path starting from that cell

    • Use dynamic programming to store the length of the longest increasing path for each cell

    • Recursively explore all four directions from each cell, checking if the next cell ...

  • Answered by AI
  • Q2. 

    Saving Money Problem Statement

    Ninja is adventurous and loves traveling while being mindful of his expenses. Given a set of 'N' stations connected by 'M' trains, each train starting from station 'A' and r...

  • Ans. 

    The task is to find the cheapest price from the given source to destination with up to K stops.

    • Read the number of test cases

    • For each test case, read the number of stations and trains

    • Read the details of each train (source, destination, ticket price)

    • Read the source station, destination station, and maximum number of stops

    • Implement a graph data structure to represent the stations and trains

    • Use a modified version of Dijkst...

  • Answered by AI
Round 2 - Video Call 

(2 Questions)

Round duration - 60 Minutes
Round difficulty - Medium

This Round was DS and Algo round and it started with formal introduction, followed by 2 problems. We first dicussed the
approach the time complexity and proper code covering all cases.

  • Q1. 

    K - Sum Path In A Binary Tree

    Given a binary tree where each node contains an integer value, and a value 'K', your task is to find all the paths in the binary tree such that the sum of the node values in ...

  • Ans. 

    The task is to print every path of a binary tree with the sum of nodes in the path as 'K'.

    • Traverse the binary tree and keep track of the current path and its sum

    • At each node, check if the sum of the current path equals 'K'

    • If yes, add the current path to the result

    • Continue traversing the left and right subtrees recursively

    • Remove the current node from the path before backtracking

  • Answered by AI
  • Q2. 

    Combination Sum Problem Statement

    Given an array of distinct positive integers ARR and a non-negative integer 'B', find all unique combinations in the array where the sum is equal to 'B'. Numbers can be c...

  • Ans. 

    The task is to find all unique combinations in an array whose sum is equal to a given target sum.

    • Use backtracking to generate all possible combinations

    • Sort the array in non-decreasing order to ensure elements in each combination are in non-decreasing order

    • Start with an empty combination and iterate through the array, adding each element to the combination and recursively calling the function with the remaining sum

    • If th...

  • Answered by AI
Round 3 - Video Call 

(3 Questions)

Round duration - 50 Minutes
Round difficulty - Medium

This Round was DS/Algo + Core round and it started with formal introduction, followed by 3 problems. We first dicussed
the approach the time complexity and proper code covering all cases for the 2 coding problems . The last question was
related to OS and was a bit theoretical .

  • Q1. 

    Merging Accounts Problem

    Given a list ACCOUNTS where each element consists of a list of strings, with the first element being the name of the account holder, and the subsequent elements being the email ad...

  • Ans. 

    The task is to merge accounts belonging to the same person based on common emails and return the merged accounts.

    • Iterate through each account and create a mapping of emails to account holders

    • Iterate through the mapping and merge accounts with common emails

    • Sort the merged accounts and return the result

  • Answered by AI
  • Q2. 

    Binary Tree Construction from Preorder and Inorder Traversal

    The goal is to construct a binary tree from given preorder and inorder traversal lists of the tree nodes.

    Example:

    Input:
    preorder = [1, 2, ...
  • Ans. 

    The task is to construct a binary tree using the given inorder and preorder traversals.

    • Use the preorder traversal to determine the root of the binary tree

    • Use the inorder traversal to determine the left and right subtrees of the root

    • Recursively construct the left and right subtrees

    • Return the root node of the constructed binary tree

  • Answered by AI
  • Q3. Can you explain the concept of demand paging?
  • Ans. 

    Demand paging is a memory management technique where pages are loaded into memory only when needed.

    • Demand paging allows for efficient memory utilization by loading pages into memory on demand.

    • It reduces the amount of initial memory required to start a process.

    • When a page is needed but not in memory, a page fault occurs and the required page is loaded from disk.

    • Demand paging allows for larger virtual memory space than p...

  • Answered by AI
Round 4 - Video Call 

(3 Questions)

Round duration - 60 minutes
Round difficulty - Medium

This was a preety intense round as I was grilled more on my System Design concepts but eventually I was able to
asnwers all the questions with some help from the interviewer.

General Tip : While preparing for Facebook Interviews , make sure you read and understand some of the most important features that Facebook incorporates like Graph Search , Adding a friend , Removing a friend , Storing Likes/Dislikes and so on. 
All these features are important to learn because at their core they are nothing but Data Structures used and implemented very elegantly . So before your next Facebook interview , do read these topics and be confident about your LLD as well as HLD skills.

  • Q1. How does Facebook store likes and dislikes?
  • Ans. 

    Facebook stores likes/dislikes using a combination of databases and caching systems.

    • Likes/dislikes are stored in a distributed database system like Cassandra or HBase.

    • Each like/dislike is associated with a user and the content being liked/disliked.

    • The database is sharded to handle the large volume of likes/dislikes.

    • Caching systems like Memcached or Redis are used to improve read performance.

    • Likes/dislikes can be stored...

  • Answered by AI
  • Q2. How does Facebook implement graph search?
  • Ans. 

    Facebook implements graph search by indexing user connections and content to enable efficient search queries.

    • Facebook indexes user connections and content to build a graph database.

    • The graph database is used to store and retrieve information about users, their relationships, and their content.

    • Graph search queries are executed by traversing the graph database to find relevant connections and content.

    • Facebook uses variou...

  • Answered by AI
  • Q3. How does Facebook Chat work?
  • Ans. 

    Facebook Chat is a real-time messaging system that allows users to send and receive instant messages.

    • Facebook Chat uses a client-server architecture.

    • It utilizes long polling or WebSockets for real-time communication.

    • Messages are stored in a message queue for delivery.

    • Chat messages are encrypted for security.

    • Facebook Chat supports features like read receipts, typing indicators, and group chats.

  • Answered by AI

Interview Preparation Tips

Eligibility criteriaAbove 7 CGPAFacebook interview preparation:Topics to prepare for the interview - Data Structures, Algorithms, System Design, Aptitude, OOPSTime required to prepare for the interview - 4 MonthsInterview preparation tips for other job seekers

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application resume tips for other job seekers

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Final outcome of the interviewSelected

Skills evaluated in this interview

I appeared for an interview before Dec 2020.

Round 1 - Coding Test 

(2 Questions)

Round duration - 90 minutes
Round difficulty - Hard

This was an online coding round where we were supposed to solve 2 questions under 90 minutes . Both the questions in my set were related to Graphs and were quite tricky and heavy to implement.

  • Q1. 

    Path Counting in Directed Graph

    Given a directed graph with a specified number of vertices V and edges E, your task is to calculate the total number of distinct paths from a given source node S to all ot...

  • Ans. 

    Calculate the total number of distinct paths from a given source node to all other nodes in a directed graph.

    • Use dynamic programming to keep track of the number of paths from the source node to each node in the graph.

    • Consider using modular arithmetic to handle large numbers and prevent overflow.

    • Start by initializing the number of paths from the source node to itself as 1.

    • Iterate through the edges of the graph and updat...

  • Answered by AI
  • Q2. 

    Course Schedule II Problem Statement

    You are provided with a number of courses 'N', some of which have prerequisites. There is a matrix named 'PREREQUISITES' of size 'M' x 2. This matrix indicates that fo...

  • Ans. 

    Given courses with prerequisites, determine a valid order to complete all courses.

    • Use topological sorting to find a valid order of courses.

    • Create a graph with courses as nodes and prerequisites as edges.

    • Start with courses that have no prerequisites and remove them from the graph.

    • Continue this process until all courses are taken or there are no valid courses left.

    • If there is a cycle in the graph, it is impossible to com...

  • Answered by AI
Round 2 - Face to Face 

(2 Questions)

Round duration - 60 Minutes
Round difficulty - Medium

This was a Data Structures and Algorithms round with some standard questions . I was expected to come up with an
efficient approach and code it as well .

  • Q1. 

    Merge Intervals Problem Statement

    You are provided with 'N' intervals, each containing two integers denoting the start time and end time of the interval.

    Your task is to merge all overlapping intervals a...

  • Ans. 

    Merge overlapping intervals and return sorted list of merged intervals.

    • Sort the intervals based on start times.

    • Iterate through intervals and merge overlapping intervals.

    • Return the merged intervals in sorted order.

  • Answered by AI
  • Q2. 

    Longest Route Problem Statement

    Given a 2-dimensional binary matrix called Mat of size N x M that consists solely of 0s and 1s, find the length of the longest path from a specified source cell to a destina...

  • Ans. 

    Find the length of the longest path from a source cell to a destination cell in a binary matrix.

    • Use depth-first search (DFS) to explore all possible paths from source to destination.

    • Keep track of visited cells to avoid revisiting them.

    • Return the length of the longest path found, or -1 if no path exists.

  • Answered by AI
Round 3 - Face to Face 

(2 Questions)

Round duration - 50 Minutes
Round difficulty - Medium

This was also a DSA round where I was asked to code only one of the questions but I eventually ended up coding both
as I had some spare time and explained my approches very smoothly to the interviewer . This round went preety well .

  • Q1. 

    Longest Increasing Subsequence Problem Statement

    Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This...

  • Ans. 

    Find the length of the longest strictly increasing subsequence in an array of integers.

    • Use dynamic programming to solve this problem efficiently.

    • Initialize an array to store the length of the longest increasing subsequence ending at each index.

    • Iterate through the array and update the length of the longest increasing subsequence for each element.

    • Return the maximum value in the array as the result.

  • Answered by AI
  • Q2. 

    Search In Rotated Sorted Array Problem Statement

    Given a rotated sorted array ARR of size 'N' and an integer 'K', determine the index at which 'K' is present in the array.

    Note:
    1. If 'K' is not present...
  • Ans. 

    Given a rotated sorted array, find the index of a given integer 'K'.

    • Use binary search to find the pivot point where the array is rotated.

    • Then perform binary search on the appropriate half of the array to find 'K'.

    • Handle cases where 'K' is not present in the array by returning -1.

  • Answered by AI
Round 4 - Face to Face 

(2 Questions)

Round duration - 50 Minutes
Round difficulty - Medium

This was also a DSA round with 2 questions of Medium to Hard difficulty . I was expected to follow some clean code and OOPS principles to write the code in this round .

  • Q1. 

    Rank from Stream Problem Statement

    Given an array of integers ARR and an integer K, determine the rank of the element ARR[K].

    Explanation:

    The rank of any element in ARR is defined as the number of elem...

  • Ans. 

    Given an array and an index, find the number of elements smaller than the element at that index appearing before it in the array.

    • Iterate through the array up to index K and count the number of elements smaller than ARR[K].

    • Return the count as the rank of ARR[K].

    • Handle edge cases like empty array or invalid index K.

  • Answered by AI
  • Q2. 

    LRU Cache Design Question

    Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:

    1. get(key) - Return the value of the key if it exists in the cache; otherw...

  • Ans. 

    Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.

    • Implement a doubly linked list to maintain the order of recently used keys.

    • Use a hashmap to store key-value pairs for quick access.

    • Update the order of keys in the linked list on get and put operations.

    • Evict the least recently used key when the cache reaches its capacity.

  • Answered by AI

Interview Preparation Tips

Eligibility criteriaAbove 7 CGPAFacebook interview preparation:Topics to prepare for the interview - Data Structures, Algorithms, System Design, Aptitude, OOPSTime required to prepare for the interview - 4 MonthsInterview preparation tips for other job seekers

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application resume tips for other job seekers

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Final outcome of the interviewSelected

Skills evaluated in this interview

I appeared for an interview before Dec 2020.

Round 1 - Face to Face 

(2 Questions)

Round duration - 60 Minutes
Round difficulty - Medium

This was a Data Structures and Algorithms round with preety good questions . I was expected to come up with an efficient approach and code it as well .

  • Q1. 

    K Closest Points to Origin Problem Statement

    Your house is located at the origin (0,0) of a 2-D plane. There are N neighbors living at different points on the plane. Your goal is to visit exactly K neighb...

  • Ans. 

    Find the K closest points to the origin in a 2-D plane using Euclidean Distance.

    • Calculate the Euclidean Distance of each point from the origin

    • Sort the points based on their distances

    • Return the first K points as the closest neighbors

  • Answered by AI
  • Q2. 

    Power Set Generation

    Given a sorted array of 'N' integers, your task is to generate the power set for this array. Each subset of this power set should be individually sorted.

    A power set of a set 'ARR' i...

  • Ans. 

    Generate the power set of a sorted array of integers with individually sorted subsets.

    • Use recursion to generate all possible subsets by including or excluding each element in the array.

    • Sort each subset before adding it to the power set.

    • Handle base cases for empty array and single element array.

    • Ensure the subsets are unique by using a set data structure.

    • Time complexity can be exponential due to the nature of generating ...

  • Answered by AI
Round 2 - Face to Face 

(2 Questions)

Round duration - 50 Minutes
Round difficulty - Hard

This was also a DSA round where I was asked to code only one of the questions but I eventually ended up coding both as I had some spare time and explained my approches very smoothly to the interviewer . This round went preety well .

  • Q1. 

    Roman Numeral to Integer Conversion

    Convert a string representing a Roman numeral into its integer equivalent and return the result.

    Explanation:

    Roman numerals are represented by seven different symbol...

  • Ans. 

    Convert a Roman numeral string to its integer equivalent.

    • Create a mapping of Roman numeral symbols to their integer values.

    • Iterate through the input string and add the corresponding integer values.

    • Handle cases where subtraction is needed (e.g., IV = 4, IX = 9).

  • Answered by AI
  • Q2. 

    Pair Sum Problem Statement

    You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.

    Note:
    ...
  • Ans. 

    Find pairs of elements in an array that sum up to a given value, sorted in a specific order.

    • Iterate through the array and for each element, check if the complement (S - current element) exists in a hash set.

    • If the complement exists, add the pair to the result list.

    • Sort the result list based on the criteria mentioned in the question.

    • Return the sorted list of pairs.

  • Answered by AI
Round 3 - Face to Face 

(2 Questions)

Round duration - 50 Minutes
Round difficulty - Medium

This was also a DSA round with 2 questions . One was implementation heavy and the other was related to recursion and so I handled it carefully so that my code does not run into TLE or Segmentation Fault.

  • Q1. 

    Arithmetic Expression Evaluation Problem Statement

    You are provided with a string expression consisting of characters '+', '-', '*', '/', '(', ')' and digits '0' to '9', representing an arithmetic express...

  • Ans. 

    Evaluate arithmetic expressions in infix notation with given operators and precedence rules.

    • Parse the infix expression to postfix using a stack.

    • Evaluate the postfix expression using a stack.

    • Handle operator precedence and parentheses while evaluating.

    • Ensure no division by zero cases and operands fit in 32-bit integer.

  • Answered by AI
  • Q2. 

    Remove Duplicates from Sorted Array Problem Statement

    You are given a sorted integer array ARR of size N. Your task is to remove the duplicates in such a way that each element appears only once. The outpu...

  • Ans. 

    Remove duplicates from a sorted array in-place with O(1) extra memory.

    • Use two pointers - one for iterating through the array and another for placing unique elements.

    • Compare current element with next element to identify duplicates and skip them.

    • Update array in-place by moving unique elements to the front.

    • Return the length of the array after removal of duplicates.

  • Answered by AI
Round 4 - Face to Face 

(2 Questions)

Round duration - 50 Minutes
Round difficulty - Medium

This was a typical System Design round where I was asked about the various features of Facebook and what sort of data structures and algorithms are used in implementing them .

  • Q1. How does Facebook store likes and dislikes?
  • Ans. 

    Facebook stores likes and dislikes using a combination of databases and algorithms.

    • Likes and dislikes are stored in databases such as MySQL or Cassandra.

    • Algorithms are used to analyze user behavior and recommend content based on likes and dislikes.

    • User interactions with posts, pages, and ads are tracked to determine likes and dislikes.

    • Likes and dislikes may also be used to personalize the user's feed and target ads mor...

  • Answered by AI
  • Q2. How does Facebook implement graph search?
  • Ans. 

    Facebook implements graph search using a graph database to efficiently search for connections between users and their interests.

    • Facebook uses a graph database to store connections between users, pages, groups, etc.

    • The graph search algorithm traverses the graph to find relevant connections based on user queries.

    • It takes into account factors like user relationships, interests, and interactions to provide personalized sea...

  • Answered by AI
Round 5 - Face to Face 

(2 Questions)

Round duration - 50 Minutes
Round difficulty - Medium

This was a preety intense round as I was grilled more on my System Design concepts but eventually I was able to asnwers all the questions with some help from the interviewer.

  • Q1. What is Hadoop and why is it used?
  • Ans. 

    Hadoop is a framework for distributed storage and processing of large data sets.

    • Hadoop is used for storing and processing big data across a distributed network of computers.

    • It is based on the MapReduce programming model, which allows for parallel processing of data.

    • Hadoop consists of HDFS for storage and YARN for resource management.

    • It is used for tasks like data warehousing, log processing, recommendation systems, and...

  • Answered by AI
  • Q2. How does Facebook Chat work?
  • Ans. 

    Facebook Chat works by using a combination of websockets, long polling, and push technology to deliver real-time messaging.

    • Facebook Chat uses websockets for real-time communication between the client and server.

    • Long polling is used to check for new messages when websockets are not supported.

    • Push technology is used to notify users of new messages even when the chat window is not open.

    • Messages are stored in a database an...

  • Answered by AI

Interview Preparation Tips

Eligibility criteriaAbove 7 CGPAFacebook interview preparation:Topics to prepare for the interview - Data Structures, Algorithms, System Design, Aptitude, OOPSTime required to prepare for the interview - 5 MonthsInterview preparation tips for other job seekers

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application resume tips for other job seekers

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Final outcome of the interviewSelected

Skills evaluated in this interview

Top trending discussions

View All
Salary Discussions, Hike & Promotions
2w
a senior executive
GF salary Vs. My salary
Me and my gf have been dating for 5 years. Back in 2020, I started my career with a package of ₹5 LPA. Over the years, I’ve reached ₹22 LPA in 2025. She started her journey with ₹3 LPA(2020) and is now earning ₹8 LPA(2025). We’ve been in a live-in relationship for around 2 years, and the idea was to share expenses equally. But, equal sharing never really happened. If we go to a café she likes, especially with friends, I will pay the entire bill. We only split the house rent and grocery bills. I told her lots of time to cut down these costly cafe expenses or earn more money, increase your package, study and work hard, but.....she is now in her comfort zone. Being from a tech background, I have seen people upgrade their skills and package for a good life in metro cities. I am ready to support her in her studies, but she is like I am earning enough for myself.... No, you are not. I love her, but I don't know how to overcome this issue between us. Please suggest!
Got a question about Facebook?
Ask anonymously on communities.

Interview questions from similar companies

I appeared for an interview before Dec 2015.

Interview Questionnaire 

2 Questions

  • Q1. 1 question from basic data structures and algorithms The question was similar to the one in the given link- -----/
  • Q2. Why do you want to join the company?
  • Ans. 

    I am excited to join the company because of its reputation for innovation and commitment to employee growth.

    • I am impressed by the company's track record of developing cutting-edge software solutions.

    • I appreciate the company's focus on fostering a culture of learning and development.

    • I am excited about the opportunity to work with a talented team of developers and contribute to the company's success.

    • I believe that the co...

  • Answered by AI

Interview Preparation Tips

Round: Resume Shortlist
Experience: Resumes were shortlisted with a short aptitude round where we are asked basic questions about databases, basic programming(C and C ++ questions)

Round: Technical Interview
Experience: The questions were asked were simple - related to arrays and data structures. Some questions were asked regarding my resume and projects.
Tips: Be thorough with geeksForGeeks, and your projects.

Round: HR Interview
Experience: I told him how I found the story of the founder of Infoedge very inspiring.
Tips: This round should be more simpler , be prepared with why you want to join the company and general HR questions

Skills: Basic C/C++, Programming Skills In Any Language Like C
College Name: IIIT Allahabad

Interview Preparation Tips

Round: Technical Interview
Experience: Ques will be based on arrays( duplicate element, missing element in 1 to n array), link list(reverse, remove loop, middle node etc), Hashing, sql join, normalisation, indexing in sql, singlton pattern and sorting and searching.
Tips: Focus will remain on algorithms. Whatever program they will ask to write, they will also ask to optimize the solution.

Skill Tips: Puzzle on mislabled jar, odd weight ball. As I had exp in Java, so some more que on Java, java script and web technology. All you need in interview is to be confident and show your interest in web domain.
Skills: Java, Data structure, Algorithm
College Name: NA
Are these interview questions helpful?

Interview Questionnaire 

10 Questions

  • Q1. What do you do when your schedule is interrupted? How you handle it?
  • Q2. PreOrder traversal without recursion?
  • Ans. 

    PreOrder traversal without recursion is done using a stack to simulate the function call stack.

    • Create an empty stack and push the root node onto it.

    • While the stack is not empty, pop a node from the stack and process it.

    • Push the right child of the popped node onto the stack if it exists.

    • Push the left child of the popped node onto the stack if it exists.

  • Answered by AI
  • Q3. Build a bst out of the unsorted array by looping over the array and inserting each element to the tree?
  • Ans. 

    Yes

    • Create an empty binary search tree (BST)

    • Loop over the unsorted array

    • For each element, insert it into the BST using the appropriate insertion logic

    • Repeat until all elements are inserted

    • The resulting BST will be built from the unsorted array

  • Answered by AI
  • Q4. Find 2 elements in array whose sum is equal to given number?
  • Ans. 

    The question asks to find two elements in an array whose sum is equal to a given number.

    • Iterate through the array and for each element, check if the difference between the given number and the current element exists in the array.

    • Use a hash set to store the elements as you iterate through the array for efficient lookup.

    • Return the pair of elements if found, otherwise return a message indicating no such pair exists.

  • Answered by AI
  • Q5. How many types of trigger?
  • Ans. 

    There are two types of triggers: DML triggers and DDL triggers.

    • DML triggers are fired in response to DML (Data Manipulation Language) statements like INSERT, UPDATE, DELETE.

    • DDL triggers are fired in response to DDL (Data Definition Language) statements like CREATE, ALTER, DROP.

    • Examples: A DML trigger can be used to log changes made to a table, while a DDL trigger can be used to enforce certain rules when a table is alt...

  • Answered by AI
  • Q6. Can trigger be used with select statement?
  • Ans. 

    Yes, triggers can be used with select statements in SQL.

    • Triggers are database objects that are automatically executed in response to certain events, such as insert, update, or delete operations.

    • While triggers are commonly used with insert, update, and delete statements, they can also be used with select statements.

    • Using triggers with select statements allows you to perform additional actions or validations before or af...

  • Answered by AI
  • Q7. Indexing in mysql? How many types of indexing in mysql?
  • Ans. 

    Indexing in MySQL improves query performance. There are several types of indexing in MySQL.

    • Indexes are used to quickly locate data without scanning the entire table.

    • Types of indexing in MySQL include B-tree, hash, full-text, and spatial indexes.

    • B-tree indexes are the most common and suitable for most use cases.

    • Hash indexes are used for exact match lookups.

    • Full-text indexes are used for searching text-based data efficie...

  • Answered by AI
  • Q8. Engines in mysql?
  • Ans. 

    Engines in MySQL are the underlying software components that handle storage, indexing, and querying of data.

    • MySQL supports multiple storage engines, each with its own strengths and features.

    • Some commonly used engines in MySQL are InnoDB, MyISAM, and Memory.

    • InnoDB is the default engine in MySQL and provides support for transactions and foreign keys.

    • MyISAM is known for its simplicity and speed but lacks transaction suppo...

  • Answered by AI
  • Q9. Singlton pattern?
  • Q10. Can a constructor be private?
  • Ans. 

    Yes, a constructor can be private.

    • A private constructor can only be accessed within the class itself.

    • It is often used in singleton design pattern to restrict object creation.

    • Private constructors are also useful for utility classes that only contain static methods.

  • Answered by AI

Interview Preparation Tips

Skills: Algorithm, Data structure
College Name: na

Skills evaluated in this interview

I appeared for an interview before Dec 2020.

Round 1 - Coding Test 

(1 Question)

Round duration - 90 minutes
Round difficulty - Easy

Myntra had conducted a coding test on campus before the start of the placement season with 2 questions, one on stack and other on DP.
Tips : For the test, the DP question asked was pretty standard, on Longest Common Subsequence. The question on stacks, I don't remember what it was but it was also pretty straight forward. For the test, I would recommend to solve problem from GFG. If they do come to resume shortlisting, they are looking for people who have done good projects and internships.

  • Q1. 

    Longest Common Subsequence Problem Statement

    Given two strings STR1 and STR2, determine the length of their longest common subsequence.

    A subsequence is a sequence that can be derived from another sequen...

  • Ans. 

    The task is to find the length of the longest common subsequence between two given strings.

    • Implement a function to find the longest common subsequence between two strings.

    • Use dynamic programming to solve this problem efficiently.

    • Iterate through the strings and build a matrix to store the lengths of common subsequences.

    • Return the length of the longest common subsequence found.

  • Answered by AI
Round 2 - Face to Face 

(1 Question)

Round duration - 60 minutes
Round difficulty - Easy

The interview started off with questions on my general interest in Software Development. The first round had two coding questions, I was supposed to write the code on paper. 
For the questions, they asked me to code the solution first. And then gave a specific input and asked me to demonstrate step by step in my code, how it would lead to the correct answer.
Tips: It's ok if you can't code a general solution, if you can write a code which works for the particular input they have given then also it's ok with them. But be thorough with Data structures.

  • Q1. 

    Add Two Numbers as Linked Lists

    You are given two singly linked lists, where each list represents a positive number without any leading zeros.

    Your task is to add these two numbers and return the sum as ...

  • Ans. 

    Add two numbers represented as linked lists and return the sum as a linked list.

    • Traverse both linked lists simultaneously while keeping track of carry from previous sum

    • Create a new linked list to store the sum, updating the value and carry as needed

    • Handle cases where one linked list is longer than the other by adding remaining digits with carry

  • Answered by AI
Round 3 - Face to Face 

(3 Questions)

Round duration - 60 minutes
Round difficulty - Medium

I wasn't asked to write any code in this interview. They asked me some questions on Machine Learning, because of my projects in them. Then they asked me if I knew graph algorithms. Since I knew BFS and DFS, I told them. They asked the difference between the two. Then they asked me if I knew how to find the shortest distance between two points in a graph. I didn't know Dijkstra's properly but I knew it worked on the greedy approach so was able to tell that. Then they asked me how would I find the second shortest path. I tried to answer it with the same greedy approach, but couldn't arrive at the complete solution.
Tips: They ask a tough theoretical question. It's ok if you don't know the answer, they only look for your approach.

  • Q1. 

    BFS Traversal in a Graph

    Given an undirected and disconnected graph G(V, E) where V vertices are numbered from 0 to V-1, and E represents edges, your task is to output the BFS traversal starting from the ...

  • Ans. 

    BFS traversal in a disconnected graph starting from vertex 0.

    • Use a queue to keep track of nodes to visit next in BFS traversal

    • Start traversal from vertex 0 and explore its neighbors first

    • Continue exploring neighbors level by level until all nodes are visited

    • Ensure to print connected nodes in numerical sort order

  • Answered by AI
  • Q2. 

    DFS Traversal Problem Statement

    Given an undirected and disconnected graph G(V, E), where V is the number of vertices and E is the number of edges, the connections between vertices are provided in the 'GR...

  • Ans. 

    DFS traversal to find connected components in an undirected and disconnected graph.

    • Perform DFS traversal on each vertex to find connected components

    • Maintain a visited array to keep track of visited vertices

    • Print the vertices of each connected component in ascending order

  • Answered by AI
  • Q3. 

    Dijkstra's Shortest Path Problem

    Given an undirected graph with ‘V’ vertices (labeled 0, 1, ... , V-1) and ‘E’ edges, where each edge has a weight representing the distance between two connected nodes (X,...

  • Ans. 

    Dijkstra's algorithm is used to find the shortest path from a source node to all other nodes in a graph with weighted edges.

    • Implement Dijkstra's algorithm to find the shortest path distances from the source node to all other nodes in the graph.

    • Use a priority queue to efficiently select the next node with the shortest distance.

    • Update the distances of neighboring nodes based on the current node's distance and edge weight...

  • Answered by AI

Interview Preparation Tips

Eligibility criteriaAbove 7 CGPA, Eligible branches : Computer Science & Engineering, Mathematics & Computing, Electrical Engineering and Electronics & Communication Engineering.Myntra interview preparation:Topics to prepare for the interview - Data Structures, Algorithms, System Design, Aptitude, OOPSTime required to prepare for the interview - 6 monthsInterview preparation tips for other job seekers

Tip 1 : Be thorough with Data Structures and Algorithms and also with your resume.
Tip 2 : Must do Previously asked Interview as well as Online Test Questions.
Tip 3 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 4 : Do at-least 2 good projects and you must know every bit of them.

Application resume tips for other job seekers

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Final outcome of the interviewSelected

Skills evaluated in this interview

Software Developer Interview Questions & Answers

Myntra user image Thommandru Vishnu

posted on 10 Mar 2015

Interview Questionnaire 

9 Questions

  • Q1. All the leaf nodes of tree are doubly linked,print only the leaf nodes of a tree
  • Ans. 

    Print only the leaf nodes of a doubly linked tree.

    • Traverse the tree and check if a node has no children and both left and right pointers are null.

    • If yes, then it is a leaf node and print it.

    • If no, then continue traversing the tree.

    • Use recursion to traverse the tree in a depth-first manner.

  • Answered by AI
  • Q2. LRU page Replacement Algorithm for large data
  • Ans. 

    LRU page replacement algorithm is used to replace the least recently used page in memory with a new page.

    • LRU stands for Least Recently Used

    • It is a cache eviction algorithm

    • It is used to manage memory in operating systems

    • It works by keeping track of the pages that are used recently and the ones that are not

    • When a new page is to be loaded into memory, the algorithm checks which page has not been used for the longest time ...

  • Answered by AI
  • Q3. Given a linked list with 2 parameters m,n. Now start reversing the m nodes and leave n nodes and continue it till u reach the end
  • Ans. 

    Reverse m nodes and leave n nodes in a linked list till the end.

    • Traverse the linked list till m nodes and reverse them

    • Traverse n nodes and continue reversing m nodes

    • Repeat the above step till the end of the linked list

    • Handle edge cases like m or n being greater than the length of the linked list

  • Answered by AI
  • Q4. Inorder Traversal of a tree
  • Ans. 

    Inorder traversal is a way of visiting all nodes in a binary tree by visiting the left subtree, then the root, and then the right subtree.

    • Start at the root node

    • Traverse the left subtree recursively

    • Visit the root node

    • Traverse the right subtree recursively

    • Repeat until all nodes have been visited

  • Answered by AI
  • Q5. Inorder Travesal of a tree without recursion(write the code)
  • Ans. 

    Inorder traversal of a tree without recursion

    • Create an empty stack and initialize current node as root

    • Push the current node to stack and set current = current.left until current is NULL

    • If current is NULL and stack is not empty, pop the top item from stack, print it and set current = popped_item.right

    • Repeat step 2 and 3 until stack is empty

  • Answered by AI
  • Q6. Given an array of numbers in which duplicates are there and one triplicate is there. find that number
  • Ans. 

    Find the triplicate number in an array of duplicates.

    • Iterate through the array and keep track of the frequency of each number.

    • Return the number that appears three times.

    • If no number appears three times, return null.

  • Answered by AI
  • Q7. Explain all the serach algorithm you know with space and Time complexities
  • Ans. 

    Explanation of search algorithms with their space and time complexities.

    • Linear Search - O(n) time complexity, O(1) space complexity

    • Binary Search - O(log n) time complexity, O(1) space complexity

    • Jump Search - O(√n) time complexity, O(1) space complexity

    • Interpolation Search - O(log log n) time complexity, O(1) space complexity

    • Exponential Search - O(log n) time complexity, O(1) space complexity

    • Fibonacci Search - O(log n) ...

  • Answered by AI
  • Q8. Given a situation and asks you which search algorithm suits the best in that situation
  • Ans. 

    Choosing the right search algorithm depends on data structure, size, and specific requirements like speed or memory usage.

    • Binary Search: Efficient for sorted arrays, O(log n) time complexity. Example: Finding a number in a sorted list.

    • Linear Search: Simple and works on unsorted arrays, O(n) time complexity. Example: Searching for a name in an unsorted list.

    • Depth-First Search (DFS): Suitable for tree/graph traversal, ex...

  • Answered by AI
  • Q9. Given an array of length n and in which numbers from 1-n will be there and each number can repeat any number of times find out which repeated more number of times
  • Ans. 

    Find the most repeated number in an array of length n with numbers 1-n.

    • Create a dictionary to store the count of each number in the array

    • Iterate through the array and update the count in the dictionary

    • Find the key with the highest count in the dictionary

  • Answered by AI

Interview Preparation Tips

Round: Resume Shortlist
Experience: Basically, it's not resume shortlist, it's a 9 pointer shortlist

Round: Test
Experience: The Entire Test is held in HackerRank Platform. it has
2 coding questions (one easy and one medium)
2 output questions(medium)
2 Aptitude(easy)
1 general Computer science(medium)
it took me 30 min for each coding questions.I was not known that general question is related to bash commands.
Tips: Practice the Warmup questions in Hacker Rank.
Do some Basic aptitude questions.
Thorough with the basic c and c++ concepts
Duration: 120 minutes
Total Questions: 7

Round: Technical Interview
Experience: It's completely around the data structures. The questions are a bit tricky but once u think without any tension u can get through easily. The interviewer is helpful and gives u few hints if u catch them at the right point of time u got it.There are 2 more questions which I haven't mentioned.
Tips: got through Data Structures and Algorithms Made Easy by Narasimha Karumanchi. It's a best book for the interviews.

Round: Technical Interview
Experience: The interviewer asked to put everything on the blackboard and write down the code of each and everything.
Tips: Go to the website -----/ and study all the interview questions and modules

Round: HR Interview
Experience: It's Technical+ HR interview all the technical questions went around resume. it went around 45 minutes they are very particular about what you wrote in the resume.HR questions are general like
whats your future plans
where will u see yourself in the office after 5 years?
Tips: please make sure that whatever you write in resume should be known to you very well.Don't write false things about yourself.And make sure you know completely about the projects you are going to write in resume(atleast the part you worked)

General Tips: Be sure of what you are saying. Don't be tensed and answer to your best.
Skills: Programming, Data Structures
College Name: VIT VELLORE

Skills evaluated in this interview

Facebook Interview FAQs

How many rounds are there in Facebook Software Developer interview?
Facebook interview process usually has 1 rounds. The most common rounds in the Facebook interview process are HR and Coding Test.

Tell us how to improve this page.

Overall Interview Experience Rating

5/5

based on 3 interview experiences

Difficulty level

Moderate 100%

Duration

2-4 weeks 100%
View more
Facebook Software Developer Salary
based on 25 salaries
₹35.3 L/yr - ₹36.4 L/yr
263% more than the average Software Developer Salary in India
View more details

Facebook Software Developer Reviews and Ratings

based on 8 reviews

4.2/5

Rating in categories

4.2

Skill development

4.2

Work-life balance

4.2

Salary

4.1

Job security

4.3

Company culture

4.1

Promotions

4.4

Work satisfaction

Explore 8 Reviews and Ratings
Software Engineer
87 salaries
unlock blur

₹84.9 L/yr - ₹120 L/yr

Software Developer
25 salaries
unlock blur

₹35.3 L/yr - ₹36.3 L/yr

Data Scientist
21 salaries
unlock blur

₹66.6 L/yr - ₹130.5 L/yr

Senior Software Engineer
19 salaries
unlock blur

₹15 L/yr - ₹44.5 L/yr

Program Manager
15 salaries
unlock blur

₹20 L/yr - ₹65 L/yr

Explore more salaries
Compare Facebook with

Google

4.4
Compare

Amazon

4.0
Compare

Apple

4.3
Compare

eBay

4.0
Compare
write
Share an Interview