Amazon Interview Question
Quality Assurance EngineersTeam: Amazon Local
Country: United States
Interview Type: Phone Interview
Correct, there is one "answer" to your question; however that is a developer answer. If you are a developer write that one unit test and lob the code over the wall. However if you are applying for a test position you can be certain that this is NOT the answer the interviewer is asking for. The question is that there is a scenario driving this:
1. Verify that the inputs include the numbers betwen 1 to 100
2. Verify that the inputs only has 100 values
3. Verify that there are no duplicates
4. Identify how this scenario is going to run? Heavy loaded system? How is the performance, how does it do under stress?
5. See how the code reacts when the set of numbers is not as expected
6. See how the code reacts when numbers are sent in that cause integer overflow
7. See how the code reacts when it is passed negative integers
8. See how the code reacts when duplicate numbers are passed in
Etc, etc, etc...
positive test csaes
I. verify whether enter numbers are between 1 to 100.
II. enter numbers between 1 and 10 , 10 and 20 , 30 and 40 , 40 and 50 , 60 and 70 , 70 and 80 , 80 and 90, 90 and 100 , verify the sum
negative test cases
I. enter alphabets and check whther its hows error
II. enter -ve numbers and verify whether it shows error
III. enter 0 or more than 100 and check whether it displays error or not
1. Positive case : Enter 1 to 100 for acceptance scenario
2. null values
3. Duplicate values
4. Less than 100 values
5. negative values (but from 1 to 100)
6. Negative test cases - Alphabets, special characters, ASCII codes etc
7. Entering integers through ASCII codes
8. No value at all
9. All null values
10. Mix of negative + positive integers (but between 1 to 100)
There's only one answer for the sum of integers from 1 to 100. One test case. The answer's 5050.
- eugene.yarovoi January 08, 2012