Free Practice Quiz Question List

7 Data Structures for Problem Solving Online Quiz Questions

Use this free practice quiz with 20 questions to review 7 Data Structures for Problem Solving, test your knowledge, and prepare for your next test or exam.

20 questions
01
Choose one
1 point

In a table of student information, what do the rows and columns represent?

  1. A

    A row is a field and a column is a complete record.

  2. B

    A row is a record and a column is a field.

  3. C

    A row is a key and a column is a database.

  4. D

    A row is a value and a column is an index.

02
True or false
1 point

A record groups related fields that describe one entity.

  1. A

    True

  2. B

    False

03
Choose one
1 point

A list has four elements. What is the final valid zero-based index?

  1. A

    0

  2. B

    2

  3. C

    3

  4. D

    4

04
Written response
1 point

What collection operation processes elements one at a time?

05
Fill in the blank
1 point

In the school-system example, the students variable uses an outer containing one for each student.

06
Choose one
1 point

Why can inserting an element near the beginning of an array-like contiguous sequence be costly?

  1. A

    It automatically changes every element into a record.

  2. B

    It may require other elements to shift positions.

  3. C

    It prevents the collection from being traversed.

  4. D

    It converts the sequence into a database table.

07
Choose all
1 point

Which operations are supported by strings according to the material? Select all that apply.

  1. A

    Indexing

  2. B

    Sorting records by a database key

  3. C

    Searching

  4. D

    Replacing

08
Choose all
1 point

A contact application must frequently find a contact by username and eventually search, sort, filter, and persist millions of contacts. Which two structures best match these requirements? Select all that apply.

  1. A

    A dictionary keyed by username for frequent username lookup

  2. B

    A list solely because contacts are stored as text

  3. C

    A stack because contacts are records

  4. D

    A database table with suitable indexes for large persistent data

09
Written response
1 point

A program changes a student's existing grade from 95 to 98. Which collection operation is being performed?

10
Fill in the blank
1 point

In the sequence [10, 20, 30], position 1 is the , and 20 is the stored at that position.

11
True or false
1 point

When a table may be reordered, an algorithm should identify the student to update by a stable key rather than by the student's current position.

  1. A

    True

  2. B

    False

12
Choose one
1 point

Which approach is recommended for efficient construction of a large string from many pieces?

  1. A

    Repeatedly concatenate directly to the same large string

  2. B

    Collect pieces in a list and join them once

  3. C

    Store every character in a database table before combining them

  4. D

    Replace all strings with records

13
True or false
1 point

Assigning a value to an existing dictionary key replaces the value previously associated with that key.

  1. A

    True

  2. B

    False

14
Choose one
1 point

In Python, if word = "Structure", what value does word[1:4] produce?

  1. A

    truct

  2. B

    tru

  3. C

    trucT

  4. D

    ruct

15
Choose one
1 point

What is the result of this Python expression? scores = [72, 88, 91, 64]; passing = [score for score in scores if score >= 70]

  1. A

    [64, 72, 88]

  2. B

    [72, 88, 91, 64]

  3. C

    [72, 88, 91]

  4. D

    [88, 91]

16
Choose one
1 point

A program has student = {"id": 1042, "name": "Ada Lovelace", "grade": 95}. What is the effect of executing student["grade"] = 98?

  1. A

    The value of student["grade"] becomes 98.

  2. B

    A new key named "grade2" is created with value 98.

  3. C

    The dictionary becomes invalid because an existing key cannot be assigned.

  4. D

    The value of student["name"] becomes 98.

17
Choose one
1 point

Given a students table with unique id values, what does this SQL statement do? UPDATE students SET grade = 98 WHERE id = 1042;

  1. A

    Every student's grade is changed to 98.

  2. B

    Only the first row in the table is changed.

  3. C

    The row with grade 1042 is changed to 98.

  4. D

    The row with id 1042 is changed to 98.

18
Written response
1 point

What property of strings means that an operation such as concatenation creates a new string instead of changing the original string in place?

19
Written response
1 point

What is the arithmetic average of the list [72, 88, 91, 64]? Enter the value as a number.

20
Open ended
1 point

Consider this Python code:\n\na = [1, 2]\nb = a\nb.append(3)\n\nWhat are the final values of a and b, why do they have those values, and how would you change the code so that appending to b does not change a?