Random Interview Questions | Glassdoor

# Random Interview Questions

20

interview questions shared by candidates

## Random Interview Questions

Sort: RelevancePopular Date

### Software Engineer II at eBay was asked...

Mar 28, 2011
 You are given a predefined function which generates random number from 1 to 5. You need to use this function and create another function which will generate random number from 1 to 7. Now most important thing is to remember that new random function should be even (i.e. the number generated should be unpredictable, and evenly spaced out).4 AnswersRepresent 7 in binary (111). For each place, set either 0 or 1 depending on your random number generator -- roll between 1-5, reroll if you get 5, otherwise set the bit to 0 if the roll is 1 or 2, and 1 if the roll is 3 or 4. Full function: int random7() { for (int i=0; i < 3; i++) { int answer = 0; int roll = 5; while (roll == 5) { roll = drand48()*5+1; } if (roll < 3) answer |= 1 << i; } return roll; }If the function returns float or double: - Simply multiply the answer by 7/5. If the function returns integers: - Call the rand5 function 7 times, sum the results, calculate mod7 of the sum and finally add 1.Let f() be the random function that returns a number between (1,5). Let g() = f() -1; then g is a function that returns a number between (0,4). Let h() = g()/4; then h is a function that returns a number between (0,1). Let i() = h()*6; then i is a function that returns a number between (0,6) Let j() = i() + 1; then j is a function that returns a number between (1,7). important to note that simply multiplying by 7/5 is NOT correct. If you do that you can never get 1 out of your random number . the numbers you will obtain in that case will be uniformly distributed between (7/5 and 7) not between (1,7)Show More ResponsesThe answers where great but still not evenly distributed. There are chances to get even number more number of times then odd numbers and in some solution few numbers are never generated in random. I think the solution would be to the following steps 1) Combine the two possible number generated by random function with all possible combinations(i.e. 11,12,13,14,15,21,22.... 52,53,54,55). 2) With this we have total of 25 possible numbers. Now group all numbers in 7 groups, i.e. three numbers in one group and last group with 4 numbers {11,12,13} - group 1 ....... {44,45,51} group 7 {total numbers grouped till now is 21} and {52,53,54,55} - group 8. 3) call the random1to5() twice. 4) join two randomly generated number (e.g would be 11, 15, 55 etc) 5) Check in which group number lies, the group number will be the final random number. If the number lies in group 8 then ignore the number and re-run from step 3. I think this is evenly distributed and no chance of any number been superseded or more number of occurrence as compared to other number.

### Customer Service Representative at Enterprise was asked...

Jan 28, 2012
 How do I know that you wouldn't accept a position from a totally different company if you were called upon by a recruiter, and offered \$10k or \$20k more per year?3 AnswersI can't answer honestly without saying that I would have to consider the situation on its merits and growth potential - because in such an instance, no matter what anyone may tell you, *I* (or my family & I) come first.Although a higher income is a great benefit, when it comes to finding & establishing meaningful work, income isn't the biggest motivator. More money doesn't necessarily always mean more fulfilling work.That answer is probably why you didn't get the job, never say your family comes first at a job interview even though obviously they would. Never allow them to think that you would leave for a better opportunity even though you would. The second persons answer was perfect.

### Support-Global Solutions at LexisNexis Risk Solutions was asked...

Mar 6, 2012
 How would you go about counting the blades of grass on a football field?1 AnswerSection off the field in manageable blocks, estimate how many blades would be in one box then estimate how many boxes in field, accounting for abberations like spots where the grass had been run down.

Dec 2, 2012
 "Team Edward or Team Jacob?"1 Answer"Um...neither? Team Bella?"

### Operations Manager at Archeworks was asked...

Jul 15, 2011
 What skills do you have that may not be on your resume?1 AnswerThey were looking for AV/audio stuff, or anything that would help around the office for little things that they wouldn't have to higher someone out of the office to do.

### Merchandise Allocation Analyst at Charming Charlie was asked...

Jul 26, 2013
 Define chaos.1 AnswerI gave a definition that would relate to chaos in the workplace, since that's clearly what she was asking about. And even addressed how I would fare in such chaos.

### Campaign Professional at ReachLocal was asked...

May 30, 2012
 What do you want to be when you grow up?1 AnswerIt was unexpected and off-the-wall, but gives a great perception of you as a person.

### Unarmed Private Security at Pacific Patrol Services was asked...

Jun 10, 2012
 You don't make eye contact very much, do you have problems with your father?1 AnswerThey will ask abrupt, sometimes invasive, questions to keep you on your toes. Give honest and level-headed answers and don't linger on the topic unless it's relevant or leads to something positive.

### Systems Engineer at FactSet was asked...

Feb 24, 2014
 Sell me something? 1 AnswerThat was the final response I received, this was completely unexpected as I thought I was interviewing for a technical positions not sales. Be prepared for this possibility.

### Product Analyst at Ipreo was asked...

Feb 23, 2012
 Describe to me what the position is that you're applying for.1 AnswerNot sure what the point is of this except to screw with you.
110 of 20 Interview Questions