Placement Papers
TCS, Infosys, Wipro, Cognizant actual papers
654 Questions 12 Topics Take Test
Advertisement
Showing 71–80 of 654 questions
Q.71 Easy Amazon Questions 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.72 Medium Amazon Questions 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.73 Medium Amazon Questions 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
Q.74 Easy Amazon Questions 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.75 Medium Amazon Questions 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.76 Easy Amazon Questions 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.77 Hard Amazon Questions 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.78 Medium Amazon Questions Amazon
What is the primary purpose of a hash function?
A To encrypt data
B To map input to a fixed-size output
C To compress data
D To sort data
Correct Answer:  B. To map input to a fixed-size output
EXPLANATION

A hash function takes input data and produces a fixed-size output (hash value), useful for hash tables and data indexing.

Take Test
Q.79 Medium Amazon Questions Amazon
What will be printed?

String s1 = new String('Amazon');
String s2 = new String('Amazon');
System.out.println(s1 == s2);
A true
B false
C null
D Error
Correct Answer:  B. false
EXPLANATION

== compares memory references. Both s1 and s2 are different objects, so it prints false. Use .equals() for value comparison.

Take Test
Q.80 Medium Amazon Questions Amazon
Which of the following sorting algorithms is most efficient for nearly sorted data?
A Bubble Sort
B Quick Sort
C Insertion Sort
D Merge Sort
Correct Answer:  C. Insertion Sort
EXPLANATION

Insertion Sort has O(n) time complexity for nearly sorted data, making it the most efficient choice.

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