0
0
Data Structures Theoryknowledge~10 mins

Choosing data structures for interview problems in Data Structures Theory - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to choose the best data structure for fast lookup.

Data Structures Theory
best_structure = [1]
Drag options to blanks, or click blank then click option'
Ahash table
Blinked list
Carray
Dstack
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a linked list which requires linear search.
2fill in blank
medium

Complete the code to select a data structure that maintains order and allows fast insertion.

Data Structures Theory
chosen_structure = [1]
Drag options to blanks, or click blank then click option'
Alinked list
Bhash set
Carray
Dqueue
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing array which requires shifting elements on insertion.
3fill in blank
hard

Fix the error in choosing the data structure for last-in-first-out access.

Data Structures Theory
data_structure = [1]
Drag options to blanks, or click blank then click option'
Abinary tree
Bstack
Chash map
Dqueue
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing queue which is first-in-first-out (FIFO).
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters keys starting with 'a'.

Data Structures Theory
{k: v for k, v in data.items() if k.[1]('a') and v [2] 10}
Drag options to blanks, or click blank then click option'
Astartswith
B>
C<
Dendswith
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'endswith' instead of 'startswith'.
Using '<' instead of '>' for filtering values.
5fill in blank
hard

Fill all three blanks to create a set comprehension selecting even numbers greater than 5.

Data Structures Theory
{num for num in numbers if num [1] 5 and num [2] 2 == [3]
Drag options to blanks, or click blank then click option'
A>
B%
C0
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' for comparison.
Checking modulo equals 1 instead of 0.