
hashmap
Authored by Amina Amina
Information Technology (IT)
University
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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)
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
11 questions
Структурированный тип данных массив
Quiz
•
10th Grade - University
10 questions
Chapter Quiz
Quiz
•
University
10 questions
Quiz 1 Normalisasi B
Quiz
•
University
12 questions
CLC Lesson 6 Quiz
Quiz
•
University
15 questions
Python Loop
Quiz
•
University
10 questions
Mesin Konseptual Mr ALGO
Quiz
•
10th Grade - University
12 questions
Konteynerlar (C++)
Quiz
•
University
12 questions
[Quiz] Python Function
Quiz
•
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
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
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
15 questions
Review1
Quiz
•
University
15 questions
Pre1
Quiz
•
University