0% found this document useful (0 votes)
4 views2 pages

Java Collection Programming Questions

The document lists various Java collection programming questions categorized into List-Based, Set-Based, Map-Based, Comparator/Comparable, and Queue/Stack/Deque questions. It includes tasks such as removing duplicates, sorting, frequency counting, and implementing data structures. Additionally, it presents bonus challenges that involve conversions between collections and finding specific elements.

Uploaded by

Sonu Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Java Collection Programming Questions

The document lists various Java collection programming questions categorized into List-Based, Set-Based, Map-Based, Comparator/Comparable, and Queue/Stack/Deque questions. It includes tasks such as removing duplicates, sorting, frequency counting, and implementing data structures. Additionally, it presents bonus challenges that involve conversions between collections and finding specific elements.

Uploaded by

Sonu Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Java Collection Programming Questions

List-Based Questions

1. Remove duplicates from an ArrayList


2. Reverse an ArrayList without using reverse()
3. Find frequency of each element in a list
4. Sort an ArrayList of strings alphabetically
5. Sort a list of custom objects (e.g. Employee by salary)

Set-Based Questions

6. Check if two sets have any common elements


7. Remove duplicate characters from a string using Set
8. Find union and intersection of two sets

Map-Based Questions

9. Count frequency of characters in a string using HashMap


10. Find the first non-repeating character using LinkedHashMap
11. Group words by their first letter using Map
12. Sort a HashMap by values
13. Find the word with the highest frequency in a sentence

Comparator/Comparable Questions

14. Sort a list of students by name using Comparable


15. Sort by marks descending using Comparator
16. Sort by multiple fields (name, then marks)

Queue/Stack/Deque Questions

17. Use Queue to implement a basic task scheduler


18. Check for balanced parentheses using Stack
19. Reverse a queue using stack
20. Implement LRU cache using LinkedHashMap

Bonus Challenges

21. Find duplicates in a list without using Set


22. Find the second highest number in a list
23. Convert Map to List and vice versa
24. Convert List to Set and vice versa
25. Get all keys/values from a Map and print them

You might also like