From the course: Nail Your Java Interview
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Mastering hash-based structures - Java Tutorial
From the course: Nail Your Java Interview
Mastering hash-based structures
- Hash-based structures are the most commonly used data structures in technical interviews. There are a few Hash-based structures in Java including Hashtables, HashSets, and HashMaps. But they're very similar when it comes to their core functionality. There are differences lie in synchronization, usages of Knoll and whether or not duplicate values are allowed. But diving into those differences is out of the scope for this course. Generally, you should use a HashMap for your interviews because it provides the most flexibility by allowing duplicate values and an old key. A HashMap is also not synchronized, which means it has better performance than the synchronized Hashtable, but it's not thread safe. So let's talk about HashMaps. A Hash map consists of key-value pairs and uses a hash function to store and organize its data. A hashing function takes a group of characters called a key and maps them to a hash or a hash…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Leveraging stacks as a data structure4m 36s
-
Using queues in technical interviews4m 5s
-
Mastering hash-based structures4m 51s
-
Challenge: Generate binary numbers1m 19s
-
Solution: Generate binary numbers6m 35s
-
Challenge: Matching parentheses1m 5s
-
Solution: Matching parentheses3m 51s
-
Challenge: Find most repeated word2m 16s
-
Solution: Find most repeated word3m 28s
-
-
-