Chennai interview questions | Glassdoor.co.uk

# Interview questions in Chennai

Cognizant Technology Solutions Interviews in Chennai

www.cognizant.com /  HQ: Teaneck, NJ

904 Interviews in Chennai (of 6,059)

2.6 Average

Tata Consultancy Services Interviews in Chennai

www.tcs.com /  HQ: Mumbai, IN

743 Interviews in Chennai (of 7,851)

2.7 Average

Infosys Interviews in Chennai

www.infosys.com /  HQ: Bengaluru, IN

531 Interviews in Chennai (of 7,475)

2.6 Easy

## Interview Questions in Chennai

Sort: RelevancePopular Date

7 Jun 2012

### Software DesignEngineer In Test (SDET) at Amazon was asked...

20 Feb 2011
 Given a number find it is one less than the power of two. 15 AnswersThe question could have been a little more detailed, most of the guys who took up the test could not understand this immediately.Given a number N, XOR it with N+1 = powers of 2 will give all 0s@Anonymous. That's not true. 3 in binary is 11 and 4 is 100, if you XOR 011 and 100 you will get 111, not 000. I think you meant to say that all numbers will be 1s.Show more responsesN xor (N+1) = 2*N + 1If the least bit is 1, then it is equal to N less than power of 2 if ( n << 7 ) cout << "It is one less than power of 2" For example 1 - 0000 0001 3 - 0000 0011 5 - 0000 0101 7- 0000 0111// the power of two is always has the first bit set to1 and rest all would be set to 0. And one less than power of 2 has all the bits set to 1 except the fist bit. for example 16 = 10000 and 15 = 01111 Now if you do bit operation & on 16 and 15, you get zero. Hence, below is the code. public boolean oneLessPowTwo(int num){ boolean b = false; if(n & n+1 == 0){ b = true; } return b; }the power of two is always has the first bit set to1 and rest all would be set to 0. And one less than power of 2 has all the bits set to 1 except the fist bit. for example 16 = 10000 and 15 = 01111 Now if you do bit operation & on 16 and 15, you get zero. Hence, below is the code. public boolean oneLessPowTwo(int num){ boolean b = false; if((num & (num+1)) == 0){ b = true; } return b; }A one line answer to this question is: -1 + 2 to the power of -2 - language binary string prefix + length of binary string for N In Python: 2**(len(bin(511))-3)-1 Simple one line in any language with a function to convert int to binary string.8 anwerJust another option of doing this Boolean checkNumber(int inputNum) { int temp = 2 ; while(temp < inputNum) { temp = temp * 2 ; } if(inputNum == temp-1) return True; else return False; }can any1 say it clarly..wt is dz 15+01111??can any 1 say it clearly?package amazonExcerise; import java.util.Arrays; import org.apache.jasper.tagplugins.jstl.core.ForEach; public class concatenationArrays { public static void main(String[] args) { int a[] = { 1, 3, 77, 78, 90 }; int b[] = { 2, 5, 79, 81 }; int c[] = new int[9]; int j = 0; for (int i = 0; i 4) { c[i] = b[j]; j++; } System.out.print(" " + c[i]); } Arrays.sort(c); System.out.println(""); System.out.println("Sorted Array"); for (int i : c) { System.out.print(" "+i); } j = 0; System.out.println(); System.out.println("Array A:"); j = 0; for (int i = 0; i = 5) { b[j] = c[i]; System.out.print(" "+b[j]); j++; } } } }Show more responsesFor a number n, if n <= 1 the question doesn't really make sense. You can approach custom essay writing services for getting more details for your academic works.Visit http://essayguardian.com/.N is the number so (1<

### Souschef at Hyatt was asked...

22 Jul 2012
 what is your expectation in next 5 years10 AnswersA Successful Person. with every dream fulfilled by self.I want ot get out from herei want success in my life.Show more responsesto be usefull to other people around the world.I hope to make a career,taking some hihg position in Hyatt companyto succesfull,,,and have own businessto be successful and have my desire position in Hyatt company.searching the perfect position in a reputed brand and willing to be permanant with youTo always Bring a satisfactory smile on our guests' face......with our services'....we'll get success and reputed post automatically .haha....It is 5years after you posted this question..ya there is a lots of changes..GST, NO MORE 1000rs...

### Software Development Engineer at Scantron was asked...

2 Feb 2012
 Puzzle: There are 25 horses and 5 lanes for conducting a race among them. In a minimum of how many races, would be able to find out the 3 fastest horses among them? Assumption: Speed of horses are consistent enough across races.6 AnswersAnswer: 76 because 5 races req to find 5 fastest and 1 race to determine the top 3 out of the 5 fastest7Show more responses65, just because its speed is consistent between races, so we need note down time taken by all the horses, for this 5 races needed ( 5 lanes and 25 horses ). From the list identify top 3, thats simple!1 race with of 3 horses

### Associate at Amazon was asked...

21 Jan 2014
 A bucket is kept under the tap and the tap is opened to let out water. Though water is flowing out, the bucket never seems to be full. why?7 AnswersBucket has not evenly placed .Bucket has not evenly placed .Bucket has a holeShow more responsesprobably the bucket must have kept upside downMay be Tap & bucket are not aligned such that water rushing out of the Tap doesn't seem to fall in to the bucket.Seems their is a hole in the Bucket.The bucket was kept upside down

### Quantitative Analyst at Goldman Sachs was asked...

26 Dec 2012
 What is the expected number of tosses required to achieve 2 heads in an unbiased coin?5 Answers6 tosses using Markov-techniquesI got 4 as the answer...Expected number of steps required to obtain N consecutive heads by tossing a fair coin is given by En = 2^(n+1) -2 For n = 2 ; E2 = 6 For further details see - http://www.qbyte.org/puzzles/p082s.htmlShow more responsesThe question does not state 2 "consecutive" heads.answer would be 6 if it was 2 consecutive heads, but for 2 heads it is 4.

### Assistant Systems Engineer at Tata Consultancy Services was asked...

20 Oct 2012
 What will you do when your girl friend is getting married on the same day as a important client meeting?7 Answersi will do marriage first because meeting may be postpond or prepaid but marriage date not come again again.right manright manShow more responsesyes, firstly i will do marriageYesMarriage firstAs per time should Attend marriage first after that meet my client

### Content Quality Associate at Amazon was asked...

1 Sep 2012
 Nothing out of the ordinary. Some simple questions on time management, but that is pretty much it4 AnswersLike I said, nothing in particular.Having QAE interview with amazon this week,Can you let me know the possible qauestions and rounds...Having QAE interview with amazon this week,Can you let me know the possible qauestions and rounds...Show more responsesHaving QAE interview with amazon this week,Can you let me know the possible qauestions and rounds...

### Software Engineer at ThoughtWorks was asked...

8 Jul 2012
 A box is divided into 4 boxes which is further subdivided into 4 boxes and so on. What is the best Data structure suitable for this scenario? 5 AnswersI gave an answer as tree bcos any tree can be converted to a Binary tree. But the interviewers where not satisfied with the solution.QuadtreeI think it should be Stack.There is recursion involved.Show more responsesthey might be looking for B Treetree is the correct answer. it is best suited for retriving also

### Software Development Engineer at Amazon was asked...

7 Apr 2012
 Given an integer array which consists of numbers from 1 to N with 1 number missing find the missing number. What will you do if 2 numbers are missing?4 AnswersGiven that the summation from 1 -> N = N(N+1)/2, we can use simple math to get a solution in O(n) time. We know that our array is "missing" a number, so it's length "L", is N-1. So we know that the summation for our array if it were not missing the value X could be calculated as N(N+1)/2, or (L+1)(L+2)/2. For a given array with length L, all we need to do is calculate what the expected summation is, iterate over the array and find the actual summation, then calculate the difference. public int findMissingValue(int[] sequence) { int length = sequence.length(); int expectedSum = ((length + 1) * (length + 2)) / 2; int actualSum = 0; for (int i = 0; i < length; i++) { actualSum += sequence[i]; } return expectedSum - actualSum; }You have an array of length N filled with numbers 1 through N+1 with one number missing. 1. bitwise xor all numbers 1 to N+1 2. bitwise xor all numbers in the array 3. bitwise xor the above two numbers to get the missing number, as duplicates will cancel out If two numbers are missing this approach and the sum approach fail. In this case I can't think of a faster way than sorting the list.For 2 number missing.. First split up the array into half from first half find the first missing number and second half find the second missing number. If 2 missing numbers are in first half then again divide the first half into 2 half and find it.Show more responsesUse a bitmap: keys are 1 to N and values are true/false. Iterate over the array and populate the bitmap. Iterate over the bitmap and the missing numbers are those that have the value == false.
110 of 18,936 Interview Questions