Showing 571–580 of 654 questions
What does the idiom 'break the ice' mean?
A
To literally break ice
B
To initiate conversation in a social setting
C
To make something cold
D
To surprise someone
Correct Answer:
B. To initiate conversation in a social setting
Explanation:
'Break the ice' idiomatically means to initiate conversation or ease tension in a social situation.
Which of the following is NOT a programming paradigm?
A
Object-Oriented Programming
B
Functional Programming
C
Linear Programming
D
Procedural Programming
Correct Answer:
C. Linear Programming
Explanation:
Linear Programming is an optimization technique, not a programming paradigm. The others are paradigms used in software development.
Which data structure is best for implementing a queue?
A
Stack
B
Linked List
C
Array (static)
D
Hash Table
Correct Answer:
B. Linked List
Explanation:
Linked List is ideal for queue implementation as it provides O(1) insertion and deletion at both ends.
What will be the output of the following code?
int x = 5;
int y = ++x + x++;
System.out.println(y);
Explanation:
++x makes x=6 (pre-increment). Then x++ uses 6 and increments to 7. So y = 6 + 6 = 12.
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.
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
Explanation:
== compares memory references. Both s1 and s2 are different objects, so it prints false. Use .equals() for value comparison.
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.
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.
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.
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.