Java Interview Guide : 200+ Interview Questions and Answers - Collection Code Examples
Interactive Video
•
Information Technology (IT), Architecture, Physical Ed
•
University
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Read more
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when you add an element to an ArrayList without specifying an index?
The element is not added.
The element is added at the beginning of the list.
The element is added at the end of the list.
The element replaces the first element.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method would you use to check if an ArrayList contains a specific element?
indexOf
contains
get
add
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What must a class implement to be sorted using Collections.sort()?
Serializable
Comparator
Iterable
Comparable
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you sort a collection in descending order?
Use Collections.reverseOrder()
Use a custom Comparator
Use Collections.sort() with a flag
Use a custom Comparable
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a key characteristic of a HashSet?
It maintains elements in insertion order.
It does not allow duplicate elements.
It sorts elements in natural order.
It allows duplicate elements.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a TreeSet, how are elements stored?
In insertion order
In reverse order
In random order
In sorted order
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when you add a duplicate key to a HashMap?
The new value replaces the old value.
The key is ignored.
An error is thrown.
Both values are stored.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
8 questions
Mastering WidgetKit in SwiftUI 4, iOS 16 with Dynamic Island - Stocks App Introduction and Model
Interactive video
•
University
8 questions
Selenium WebDriver with Java - Basics to Advanced and Frameworks - Difference Between HashMap and HashTable (Interview)
Interactive video
•
University
8 questions
Data Structures and Algorithms The Complete Masterclass - Implementing Insertion Sort
Interactive video
•
University
8 questions
AWS Certified Solutions Architect Associate (SAA-C03) - Simple Queue Service (SQS)
Interactive video
•
University
8 questions
Python In Practice - 15 Projects to Master Python - List Built-In Functions
Interactive video
•
University
8 questions
Data Structures and Algorithms The Complete Masterclass - Implementing a Min Stack
Interactive video
•
University
8 questions
Build a Super Advanced Trading Bot on DYDX Hosted on AWS with Python - BotAgent Class - Initialize
Interactive video
•
University
8 questions
Complete Java SE 8 Developer Bootcamp - Queues
Interactive video
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Information Technology (IT)
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
5 questions
Helping Build the Internet: Valerie Thomas | Great Minds
Interactive video
•
11th Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
19 questions
Review2-TEACHER
Quiz
•
University
15 questions
Pre2_STUDENT
Quiz
•
University
20 questions
Ch. 7 Quadrilateral Quiz Review
Quiz
•
KG - University