Arrays & Collections MCQs

Topic-wise practice questions for Programming (C++ / Java / Python). Test your knowledge, check solutions on demand, and pace your preparation.

Zero-leak answer engine • Rate-limited explanations
Practice in Timed Mode
Q11easy
What is the difference between a Capacity and Size in a dynamic array like ArrayList?
Q12medium
You are building an "Undo" feature for a text editor. Every time the user types, the change is saved. When they press "Undo," the most recent change is reversed. Which collection is most appropriate?
Q13medium
A developer is iterating through a List and removing items that meet a condition:

for (Item x : myList) {
    if (x.isExpired()) myList.remove(x);
}
What is the likely outcome in Java or C#?
Q14medium
You are managing a printer queue where the first document sent must be the first one printed. Which data structure is best?
Q15easy
What is a major performance disadvantage of a Linked List compared to an Array?
Q16medium
You need to implement a "Priority Task List" where the task with the highest importance is always finished first, regardless of when it was added. Which structure is best?
Q17easy
What happens when a Hash Collision occurs in a HashMap?
Q18hard
What is the Time Complexity of looking up a value by its Key in a HashMap (on average)?
Q19medium
Why is accessing an element in a standard Array by its index considered a Constant Time O(1) operation?