46 questions for “Collections Framework”

Found in 1 field. Select a question to see its full answer.

Information Technology

46 questions in 2 technologies

#QuestionTechnologyTopicLevel
1What is the Java Collections Framework, and what are the core interfaces (List, Set, Map, Queue) at its foundation? Java › Collections FrameworkJavaCollections FrameworkBeginner
2What is the difference between fail-fast and fail-safe iterators in the Collections Framework, and which collections use each? Java › Collections FrameworkJavaCollections FrameworkIntermediate
3How does the Collections Framework's fail-fast modCount mechanism actually work internally, and why is it described as "best-effort" rather than a strict guarantee? Java › Collections FrameworkJavaCollections FrameworkAdvanced
4What are the immutable collection factory methods (List.of(), Set.of(), Map.of()) introduced in Java 9, and how do they differ from Collections.unmodifiableList()? Java › Collections FrameworkJavaCollections FrameworkIntermediate
5What is the purpose of the Collections utility class's synchronization wrappers (Collections.synchronizedList(), etc.), and how do they differ from genuinely concurrent collections like ConcurrentHashMap? Java › Collections FrameworkJavaCollections FrameworkIntermediate
6What is the difference between the Iterable and Iterator interfaces, and how does the enhanced for-each loop rely on them? Java › Collections FrameworkJavaCollections FrameworkBeginner
7What are the key performance differences between ArrayList and LinkedList for common operations (random access, insertion/removal at various positions), and when would you choose one over the other? Java › Collections FrameworkJavaCollections FrameworkIntermediate
8What is the contract between equals() and hashCode() that a custom class must satisfy to work correctly as a HashMap key or HashSet element? Java › Collections FrameworkJavaCollections FrameworkIntermediate
9What is the purpose of the Deque interface, and how does it unify both stack (LIFO) and queue (FIFO) behavior in a single interface? Java › Collections FrameworkJavaCollections FrameworkIntermediate
10How does PriorityQueue work internally (as a binary heap), and what ordering does it use by default versus with a custom Comparator? Java › Collections FrameworkJavaCollections FrameworkIntermediate