Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Facebook interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Facebook
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Linked List, Binary Search Tree ,Queue, Array ,DP ,Graph ,Recursion
Tip
Tip

Tip 1 : Practice Atleast 500 Questions
Tip 2 : Do atleast 1 good projects
Tip 3 : You should be able to explain your project

Application process
Where: Campus
Eligibility: 8 CGPA above
Resume Tip
Resume tip

Tip 1 : Have some projects on resume. 
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration75 minutes
Interview date8 Aug 2014
Coding problem2

Timing it is around 11 am and Environment is good .

1. Bird and maximum fruit-gathering

Easy
20m average time
80% success
0/40
Asked in company
Facebook

There are ‘N’ trees in a circle. Each tree has a fruit value associated with it. A ninja bird eyeing the fruits on the tree is blazingly fast. It can sit on a tree for 0.5 sec to gather all the fruits present on the tree no matter the number of fruits present in the tree and then the ninja bird can move to a neighboring tree. It takes the ninja bird 0.5 seconds to move from one tree to another. Once all the fruits are picked from a particular tree, she can’t pick any more fruits from that tree. The maximum number of fruits she can gather is infinite.

You are given N and M (the total number of seconds the ninja bird has), and the fruit values of the trees. Your task is to maximize the total fruit value that the ninja bird can gather. The bird can start from any tree.

Note
All trees are in a circle.
For Example:
Input: N = 7 M = 3
ARR[] = { 2, 1, 3, 5, 0, 1, 4 }

Output: 9

Explanation: 
She can start from tree 1 and move to tree 2 and then to tree 3.
Hence, total number of gathered fruits = 1 + 3 + 5 = 9.
Try solving now

2. Base 58

Easy
15m average time
85% success
0/40
Asked in companies
FacebookUber

You are given a number N. Your goal is to convert the number into base 58.

The Base58 alphabet consists of the following characters: “123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz”

Each byte value from 0 to 57 maps to the alphabet above.

Conversion Eg: ( according to above mapping).

Base 10 | Base 58
0       |     1  
1       |     2  
10      |     A  
20      |     L
30      |     W 
53      |     u 
Try solving now
02
Round
Medium
Telephonic
Duration45 mintues
Interview date31 Aug 2014
Coding problem2

Environment was very friendly but questions asked are hard

1. Pair Sum

Easy
15m average time
85% success
0/40
Asked in companies
Goldman SachsFacebookQuikr

You are given an array/list ‘ARR’ consisting of ‘N’ distinct integers arranged in ascending order. You are also given an integer ‘TARGET’. Your task is to count all the distinct pairs in ‘ARR’ such that their sum is equal to ‘TARGET’.

Note:

1. Pair (x,y) and Pair(y,x) are considered as the same pair. 

2. If there exists no such pair with sum equals to 'TARGET', then return -1.

Example:

Let ‘ARR’ = [1 2 3] and ‘TARGET’ = 4. Then, there exists only one pair in ‘ARR’ with a sum of 4 which is (1, 3). (1, 3) and (3, 1) are counted as only one pair.
Try solving now

2. Triplets with Given Sum

Moderate
15m average time
85% success
0/80
Asked in companies
MyntraBarclaysMeesho

You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K.

An array is said to have a triplet {ARR[i], ARR[j], ARR[k]} with sum = 'K' if there exists three indices i, j and k such that i!=j, j!=k and i!=j and ARR[i] + ARR[j] + ARR[k] = 'K'.

Note:
1. You can return the list of values in any order. For example, if a valid triplet is {1, 2, -3}, then {2, -3, 1}, {-3, 2, 1} etc is also valid triplet. Also, the ordering of different triplets can be random i.e if there are more than one valid triplets, you can return them in any order.
2. The elements in the array need not be distinct.
3. If no such triplet is present in the array, then return an empty list, and the output printed for such a test case will be "-1".
Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you write a single-line comment in C++?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SWE Intern
2 rounds | 5 problems
Interviewed by Facebook
1047 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Facebook
1325 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 10 problems
Interviewed by Facebook
667 views
0 comments
0 upvotes
company logo
Business Technology Analyst
1 rounds | 2 problems
Interviewed by Facebook
0 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13360 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
12384 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
8919 views
2 comments
0 upvotes