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

Power Programmer

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

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: All types of Sorting, Trees, OOPS, Trees, Graphs, Dynamic Programming
Tip
Tip

Tip 1 : Revise theory also like DBMS relations, Normal forms
Tip 2 : Keep your compiler ready in your computer
Tip 3 : I think this company is easiest to crack than other companies because the question asked were easy if one have studied or even aware of them

Application process
Where: Email Approach
Eligibility: Fresher,7 CGPA and above
Resume Tip
Resume tip

Tip 1 : Mention projects related to computer science
Tip 2 : One page and your achievements should be clearly visible (working in college societies are not achievements)

Interview rounds

01
Round
Medium
Online Coding Interview
Duration300 minutes
Interview date30 Dec 2021
Coding problem3

Coding test + mcq test in both coding and aptitude...took 5 hrs

1. Maximum XOR

Hard
10m average time
90% success
0/120
Asked in companies
Red HatErnst & Young (EY)InMobi

You are given two arrays of non-negative integers say ‘arr1’ and ‘arr2’. Your task is to find the maximum value of ( ‘A’ xor ‘B’ ) where ‘A’ and ‘B’ are any elements from ‘arr1’ and ‘arr2’ respectively and ‘xor’ represents the bitwise xor operation.

Problem approach

The idea is to find a suitable rearrangement of S1, S2, and S3 such that their Bitwise XOR value is maximized using Dynamic Programming. The subproblems can be stored in a dp[][][][] table where dp[i][o1][o2][o3] stores the maximum XOR value up to position N-1 starting from the index i, where o1 is, o2 and o3 are the number of 1s still remaining to be placed in strings S1, S2 and S3 respectively.

There can be four cases possible at any position i from 0 to (N – 1):

Assign 1s to all the three strings
Assign 1s to any two strings
Assign 1s to any one of the strings.
Assign 0s to all the strings.
From the above possible cases for each position, calculate the maximum Bitwise XOR obtainable from the four possibilities:

Follow the steps below to solve the problem:

Initialize a table dp[][][][] to store the number of ones in S1, S2 and S3 for the positions i from 0 to N-1.
The transition states is as follows:
dp[i][o1][o2][o3] = max(dp(assign 1s to all three strings), dp(assign 1s to any of the two strings), dp(assign 1s to any one string), dp(do not assign 1 to any string)) where,

i = current position
o1 = remaining ones to be placed in the string S1
o2 = remaining ones to be placed in the string S2
o3 = remaining ones to be placed in the string S3

Solve the subproblems for all cases using the above transition and print the maximum XOR value amongst them.

Try solving now

2. Maximum Product Subarray

Moderate
25m average time
75% success
0/80
Asked in companies
AmazonMicrosoftSamsung

You are given an array “arr'' of integers. Your task is to find the contiguous subarray within the array which has the largest product of its elements. You have to report this maximum product.

An array c is a subarray of array d if c can be obtained from d by deletion of several elements from the beginning and several elements from the end.

For e.g.- The non-empty subarrays of an array [1,2,3] will be- [1],[2],[3],[1,2],[2,3],[1,2,3]. 
For Example:
If arr = {-3,4,5}.
All the possible non-empty contiguous subarrays of “arr” are {-3}, {4}, {5}, {-3,4}, {4,5} and {-3,4,5}.
The product of these subarrays are -3, 4, 5, -12, 20 and -60 respectively.
The maximum product is 20. Hence, the answer is 20.
Follow Up:
Can you solve this in linear time and constant space complexity?
Try solving now

3. DBMS Question

Find second largest ,third largest salary in employee field.

Problem approach

Tip 1 : use nested query
 

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
Power Programmer
2 rounds | 2 problems
Interviewed by Infosys private limited
3421 views
1 comments
0 upvotes
Power Programmer
2 rounds | 4 problems
Interviewed by Infosys private limited
0 views
0 comments
0 upvotes
Power Programmer
4 rounds | 5 problems
Interviewed by Infosys private limited
1285 views
0 comments
0 upvotes
Power Programmer
1 rounds | 1 problems
Interviewed by Infosys private limited
559 views
0 comments
0 upvotes