Coding challenges
In the following 17 coding challenges, we will cover a number of problems involving maps and linked lists. Since linked lists are a more popular topic in technical interviews, we will allocate a higher number of problems to them. However, to master the concept of map data structures, especially built-in Java map implementations, I strongly recommend that you buy the book Java Coding Problems, which is also published by Packt Publishing (https://www.packtpub.com/programming/java-coding-problems). Besides being an awesome companion to this book, Java Coding Problems contains the following problems with maps (note that this is not a complete list):
- Creating unmodifiable/immutable collections
- Mapping a default value
- Computing whether a value is absent/present in a
Map
- Removal from a
Map
- Replacing entries from a
Map
- Comparing two maps
- Sorting a
Map
- Copying a
HashMap
- Merging two maps
- Removing all the elements of a collection...