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

Interview preparation journey

expand-icon
Journey
I started preparing for this job interview during my graduation in the fourth year as I have to apply for campus placements. I got to know about this from tnp cell of my college. This drive was specially for the freshers. There were total 2 rounds 1. Coding Round 2. Technical Round
Application story
I got to know about this drive from the placement cell of my college. I filled the form and after that I got the details of my coding round. The duration of coding round was 3 hrs and I had to solve 3 coding problems. Difficulty level of questions were from medium to Hard.
Why selected/rejected for the role?
I got rejected for this role because I wasn't able to give them best approach for the given coding problems.
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, Algorithms, Dynamic Programming, My SQL, Database, Operating System
Tip
Tip

Tip 1 : Practice at least 250 Questions on GFG/Leetcode
Tip 2 : For DSA questions in interviews, start explaining from the brute force approach and then move to the optimal one. Convey your thought process to the interviewers, so that they can help you out if you get stuck.
Tip 3 : Do not write anything that you are not confident of in resume
Tip 4 : Do at least 2 projects

Application process
Where: Campus
Eligibility: 65%
Resume Tip
Resume tip

Tip 1 : Try to include at least one development project in your resume.
Tip 2 : Interviewer will ask anything from your resume so be prepared for it.
Tip 3 : Don't mention some random projects which you are not sure about or copied from Google or somewhere else.

Interview rounds

01
Round
Easy
Online Coding Test
Duration180 minutes
Interview date29 Jul 2022
Coding problem2

There were three coding problems.
1. Medium
2. Medium
3. Hard
I was able to solve 2.5 problems and got shortlisted for interview. I remember only 2.

1. Allocate Books

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

Ayush is studying for ninjatest which will be held after 'N' days, And to score good marks he has to study 'M' chapters and the ith chapter requires TIME[i] seconds to study. The day in Ayush’s world has 100^100 seconds. There are some rules that are followed by Ayush while studying.

1. He reads the chapter in a sequential order, i.e. he studies i+1th chapter only after he studies ith chapter.

2. If he starts some chapter on a particular day he completes it that day itself.

3. He wants to distribute his workload over 'N' days, so he wants to minimize the maximum amount of time he studies in a day.

Your task is to find out the minimal value of the maximum amount of time for which Ayush studies in a day, in order to complete all the 'M' chapters in no more than 'N' days.

For example

if Ayush want to study 6 chapters in 3 days and the time that each chapter requires is as follows:
Chapter 1 = 30
Chapter 2 = 20
Chapter 3 = 10
Chapter 4 = 40
Chapter 5 = 5
Chapter 6 = 45

Then he will study the chapters in the following order 

| day 1 : 1 , 2 | day 2 : 3 , 4 | day 3 : 5 , 6 |
Here we can see that he study chapters in sequential order and the maximum time to study on a day is 50, which is the minimum possible in this case.
Try solving now

2. Longest Consecutive Sequence

Moderate
40m average time
70% success
0/80
Asked in companies
AmazonAppleUber

You are given an unsorted array/list 'ARR' of 'N' integers. Your task is to return the length of the longest consecutive sequence.

The consecutive sequence is in the form ['NUM', 'NUM' + 1, 'NUM' + 2, ..., 'NUM' + L] where 'NUM' is the starting integer of the sequence and 'L' + 1 is the length of the sequence.

Note:

If there are any duplicates in the given array we will count only one of them in the consecutive sequence.
For example-
For the given 'ARR' [9,5,4,9,10,10,6].

Output = 3
The longest consecutive sequence is [4,5,6].
Follow Up:
Can you solve this in O(N) time and O(N) space complexity?
Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date1 Oct 2022
Coding problem3

Interviewer asked me 2 coding problems and asked me some question from my projects, oops, DBMS and computer networks.

1. Minimum Cost To Make String Valid

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

Ninja has been given a string ‘STR’ containing either ‘{’ or ‘}’. 'STR’ is called valid if all the brackets are balanced. Formally for each opening bracket, there must be a closing bracket right to it.

For Example:
“{}{}”, “{{}}”, “{{}{}}” are valid strings while “}{}”, “{}}{{}”, “{{}}}{“ are not valid strings.

Ninja wants to make ‘STR’ valid by performing some operations on it. In one operation, he can convert ‘{’ into ‘}’ or vice versa, and the cost of one such operation is 1.

Your task is to help Ninja determine the minimum cost to make ‘STR’ valid.

For Example:
Minimum operations to make ‘STR’ =  “{{“ valid is 1.

In one operation, we can convert ‘{’ at index ‘1’ (0-based indexing) to ‘}’. The ‘STR’ now becomes "{}" which is a valid string.

Note:
Return -1 if it is impossible to make ‘STR’ valid.
Try solving now

2. Rotting Oranges

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

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • Value 2 - representing a rotten orange.
  • Every second, any fresh orange that is adjacent(4-directionally) to a rotten orange becomes rotten.

    Your task is to find out the minimum time after which no cell has a fresh orange. If it's impossible to rot all the fresh oranges then print -1.

    Note:
    1. The grid has 0-based indexing.
    2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
    
    Problem approach

    class Solution {
    public static class Pair,Y extends Comparable> implements Comparable>{
    X first;
    Y second;
    public Pair(X first, Y second){
    this.first = first;
    this.second = second;
    }
    public String toString(){
    return "( " + first+" , "+second+" )";
    }
    @Override
    public int compareTo(Pair o) {
    int t = first.compareTo(o.first);
    if(t == 0) return second.compareTo(o.second);
    return t;
    }
    }


    public static int orangesRotting(int[][] arr) {
    int n = arr.length;
    int m = arr[0].length;
    Queue, Integer>> pendingNodes = new LinkedList<>();
    for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
    if(arr[i][j] == 2){
    Pair idx = new Pair<>(i, j);
    Pair, Integer> p = new Pair<>(idx, 0);
    pendingNodes.add(p);
    }
    }
    }
    int ans = 0;
    while(!pendingNodes.isEmpty()){
    Pair, Integer> front = pendingNodes.poll();
    int i = front.first.first;
    int j = front.first.second;
    int level = front.second;
    ans = Math.max(level, ans);
    int del[][] = {{1,0},{-1,0},{0,1},{0,-1}};
    for(int xx[]: del){
    int new_i = i+xx[0];
    int new_j = j+xx[1];
    if(new_i < n && new_i >= 0 && new_j < m && new_j >= 0 && arr[new_i][new_j] == 1){
    arr[new_i][new_j] = 2;
    Pair idx = new Pair<>(new_i, new_j);
    Pair, Integer> p = new Pair<>(idx, level+1);
    pendingNodes.add(p);
    }
    }
    }
    for(int a[]:arr){
    for(int ele : a){
    if(ele == 1) return -1;
    }
    }
    return ans;
    }
    }

    Try solving now

    3. DSA Question

    Time Complexity of quick sort algorithm.

    Problem approach

    Case Time Complexity
    Best Case O(n*logn)
    Average Case O(n*logn)
    Worst Case O(n2)

    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
    131 views
    0 comments
    0 upvotes