Infosys Campus Recruitment Program 2021-22

Hello  Champions,

            Infosys hiring students from the 2022 batch for following roles, last year written test questions shared below

Role 1: 

Specialist Programmer  - 8 LPA

Role 2: 

Digital Specialist Engineer - 5 LPA

Written Test Dates:     07-08-2021 (VASAVI)

                                     08-08-2021 (CBIT)


                                            Test Format

       

No of questions

    3 (Easy, Medium, Hard)

Test Duration 

    3 hours

Sectional Cut-off

    Yes

Total Cut-off

    Yes

Allowed languages for coding

    C/C++/Java/Python/JavaScript

 

How to prepare ?

Easy

           Simple questions that can be solved by basic application of aptitude, algorithm and data structures 

Medium 

              Usually a question based on Greedy algorithm

           What is Greedy Alogirithm ? 

           An algorithm is designed to achieve optimum solution for a given problem. In greedy algorithm approach, decisions are made from the given solution  domain. As being greedy, the closest solution that seems to provide an optimum solution is chosen.

            for better understanding click on the following link

Hard 

              Usually a question based on Dynamic Programming

            What is Dynamic Programming ?

                Dynamic programming approach is similar to divide and conquer in breaking down the problem into smaller and yet smaller possible sub-problems. But unlike, divide and conquer, these sub-problems are not solved independently. Rather, results of these smaller sub-problems are remembered and used for similar or overlapping sub-problems.  

            for better understanding click on the following link

            Some examples of Dynamic Programming 
                • Knapsack problem 
                • Fibonacci Numbers 
                • Palindromic Subsequence 
                • Longest Common Substring 
                • Dijkstra's algorithm


Answers for Samples Of Infosys online tests

            click here for the answers of infosys sample online tests 

2020-21 Last Year Infosys written test quetions

Quetion 1 - Easy

Multiplication Grid

You are given a 2-D Multiplication Grid. The grid consists of N rows and N columns(1 - based indexing) Each cell of the grid stores a value of i*j where i is the row and j is the column numberof the cellyou are given a number X. Calculate the numberof times X Ocuurs in the grid

Function Description
Complete the multiplicationGrid function in the editor below. It has following parameter(s) 

 

Name

Type

Description

Parameters

N

INTEGER

The rows and columns of the grid

X

INTEGER

The given Integer

Return

The function must return an Integer denoting the number of times X occurs in the grid

   

Constraints

  • 1 <= N <= 10^5
  • 1 <= X <= 10^5

Input Format For Custom Testing 

The first line contains the Integer N, denoting the rows and columns of the grid
The next line contains an Integer X, denoting the given number

Sample Cases

Input

Output

Output Description

4

 

4

3



The grid is like

 

1 2 3 4

2 4 6 8

3 6 9 12

4 8 12 16


4 occurs 3 times


Question 2 - Medium

Maximize sum

Decompose an array of size N into contiguous subarrays of size A each
Choose exactly B out of N elements from the original array such that 
  1. every contiguous sub array has at-least one element in common with these choosen elements, and 
  2. sum of the chosen elements is maximum

Function Description

Complete the solve function in the editor below. It has the following parameter(s)

Parameters

Name

Type

Description

N

INTEGER

Size of array

A

INTEGER

Sub array size

B

INTEGER

No of elements to be selected

arr

INTEGER ARRAY

Array of length N

Return

The function must return an integer denoting the maximum sum possible


Constraints

  • 1 <= N <= 100
  • 1 <= A <= 100
  • 1 <= B <= 100
  • 1 <= arr [i] <= 10^6

Input format for custom testing

The first line contains an integer, N, denoting the number of elements in array.
The next line contains an integer, A, denoting the sub array size.
The next line contains an integer, B, denoting the number of elements to be selected.
Each line i of the N subsequent lines (where 0 <=i < N) contains an integer describing the i th element of the array

Sample Cases

 

Input

Output

Output description

6

4

6

80958

94240

44065

27316

71783

1438

319800

 

Select all elements


Question 3 - Hard

Car Trip

A car moving on a straight line of length n meters. The car has a fixed fuel tank capacity of K liters and it spends one liter for one kelometer

There are m fuel filling stations along the straight line. The i th station is located at postion a[i] and sells one liter of fuel for b[i] dollars. The car can buy as much fuel as it wants when it stopsnat any station.

The car starts at position 'o' moving in straight line direction to the end of the line and it can buy fuel from anystation it stops at 

You have to help the car choose which station to buy from inorder to reach the end of the line with the minimum fuel cost. Find the minimum cost 

If its impossible to reach print -1 in the console

Function Description

Parameters

Name

Type

Description

n

INTEGER

The length of the line

k

INTEGER

The capacity of the fuel tank

m

INTEGER

The number of fuel stations

a

INTEGER Array

The positions of the fuel stations

b

INTEGER Array

The prices of the fuel stations

return

The function must return an integer denoting the minimum possible price

You have to pay in order to reach the end of the line


Constraints

  • 1 <= n <= 10^5
  • 1 <= k <= 10^5
  • 1 <= m <= 10^5
  • 1 <= a[i] <= n
  • 1 <= b[i] <= 10^9

Input format for custom testing

The first line contains an integer, n, denoting the length of the line.

The next line contains an integer, k, denoting the capacity of the fuel tank

The next line contains an integer, m, denoting the number of fuel stations

Each line i of the m subsequent lines (where 0 <= i <= m) contains an integer describing a[i]

Each line i of the m subsequent lines (where 0 <= i <= m) contains an integer describing b[i]

 Sample Cases

Input

Output

Output description

10

10

2

0

1

5

2

23

We buy 1 liter from the first station for 5$ then we buy 9 liters from the second one for 18$ resulting in a total of 23$



Out of 3 problems
Executing one completely and other partially generated sufficient  to qualify for 5 lakhs role..

Hope this helps :) 
like wise we will upload all information and material for your placement preparation.

If you want any particular information about placements please feel free to comment.

Post a Comment

Previous Post Next Post