Software Engineer II Interview Questions in San Jose, CA | Glassdoor

Software Engineer II Interview Questions in San Jose, CA

105

Software engineer ii interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

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 Answers

Represent 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)

Basic puzzles like i) given two buckets of 4 and 7 liters.. how can you get 5 liters. ii) some sorting and searching algo questions

2 Answers

how much I wanted to make

1 Answer

how do you evaluate yourself?

1 Answer

How would you find size of structure without using sizeof operator?

2 Answers

Is there a situation in your career with your colleagues that you would like to fix (if given the chance)? What is your greatest achievement? Some think big questions. How would you solve the Netflix challenge?

1 Answer

Conversation did not involve any technical questions.

1 Answer

Why doesn't eBay use EJBs, Hibernate, Spring, Transactions?

2 Answers

Write an algorithm to find out the price for a keyword of an item based on the values present in the existing tables. He gave me 2 tables and some columns with item details. Keywords to search for those items etc.. The keywords can have multiple words. For example if you have existing high volume keywords in the the table like iPOD with a certain price then how much price should be the phrase "iPOD Touch 8gb" (a potential low volume keyword).

1 Answer

How would you use various backing data structures you could use when implementing a deque in C++? (ie, array, linked list implementations, etc.)

2 Answers