TCS
Company
Category
A call center agent has a list of 305 phone nos of people in alphabetic order of names (but she does not have any of the names). she needs to quickly contacts deepak sharma to convey a message to him.If each call takes 2 minutes to complete, and every call is answered, what is the minimum amount of time in which she can guarantee to deliver the message to Mr.Sharma.
Read Solution (Total 17)
-
- 305/2=152
152/2=71
71/2=35
35/2=17
17/2=8
8/2=4
4/2=2
2/2=0
we get 0 after 9 times.
ans=9*2=18 - 10 years agoHelpfull: Yes(64) No(36)
- t is actually based on Binary search. Since, the numbers are in alphabetical order of names, she can call the last number and ask his name. Based on the response, she picks up 305/2 = 152 nd number. Then, 152/2 = 76 th number, then 76/2 = 38th number, 38/2 = 19 th number, 19/2 = 9th number, 9/2 = 4th number, 4/2 = 2nd number, 2/2 = 1st number. So, she has to make minimum 9 calls. Each call duration is 2 minutes. So, she takes 18 minutes.
- 9 years agoHelpfull: Yes(43) No(4)
- As the list are in alphabetical order,so she can perform binary search.
The number of binary search she has to performed to ensure that the Mr.Sharma=log(305)=9.
It is a guarantee the 9th person surely will be Mr.Sharma.
So,after 16 minutes she can guarantee to deliver the message to Mr.Sharma - 10 years agoHelpfull: Yes(16) No(22)
- 2min. if the first name is deepak sharma
it is given that the nos. are in alphabetical order of names but it is not mentioned that whether the names will start with 'A', 'B', 'C' or any other alphabet. - 10 years agoHelpfull: Yes(10) No(35)
- 305 > 256,ie: 2^8.
So, 9 ways 9*2=18min - 10 years agoHelpfull: Yes(9) No(1)
- 305÷2=153
153÷2=77
77÷2=39
39÷2=19
19÷2=10
10÷2=5
5÷2=3
3÷2=1
so 8 times 2 minutes =16 minutes - 10 years agoHelpfull: Yes(5) No(20)
- binary search
log(352)=9 - 10 years agoHelpfull: Yes(5) No(2)
- As question asked for minimum time and guarantee its not 610 minutes because it is guarantee but not minimum time
so
if we search for D in 350 contacts search by binary search logic
350/2.
.
.
,
we will arrive at 0 after 9 times so answer is 9*2=18minutes
- 9 years agoHelpfull: Yes(5) No(3)
- In the case of guarantee, we can assume that deepak sharma is the last contact, so it will take 304*2=608 minutes to call deepak sharma
- 10 years agoHelpfull: Yes(2) No(5)
- worst condition is, deepak lies at last then it will take 610 (305*2)min
so minimum time is 610 min
- 10 years agoHelpfull: Yes(1) No(7)
- As in the question it is specified "Gauranteed"
we have to get a solution for all kind of problems.
not just the case when the first one is Mr.Sharma.
so Binary search method is apt for this problem. - 10 years agoHelpfull: Yes(1) No(0)
- as the author mentioned minimum amount of time if mr.sharma is the 1st person
the time is 2min... - 10 years agoHelpfull: Yes(1) No(2)
- let us assume that there are equal no of people of every alphabet therefore,one letter will take 305/26 people that means "d" will lie on 48 no 1st she will call the 51 name as sequence will be de and ask the name of the customer so that she could find out how close she is it will take at most 5 calls to her i.e. 10 minute at maximum and she will guarantee the customer
- 10 years agoHelpfull: Yes(0) No(1)
- can any one say what is the position of mr sharma, it may be in first , middle or at last bcz in Qus nothing is clearify so, minimum amount of time in which she can guarantee to deliver the message to mr sharma is 305*2= 610min ans
- 10 years agoHelpfull: Yes(0) No(4)
- implementing binary search will give its solution ..because a binary search gives the best solution for a sorted array and its complexity is log n..
now the value of phone book is given 305 ..so just calculate the value of log(605) that will yield 9 - 10 years agoHelpfull: Yes(0) No(1)
- sorry saket u r right
- 10 years agoHelpfull: Yes(0) No(4)
- Since a=b
Ans is 18 - 8 years agoHelpfull: Yes(0) No(2)
TCS Other Question