InfyTQ Coding Questions Set 2 PDF
InfyTQ Coding Questions Set 2 PDF
Mukesh and friends have set out on a vacation to Coorg. They have booked
accommodation in a resort and the resort authorities organize Campfires every
night as a part of their daily activities. Mukesh volunteered himself for an activity called the
“Adjacent Stick Game" where sticks of different lengths will be placed in a line and Mukesh
needs to remove a stick from each adjacent pair of sticks. He then has to form a bigger stick
by combining all the remaining sticks.
Mukesh needs to know the smallest length of the bigger stick so formed and needs your help
to compute the same. Given the number of sticks N and the lengths of each of the sticks,
write a program to find the smallest length of the bigger stick that is formed.
Input Format
First line of input contains an integer N denoting the number of sticks. Assume that the
maximum value for N as 50.
Assume that N is always even.
Next line of input contains an N integer denoting the length of each of the sticks.
Output Format
Output the smallest length of the bigger stick that is formed.
Refer to sample input and output for formatting specifications.
Sample Testcases
Testcase 1 Input Testcase 1 Output
4 5
4235
Input Format
Input consists of an integer that represents the person.
Second line of input contains the details
Output Format
output displays the information
Sample Testcases
Testcase 1 Input Testcase 1 Output
2 Client not found
shri
shri@mail.com
7346218
veena
veena@gmail.com
8639124
12354545
This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
3) Best Couple Event
"Shades" Television Channel organizes a fun-filled event named “Best Couple
2017", were in married couples would be invited and given many tasks and
activities. Based on some criteria decided by the jury, the best couple will be chosen.
N couples registered for the event and each couple was given a registration number(it may
repeat). One specific couple's registration Id got missed. The event coordinators wanted
your help in finding the missing Id.
Write a program which takes an array of registration numbers as input and outputs the
missing registration Id.
Input Format
First line of the input contains the number of couples N who registered for the event.
Assume that the maximum value for N as 50.
Second line of input contains N registration Id of each of the couple, separated by a space.
Output Format
Output in a single line the missing registration Id.
Refer to sample input and output for formatting specifications.
Sample Testcases
Testcase 1 Input Testcase 1 Output
5 3
11223
Input Format
First line contains a number of elements N in an array [>
Second line contains N elements separated by spaces
Output Format
First line of output displays numbers representing Star elements separated by
spaces
Second line of output displays numbers representing Super Star elements
separated by spaces
Sample Testcases
Testcase 1 input Testcase 1 Output
6 721
346721 7
This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
12) Given a number N, print the odd digits in the number(space separated) or
print -1 if there is no odd digit in the given number.
Input Size : N <= 100000.
Input Format
Input consists of an integer.
Output Format
Output displays the odd digits if there are any, If not it displays -1.
Sample Testcases
Testcase 1 Input Testcase 1 Output
2143 13
This video is sole property of Talent Battle Pvt. Ltd. Strict penal action will be taken against unauthorized piracy of this video
15) Pk finds it difficult to judge the minimum element in the list of elements given to him.
Your task is to develop the algorithm in order to find the minimum element.
Note: Don't use sorting
Input Format
You are given ‘n’ number of elements. The next line contains n space-separated numbers.
Output Format
Print the minimum element
Sample Testcases
Testcase 1 Input Testcase 1 Output
5 1
34916