Amazon — Interview Questions
Aptitude · Reasoning · English · CS — Corporate & Campus Interview Prep
50 Questions 10 Topics Take Test
Advertisement
Showing 31–40 of 50 questions
Q.31 Hard Amazon
Which of the following is a characteristic of a good hash function?
A Deterministic behavior
B Uniform distribution
C Collision resistance
D All of the above
Correct Answer:  D. All of the above
Explanation:

Good hash functions are deterministic (same input gives same output), uniformly distribute values, and minimize collisions.

Take Test
Q.32 Easy Amazon
In the context of REST APIs, what does POST primarily do?
A Retrieve data
B Create new resources
C Update existing resources
D Delete resources
Correct Answer:  B. Create new resources
Explanation:

POST method is used to create new resources on the server. GET retrieves, PUT/PATCH updates, DELETE removes.

Take Test
Q.33 Medium Amazon
What is the main advantage of using microservices architecture?
A Easier to develop and test
B Better scalability and flexibility
C Reduced operational complexity
D All of the above
Correct Answer:  B. Better scalability and flexibility
Explanation:

Microservices allow independent scaling, deployment, and technology choices. However, they can increase operational complexity.

Take Test
Q.34 Easy Amazon
Which design pattern is used when you want to ensure a class has only one instance?
A Factory Pattern
B Singleton Pattern
C Builder Pattern
D Observer Pattern
Correct Answer:  B. Singleton Pattern
Explanation:

Singleton Pattern restricts a class to have only one instance and provides a global access point to it.

Take Test
Q.35 Medium Amazon
What will be the output?

List list = new ArrayList();
list.add(1);
list.add(2);
list.add(3);
list.remove(1);
System.out.println(list);
A [1, 3]
B [1, 2, 3]
C [2, 3]
D [1, 2]
Correct Answer:  A. [1, 3]
Explanation:

list.remove(1) removes the element at index 1 (which is 2), leaving [1, 3].

Take Test
Advertisement
Q.36 Medium Amazon
What is the difference between ArrayList and LinkedList in Java?
A ArrayList is faster for random access
B LinkedList is faster for insertions/deletions in middle
C Both are correct
D No difference
Correct Answer:  C. Both are correct
Explanation:

ArrayList has O(1) random access but O(n) insertion/deletion. LinkedList has O(n) access but O(1) insertion/deletion.

Take Test
Q.37 Easy Amazon
Which of the following is NOT a principle of object-oriented programming?
A Inheritance
B Encapsulation
C Polymorphism
D Materialization
Correct Answer:  D. Materialization
Explanation:

The four OOP principles are Inheritance, Encapsulation, Polymorphism, and Abstraction. 'Materialization' is not an OOP principle.

Take Test
Q.38 Easy Amazon
What is the purpose of the 'try-catch' block in Java?
A To improve code performance
B To handle exceptions gracefully
C To declare variables
D To create loops
Correct Answer:  B. To handle exceptions gracefully
Explanation:

try-catch blocks allow you to handle exceptions without crashing the program, providing graceful error handling.

Take Test
Q.39 Hard Amazon
If a HashMap has 1000 entries and the load factor is 0.75, at what capacity will it resize?
A 750
B 1000
C 1333
D Cannot be determined
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

Take Test
Q.40 Medium Amazon
What is the time complexity of accessing an element in a balanced Binary Search Tree?
A O(1)
B O(log n)
C O(n)
D O(n²)
Correct Answer:  B. O(log n)
Explanation:

In a balanced BST, the height is log n, so searching takes O(log n) time.

Take Test
IGET
iget AI
Online · Ask anything about exams
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips