
hashmap

Quiz
•
Information Technology (IT)
•
University
•
Hard
Amina Amina
Used 4+ times
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a HashMap?
A data structure for storing ordered key-value pairs
A data structure for storing unordered key-value pairs that uses a hash function for fast access.
A data structure that uses trees to store values
A data structure for storing homogeneous elements.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you create an empty HashMap?
hash_map = {}
hash_map = []
hash_map = set()
hash_map = dict()
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you insert a key-value pair into a HashMap?
hash_map.add("apple", 5)
hash_map.put("apple", 5)
hash_map["apple"] = 5
hash_map.insert("apple", 5)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you check if a key exists in a HashMap?
key.exists("apple")
hash_map.contains("apple")
hash_map.has_key("apple")
"apple" in hash_map
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if you try to retrieve a value for a non-existing key in a HashMap?
A KeyError will be raised
It returns None
It returns a default value if specified
It returns an empty value (e.g., "" or 0).
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you remove a key-value pair from a HashMap?
hash_map.remove("apple")
hash_map.del("apple")
- del hash_map["apple"]
hash_map.delete("apple")
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you update the value for an existing key in a HashMap?
hash_map["apple"] = new_value
hash_map.update("apple", new_value)
hash_map.set("apple", new_value)
hash_map.insert("apple", new_value)
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
CMC Career Fair 2025 - Q1

Quiz
•
University
15 questions
Implement password hash synchronization Entra DS

Quiz
•
University
10 questions
NoSQL Concepts

Quiz
•
University
15 questions
Fundamentos Essenciais da Ciberseguranca - SEC7 | S1

Quiz
•
University
9 questions
Asistensi Praktikum SBD Week #7

Quiz
•
University
10 questions
Repaso Marketing Digital

Quiz
•
University
10 questions
Round 3

Quiz
•
University
12 questions
Mastering Java Collections Framework

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University