Amazon.com

  www.amazon.com
Work in HR? Unlock Free Profile

Amazon.com Software Development Engineer Intern Interview Question

I interviewed in Syracuse, NY and was asked:
"Second Round: This was a bit difficult. The question is to generate sample math problems(additions) for a 8th grade student and the results should be stored in such a way that they can be printed when required. Sample problem is 7+8=_____ The constraints are:- 1) The numbers that are to be added should be <=9 2) The result should be <=17"
Add Tags [?]
Answer

Part of a Software Development Engineer Intern Interview Review - one of 4,681 Amazon.com Interview Reviews

Answers & Comments

0
of 0
votes

this actually fairly simple, for the second constraint its x+y <=17, then all you need to do is have a random generator that finds some x solve for y (i.e. y<=17-x, that way you dont have to use the random generator twice and then have run it multiple times to make sure the result is valid) then a simple if statement to test whether user input is correct

- Marc Fuller on Jan 27, 2014
0
of 0
votes

one more thing to get every result less than 17 , you would have to another if statement that uses 2 randomly generatored numbers if x+y <=17 isnt true do what i mentioned earlier

- Marc Fuller on Jan 27, 2014

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.