Infosys private limited interview experience Real time questions & tips from candidates to crack your interview

Specialist Programmer

Infosys private limited
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Competitive Programming, Data Structures and Algorithms, OOPS, Design and Analysis of Algorithms (DAA), Computer Networking, Operating System, C++, Java
Tip
Tip

Tip 1 : Have atleast 2 projects in resume and must have full knowledge about them.
Tip 2 : Solve first easy and medium level programming questions then Hard ones
Tip 3 : First solve hacker rank and geeks for geeks problem and then Leetcode will me more than efficient

Application process
Where: Campus
Eligibility: Graduation completed
Resume Tip
Resume tip

Tip 1 : Resume should not cross more than two pages
Tip 2 : Have minimum of 2 projects
Tip 3 : Should sound more technical less managerial or personal traits

Interview rounds

01
Round
Medium
Online Coding Interview
Duration120 minutes
Interview date30 Mar 2020
Coding problem2

Have 2- 3 shifts from morning till evening.
Environment was quite and good
3 coding questions to solve in 2 hours

1. Ninja Game

Hard
20m average time
75% success
0/120
Asked in companies
AmazonAtlassianMeesho

Ninja and his friend are playing a game. They are having ‘N’ piles and each pile contains ‘A[i]’ amount of stones in it. Ninja will make the first move.

In each move, a player can choose any pile and remove any number of stones ( at least one ) from that pile. The player who cannot make a move loses the game.

Assuming both players play optimally, output 1 if Ninja wins the game and 0 if Ninja loses the game.

Example :
N = 3
A = [ 3, 4, 5 ]

Explanation : 

One of the optimal ways to play the game is : 

Ninja removes 3 stones from the first pile : [ 0, 4, 5 ].
Friend removes 3 stones from the second pile : [ 0, 1, 5 ].
Ninja removes 3 stones from the third pile : [ 0, 1, 1 ].
Friend removes 1 stone from the second pile : [ 0, 0, 1 ].
Ninja removes 1 stones from the third pile : [ 0, 0, 0 ].

Thus Ninja wins the game here.
Try solving now

2. NINJA ATTACK

Moderate
35m average time
65% success
0/80
Asked in companies
CognizantIBMPaytm (One97 Communications Limited)

Ninja has built his team of ninjas to fight with the enemies in his city. Ninja made a plan of attacking all his enemies. In his team, every ninja has his own range of hitting and they had secretly got the hitting range of their enemies as well. So Ninja allowed some swaps between his ninjas so that they can minimize the hamming distance that is the number of positions where the hitting range of enemies and ninjas are different.

Your task is to write a code that can minimize the hamming distance. You are being provided with two arrays ‘ninja’ and ‘enemies’ both of the same size and an array ‘allowedSwaps’ where each allowedSwaps[i] = [ ai, bi ] indicates that you are allowed to swap the elements at index ai and index bi.

The Hamming distance of two arrays of the same length, ninja, and enemies, is the number of positions where the elements are different.

Example :

Consider the case ‘ninja’array is [ 1, 2, 3, 4 ], ‘enemies’array is [ 2, 1, 4, 5 ] and ‘allowedSwaps’ are  = [ [ 0, 1 ], [ 2, 3 ] ] so after swapping in best manner according to ‘allowedSwaps’ our ‘ninja’ array becomes [ 2, 1, 4, 3 ]. So minimum Hamming distance is ‘1’ as now there is only one different element as compared to ‘ninja’ and ‘enemies’ array index.
Note :
1. You are allowed to do as many swap operations on the ‘ninja’ array as you want but according to the ‘allowedSwap’ array.
2. You are not required to print anything explicitly. It has already been taken care of. Just implement the function.
Try solving now
02
Round
Medium
Face to Face
Duration60 mins
Interview date14 Jun 2020
Coding problem1

It was interview round.
Around 2PM.
In Pune.
Nice environment.
They have given one problem based on graph to solve and explain.
Explain about your projects completely.
Java basic questions.
Operating system problems and questions.
Mainly interview went on the question given by team by to solve graph problem

1. Shortest path in an unweighted graph

Moderate
25m average time
70% success
0/80
Asked in companies
AmazonMicrosoftJP Morgan

The city of Ninjaland is analogous to the unweighted graph. The city has ‘N’ houses numbered from 1 to ‘N’ respectively and are connected by M bidirectional roads. If a road is connecting two houses ‘X’ and ‘Y’ which means you can go from ‘X’ to ‘Y’ or ‘Y’ to ‘X’. It is guaranteed that you can reach any house from any other house via some combination of roads. Two houses are directly connected by at max one road.

A path between house ‘S’ to house ‘T’ is defined as a sequence of vertices from ‘S’ to ‘T’. Where starting house is ‘S’ and the ending house is ‘T’ and there is a road connecting two consecutive houses. Basically, the path looks like this: (S , h1 , h2 , h3 , ... T). you have to find the shortest path from ‘S’ to ‘T’.

For example
In the below map of Ninjaland let say you want to go from S=1 to T=8, the shortest path is (1, 3, 8). You can also go from S=1 to T=8  via (1, 2, 5, 8)  or (1, 4, 6, 7, 8) but these paths are not shortest.

altImage

Problem approach

This we have to find the shortest path from node 0 to all the other nodes in graph.

Then create a unvisited nodes.
Remove array element from unvisited nodes array when you visit them.
Create a array for distance and initialised it to infinity and once you more along the nodes then change from infinity to the distance you find.
It is visited and not the distance and add it to the path
Finally you will see all the notes that are visited and along with it what is the distance of it that will be your final result of shortest path.

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

To make an AI less repetitive in a long paragraph, you should increase:

Choose another skill to practice
Similar interview experiences
Specialist Programmer
2 rounds | 4 problems
Interviewed by Infosys private limited
925 views
0 comments
0 upvotes
Specialist Programmer
2 rounds | 3 problems
Interviewed by Infosys private limited
875 views
0 comments
0 upvotes
Specialist Programmer
2 rounds | 11 problems
Interviewed by Infosys private limited
1239 views
0 comments
0 upvotes
Specialist Programmer
2 rounds | 4 problems
Interviewed by Infosys private limited
131 views
0 comments
0 upvotes