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 | 8 Coding problems

Interview preparation journey

expand-icon
Journey
I started my journey in coding in the second year of my graduation. I learned Java basics from YouTube and started solving coding questions on CodeStudio. Later, I also tried my hand at competitive programming and started giving contests on Codeforces and Codechef.
Application story
I applied for this role from InfyTQ. I learned about this drive from my friend, and then I applied. I got the link in my mail one day before the online assessment.
Why selected/rejected for the role?
I don't know why I got rejected, but I guess I couldn't explain my code to the interviewer, and there were some questions I couldn't answer.
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1: Prepare some Projects
Tip 2: Practice At least 250 Questions of DS algo
Tip 3: Do at least two application based projects

Application process
Where: Company Website
Eligibility: 7 CGPA and No backlogs
Resume Tip
Resume tip

Tip 1 : add some application based projects in your resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Hard
Online Coding Test
Duration180 mins
Interview date22 Oct 2022
Coding problem3

3 coding questions to be solved in 3 hours

1. Longest Subsequence With Difference One

Moderate
30m average time
70% success
0/80
Asked in companies
HSBCAmazonCIS - Cyber Infrastructure

You are given an array “nums” of size N. Your task is to find the length of the longest subsequence of array “nums” such that the absolute difference between every adjacent element in the subsequence is one.

For Example:
If “nums” = {2, 1, 3}.

The valid non-empty subsequences of the array are {2}, {1}, {3}, {2, 1}, {1, 3}, {2, 3} and {2, 1, 3}. So, the longest subsequence satisfying the given conditions are {2, 1} and {2, 3}. The length of the longest subsequence is 2. So, the answer is 2.

The subsequence of an array is a sequence of numbers that can be formed by deleting some or no elements without changing the order of the remaining elements. For example, if the given array “nums” = {1, 2, 5, 4, 8}, then {1, 2, 5, 4, 8}, {1, 5, 8}, {2} are some of the valid subsequences whereas the sequence {4, 2} is not a valid subsequence as the order of the elements differ from the original array.

Note:
Any subsequence of length = 1 is also a valid subsequence.
Try solving now

2. Best Time to Buy and Sell Stock

Moderate
20m average time
80% success
0/80
Asked in companies
NoBrokerIntuitOptum

You are given an array/list 'prices' where the elements of the array represent the prices of the stock as they were yesterday and indices of the array represent minutes. Your task is to find and return the maximum profit you can make by buying and selling the stock. You can buy and sell the stock only once.

Note:

You can’t sell without buying first.
For Example:
For the given array [ 2, 100, 150, 120],
The maximum profit can be achieved by buying the stock at minute 0 when its price is Rs. 2 and selling it at minute 2 when its price is Rs. 150.
So, the output will be 148.
Problem approach

class Solution:
def maxProfit(self,prices):
left = 0 #Buy
right = 1 #Sell
max_profit = 0
while right < len(prices):
currentProfit = prices[right] - prices[left] #our current Profit
if prices[left] < prices[right]:
max_profit =max(currentProfit,max_profit)
else:
left = right
right += 1
return max_profit

Try solving now

3. Ninja And XOR

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

Ninja has been given an array/list ‘ARR’ having ‘N’ positive integers. Ninja wants to reconstruct the ‘ARR’ such that the newly formed array contains the XOR of consecutive elements in the ‘ARR’.

For Example: For ‘ARR’ = [1, 2, 3, 4, 5] the reconstructed ‘ARR’ will be [3, 1, 7, 1, 5].

1. The element at index  0 in the new ‘ARR’ is 3 because ‘ARR[0]’ ^ ‘ARR[1]’ is 1 ^ 2 which is equal to 3.

2. The element at index  1 in the new ‘ARR’ is 1 because ‘ARR[1]’ ^ ‘ARR[2]’ is 2 ^ 3 which is equal to 1.

3. The element at index  2 in the new ‘ARR’ is 7 because ‘ARR[2]’ ^ ‘ARR[3]’ is 3 ^ 4 which is equal to 7.

4. The element at index  3 in the new ‘ARR’ is 1 because ‘ARR[3]’ ^ ‘ARR[4]’ is 4 ^ 5 which is equal to 1.

5. The element at index  4 in the new ‘ARR’ is 5 because there is no element in the right of ‘ARR[4]’ so it will remain as it is in the new ‘ARR’. 

Note:

As Ninja is busy with some other task, so he asks you for help. Can you help Ninja to reconstruct the ‘ARR’?
Try solving now
02
Round
Medium
Video Call
Duration45 minutes
Interview date1 Dec 2022
Coding problem5

1. Cycle Detection in a Singly Linked List

Moderate
15m average time
80% success
0/80
Asked in companies
InformaticaUrban Company (UrbanClap)PhonePe

You are given a Singly Linked List of integers. Return true if it has a cycle, else return false.


A cycle occurs when a node's next points back to a previous node in the list.


Example:
In the given linked list, there is a cycle, hence we return true.

Sample Example 1

Try solving now

2. Time Complexity question

What is the time Complexity of binary search? (Learn)

Problem approach

Ans:- nlog(n)

3. OOPs

What are Wrapper classes? (Learn)

Problem approach

A wrapper class wraps primitive data types like (int, char, etc.,) which can then be used as objects.

4. Computer Networking question

What is the difference between TCP and UDP protocols? Which is the better one among these? (Learn)

Problem approach

The main difference between TCP (transmission control protocol) and UDP (user datagram protocol) is that TCP is a connection-based protocol and UDP is connectionless. While TCP is more reliable, it transfers data more slowly. UDP is less reliable but works more quickly.

5. Second largest element in the array

Easy
15m average time
80% success
0/40
Asked in companies
AdobeTata Consultancy Services (TCS)Samsung

You have been given an array/list 'ARR' of integers. Your task is to find the second largest element present in the 'ARR'.

Note:
a) Duplicate elements may be present.

b) If no such element is present return -1.
Example:
Input: Given a sequence of five numbers 2, 4, 5, 6, 8.

Output:  6

Explanation:
In the given sequence of numbers, number 8 is the largest element, followed by number 6 which is the second-largest element. Hence we return number 6 which is the second-largest element in the sequence.
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
924 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
1238 views
0 comments
0 upvotes
Specialist Programmer
2 rounds | 4 problems
Interviewed by Infosys private limited
130 views
0 comments
0 upvotes