Start learning →

Coding Interview Prep Data Structures and Algorithms — practice questions

Explore 30 free Data Structures and Algorithms questions in Coding Interview Prep Computer Science. Open each question or exercise to read its content, reference answers and available explanation.

Practise Data Structures and Algorithms with Quill →

Data Structures and Algorithms questions and exercises with answers

Showing questions 1–30 of 30.

Array lists and linked lists both arrange elements one after another, so they are:Read the answer and worked solution →An interviewer asks why an array list is fast to read at any index. The reason is it allows:Read the answer and worked solution →A linked list can only be walked from the front, which means it supports:Read the answer and worked solution →Compared with array lists, linked lists are better at:Read the answer and worked solution →A data structure whose nodes each have zero or more child nodes is a:Read the answer and worked solution →In a binary search tree, every value in a node's left subtree is:Read the answer and worked solution →In a binary search tree, every value in a node's right subtree is:Read the answer and worked solution →Reading a binary search tree from left to right gives the elements in:Read the answer and worked solution →A binary search tree built from already sorted input is likely to become:Read the answer and worked solution →A tree that requires the left and right subtrees to be balanced at every node is an:Read the answer and worked solution →An AVL tree keeps itself balanced after insertions by performing:Read the answer and worked solution →A collection where each element carries a priority value is a:Read the answer and worked solution →A priority queue is designed to retrieve and remove the element with the:Read the answer and worked solution →The most common implementation of a priority queue is the:Read the answer and worked solution →A structure that represents binary relations among a collection of entities is a:Read the answer and worked solution →Binary search requires that the list it searches is first:Read the answer and worked solution →The notation used to describe worst case order of growth is:Read the answer and worked solution →Sequential search through a list of N words has a worst case order of growth of:Read the answer and worked solution →Binary search on a sorted list has an order of growth of:Read the answer and worked solution →An algorithm that splits a problem in half, solves each half and combines results is called:Read the answer and worked solution →The canonical divide and conquer comparison sorting algorithm is:Read the answer and worked solution →An algorithm that repeatedly picks the option with the best immediate benefit is:Read the answer and worked solution →Catch the data structuresRead the answer and worked solution →Pop the growth classesRead the answer and worked solution →Run the algorithm gatesRead the answer and worked solution →Slice the structuresRead the answer and worked solution →Array or linkedRead the answer and worked solution →Sort the computing ideasRead the answer and worked solution →Type the numberRead the answer and worked solution →Algorithms bingoRead the answer and worked solution →

Worked practice questions

Array lists and linked lists both arrange elements one after another, so they are:

  1. Linear structures
  2. Layered structures
  3. Looping structures
  4. Lattice structures
Show answer and solution

Correct answer: A. Linear structures

1. Their elements sit in a single sequence. 2. No branching or hierarchy is involved. 3. So they are linear structures. _Source: OpenStax Introduction to Computer Science, Chapter 3, Data Structures and Algorithms._

Open this question →

An interviewer asks why an array list is fast to read at any index. The reason is it allows:

  1. Repeated hashing
  2. Random access
  3. Rapid deletion
  4. Reverse sorting
Show answer and solution

Correct answer: B. Random access

1. Elements sit next to each other in memory. 2. Any position can be computed directly. 3. So it allows random access. _Source: OpenStax Introduction to Computer Science, Chapter 3, Data Structures and Algorithms._

Open this question →

A linked list can only be walked from the front, which means it supports:

  1. Sequential access
  2. Selective access
  3. Symmetric access
  4. Simultaneous access
Show answer and solution

Correct answer: A. Sequential access

1. Each node only knows the next node. 2. You must follow the links in order. 3. So it supports sequential access. _Source: OpenStax Introduction to Computer Science, Chapter 3, Data Structures and Algorithms._

Open this question →

How to practise

  1. Choose a Data Structures and Algorithms question and try to work out your answer.
  2. Open the question to check the correct answer and read its worked solution.
  3. Continue in the app for bite-sized lessons, explanations and review with Quill. You can start without creating an account.

More Computer Science topics