software engineer ii interview questions shared by candidates
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).
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)
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).
See Interview Questions for Similar Jobs
- Software Engineer
- Senior Software Engineer
- Software Engineer III
- Software Developer
- Software Development Engineer
- Software Engineer I
- Software Development Engineer II
- Staff Software Engineer
- Software Engineer Intern
- Senior Software Development Engineer
- Principal Software Engineer
- Software Engineer IV
- Data Scientist
- Product Manager
- Senior Software Developer
- Software Development Engineer I
- Systems Engineer