LinkedIn interview experience Real time questions & tips from candidates to crack your interview

Software Developer

LinkedIn
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 5 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS
Tip
Tip

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 process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

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.

Interview rounds

01
Round
Medium
Online Coding Test
Duration60 minutes
Interview date21 May 2015
Coding problem3

This was a 1 hour online coding round on hackerrank platform. 3 DSA questions were given.

1. Selling Stock

Moderate
22m average time
0/80
Asked in companies
PhonePeAmazonFacebook

You have been given stock values/prices for N number of days. Every i-th day signifies the price of a stock on that day. Your task is to find the maximum profit which you can make by buying and selling the stocks.

 Note :
You may make as many transactions as you want but can not have more than one transaction at a time i.e, if you have the stock, you need to sell it first, and then only you can buy it again.
Problem approach

A max heap can be used here. In order to maximize the profit, the ticket must be for the seat in a row which has the maximum number of vacant seats and the number of vacant seats in that row will be decremented by 1 as one of the seats has just been sold. All the persons can be sold a seat ticket until there are vacant seats.

Try solving now

2. NINJA'S COMPLEMENT

Easy
20m average time
80% success
0/40
Asked in companies
InfosysLinkedIn

Everyday ninja sees a number in his dream but he doesn’t realize the meaning of that number. Somehow ninja manages to get the secret of his number. He comes to know that if he converts that number into binary and takes its complement and again converts it into decimal type he will get a lottery winning number of ‘Chit fund’ lottery.

But ninja is not good at maths so he is very sad about how he will get that lottery number from his dream’s number. So help our ninja in getting that lottery number.

Your task is to convert the given number into its binary form then take its complement ( Complement of a binary number is the value obtained by swapping all the bits i.e if ‘1’ is present you swap it with ‘0’ and vice versa ), then again convert it into its decimal representation.

Problem approach

To find b’s complement: To find b’s complement, add 1 to the calculated (b-1)’s complement.
Steps to find (b-1)’s complement: 
To find (b-1)’s complement, Subtract each digit of the number from the largest number in the number system with base b .
For example, if the number is a three-digit number in base 9, then subtract the number from 888 as 8 is the largest number in base 9 number system. The obtained result is the (b-1)’s (8’s complement) complement.

Try solving now

3. Check N numbers

Moderate
10m average time
90% success
0/80
Asked in companies
UberLinkedInCisco

Given an array ‘arr’ of ‘N’ integers, make a number from those set of all integers from the ‘arr’ such that if number of ‘ith’ set bits are greater than the number of ‘ith’ unset bits then make that ‘ith’ bit of the new number as set bi otherwise make that ‘ith’ bit as unset bit.

For Example:

There are three numbers, say 8, 5 and 10. 
8 can be written as      1 0 0 0 .
5 can be written as      0 1 0 1.
10 can be written as     1 0 1 0. 
positions of the bits as i j k l.
So we can see majority bit at ith position are set bits so ith bit will be 1. Similarly for positions of j, k and l are set as 0 0 0 respectively.
So the number generated is 1 0 0 0 i.e. 8. 
Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date25 May 2015
Coding problem2

In this round, a DSA question was first asked. Then a lot of discussion regarding the various test cases around this question took place. (e.g, handing of -ve numbers , decimals , overflow etc).
Main concentration was just to get as many as test cases possible and an efficient solution as well.
And Some common question like why you coding in C++?

1. Sum of Digits

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

Ninja is given an integer ‘N’. One day Ninja decides to do the sum of all digits and replace the ‘N’ with the sum of digits until it becomes less than 10. Ninja wants to find what will be the value of ‘N’ after applying this operation.

Help Ninja in finding out this value.

Problem approach

Scan each character of the input string and if a number is formed by consecutive characters of the string, we increment the result by that amount.
Time Complexity : O(n)

Try solving now

2. OOPS Question

What are the advantages of OOPS?

Problem approach

OOP language allows to break the program into the bit-sized problems that can be solved easily (one object at a time).
The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost.
OOP systems can be easily upgraded from small to large systems.
It is possible that multiple instances of objects co-exist without any interference,
It is very easy to partition the work in a project based on objects.
It is possible to map the objects in problem domain to those in the program.
The principle of data hiding helps the programmer to build secure programs which cannot be invaded by the code in other parts of the program.
By using inheritance, we can eliminate redundant code and extend the use of existing classes.

03
Round
Easy
Video Call
Duration60 minutes
Interview date25 May 2015
Coding problem1

Again one coding question to be done on shared screen

1. Number Of Triangles In Directed And Undirected Graphs

Moderate
30m average time
70% success
0/80
Asked in companies
IBMOptumDelhivery

Ninja has been given two Graphs: a directed graph ‘DIRGRAPH’ and an undirected graph ‘UNDIRGRAPH’. Ninja has to count the number of triangles in each of the graphs.

Can you help Ninja with finding the number of triangles in ‘DIRGRAPH’ and ‘UNDIRGRAPH’.

For Example :

graph1

In this example, this graph is directed and there are two triangles possible.
Triangle 1 : (0 3 2)
Triangle 2 : (0 1 2)

graph1

In this example, this graph is undirected and there are two triangles possible.
Triangle 1 : (0 3 2)
Triangle 2 : (0 1 2)
Problem approach

The naïve approach is to run three loops and keep track of the number of triangles possible so far. The three loops select three different values from array, the innermost loop checks for the triangle property ( the sum of any two sides must be greater than the value of third side).
Time Complexity: O(N^3) where N is the size of input array.

The efficient approach is based on the following fact :
Let a, b and c be three sides. The below condition must hold for a triangle (Sum of two sides is greater than the third side)
i) a + b > c
ii) b + c > a
iii) a + c > b
Following are steps to count triangle.
1. Sort the array in increasing order.
2. Initialize two pointers ‘i’ and ‘j’ to first and second elements respectively, and initialize count of triangles as 0.
3. Fix ‘i’ and ‘j’ and find the rightmost index ‘k’ (or largest ‘arr[k]’) such that ‘arr[i] + arr[j] > arr[k]’. The number of triangles that can be formed with ‘arr[i]’ and ‘arr[j]’ as two sides is ‘k – j’. Add ‘k – j’ to count of triangles.
4. Increment ‘j’ to fix the second element again.
5. If ‘j’ has reached end, then increment ‘i’. Initialize ‘j’ as ‘i + 1’, ‘k’ as ‘i+2’ and repeat the steps 3 and 4.

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

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
Software Developer
3 rounds | 10 problems
Interviewed by LinkedIn
905 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 5 problems
Interviewed by LinkedIn
0 views
1 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by LinkedIn
927 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 6 problems
Interviewed by LinkedIn
1142 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Developer
3 rounds | 8 problems
Interviewed by Tata Consultancy Services (TCS)
0 views
0 comments
0 upvotes
company logo
Software Developer
2 rounds | 3 problems
Interviewed by Tata Consultancy Services (TCS)
2285 views
0 comments
0 upvotes
company logo
Software Developer
3 rounds | 3 problems
Interviewed by HCL Technologies
1824 views
1 comments
0 upvotes