Placement Papers - Infosys

Infosys Interview Experience - Ahmadabad, 19-June 2019
Posted by :
Soni Abhishek R
(94)
I participated in the Infosys (InfoTQ) exam. Paper was consist of a total of 20 MCQ(Related to Python Basic, DBMS Query, Data Structure, OOPS) and 2 Problem Statement (in Python). Passing criteria of the exam were 65% and they had given 3 hours to complete both sections.
Problem Statement:
1) Create series based on given Array and find the longest series among the given series after finding the minimum no in longest series, if there are 2 series which have the same length then find minimum no between them even if there is a tie between series then find next smallest number.
Ex : (1,2,3), (3,5,7,8), (6,6,4,3,7), (6,8,5,4)
Ans: Case 1: 3 series is longest and the minimum element is 3.
Case 2: add this series (7,4,5,2,5)
both series have the same length (6,6,4,3,7), (7,4,5,2,5) so, minimum no is 2.
Case 3: add this series (7,4,5,3,5)
both series have the same length (6,6,4,3,7), (7,4,5,3,5) so, minimum no is 5.
2) Generate Password from the given data.
Take input from user in the given format (consist of name and Code), find max digit from Code which is less or equal to the length of String and put that place Char in final String if there is no any digit found which not satisfy the condition that simply put \'X\'.
# input : "Abhishek":34848,"Mayur":4739,"Friends":2949,"Yeah":9889
^ ^ ^ ^
Output : kueX
# Password generator
names = input()
names = names.split(",")
length = 0
final_str = ""
temp = []
max = 0
for name in names:
temp = name.split(":")
length = len(temp[0])-2
for i in (temp[1]):
i = int(i)
if i <= length:
if max < i:
max = i
if max == 0:
final_str += "X"
pass
final_str += temp[0][max]
max = 0
print("\nPassword : " + final_str)
# input : "Abhishek":34848,"Mayur":4739,"Friends":2949,"Yeah":9889.
Problem Statement:
1) Create series based on given Array and find the longest series among the given series after finding the minimum no in longest series, if there are 2 series which have the same length then find minimum no between them even if there is a tie between series then find next smallest number.
Ex : (1,2,3), (3,5,7,8), (6,6,4,3,7), (6,8,5,4)
Ans: Case 1: 3 series is longest and the minimum element is 3.
Case 2: add this series (7,4,5,2,5)
both series have the same length (6,6,4,3,7), (7,4,5,2,5) so, minimum no is 2.
Case 3: add this series (7,4,5,3,5)
both series have the same length (6,6,4,3,7), (7,4,5,3,5) so, minimum no is 5.
2) Generate Password from the given data.
Take input from user in the given format (consist of name and Code), find max digit from Code which is less or equal to the length of String and put that place Char in final String if there is no any digit found which not satisfy the condition that simply put \'X\'.
# input : "Abhishek":34848,"Mayur":4739,"Friends":2949,"Yeah":9889
^ ^ ^ ^
Output : kueX
# Password generator
names = input()
names = names.split(",")
length = 0
final_str = ""
temp = []
max = 0
for name in names:
temp = name.split(":")
length = len(temp[0])-2
for i in (temp[1]):
i = int(i)
if i <= length:
if max < i:
max = i
if max == 0:
final_str += "X"
pass
final_str += temp[0][max]
max = 0
print("\nPassword : " + final_str)
# input : "Abhishek":34848,"Mayur":4739,"Friends":2949,"Yeah":9889.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers