Amazon — Interview Questions
Aptitude · Reasoning · English · CS — Corporate & Campus Interview Prep
Showing 1–5 of 5 questions
Q.1
Hard
Amazon
Statement: All managers are leaders. Some employees are managers. Conclusion: All employees are leaders.
Correct Answer:
C. Cannot be determined
Explanation:
Some employees are managers, but not all. So we cannot conclude that all employees are leaders.
Q.2
Hard
Amazon
What will be the output of the following code?
int x = 5;
int y = ++x + x++;
System.out.println(y);
int x = 5;
int y = ++x + x++;
System.out.println(y);
Correct Answer:
B. 12
Explanation:
++x makes x=6 (pre-increment). Then x++ uses 6 and increments to 7. So y = 6 + 6 = 12.
Q.3
Hard
Amazon
Which of the following is a characteristic of a good hash function?
Correct Answer:
D. All of the above
Explanation:
Good hash functions are deterministic (same input gives same output), uniformly distribute values, and minimize collisions.
Q.4
Hard
Amazon
If a HashMap has 1000 entries and the load factor is 0.75, at what capacity will it resize?
Correct Answer:
C. 1333
Explanation:
Resize occurs when entries exceed capacity × load factor. If 1000 entries at 0.75 load factor, capacity = 1000/0.75 = 1333
Q.5
Hard
Amazon
A system processes 1000 requests per second. If 8% of requests fail and need retry, and each retry takes 2 seconds, approximately how many total seconds are needed to process 10,000 requests including retries (assuming sequential processing)?
Correct Answer:
B. 11.6 seconds
Explanation:
10,000 requests at 1000/sec = 10 seconds. Failed requests = 10,000 × 0.08 = 800. Retry time = 800 × 2/1000 = 1.6 seconds. Total ≈ 10 + 1.6 = 11.6 seconds.