DS Foundations: 18 MCQs with answers

All 18 multiple-choice questions from this kit, free and with no sign-up.

Warm-up · 10 questions

Q1. What is a data structure?

Beginner
A A type of computer hardware B A database management system C A programming language D A method of organizing and storing data for efficient use
Show answer & explanation

A method of organizing and storing data for efficient use

A data structure is a method of organizing and storing data so that it can be used efficiently for processing, retrieval, updating, and deletion.

Q2. Which of the following is a primitive data structure?

Beginner
A Array B Integer C Stack D Tree
Show answer & explanation

Integer

Primitive data structures are basic types provided by programming languages, such as int, char, float, and bool. Arrays, stacks, and trees are non-primitive.

Q3. Which data structure is used for the 'Undo' operation in MS Word?

Beginner
A Stack B Queue C Tree D Graph
Show answer & explanation

Stack

The Undo operation follows Last-In-First-Out (LIFO) order, which is exactly how a stack works.

Q4. In a linear data structure, elements are arranged:

Beginner
A Randomly B In a sequential manner C In a graph-based manner D Hierarchically
Show answer & explanation

In a sequential manner

Linear data structures arrange elements one after another, with each element having a unique predecessor and successor (except first and last).

Q5. Which of the following is a non-linear data structure?

Beginner
A Queue B Array C Linked List D Tree
Show answer & explanation

Tree

Trees are non-linear because elements are arranged hierarchically, not sequentially. Arrays, queues, and linked lists are linear.

Q6. Which data structure is best suited for representing a family tree?

Beginner
A Tree B Queue C Stack D Array
Show answer & explanation

Tree

A family tree has hierarchical relationships, which is exactly what a tree data structure represents.

Q7. Which data structure uses LIFO (Last-In-First-Out) principle?

Beginner
A Stack B Tree C Graph D Queue
Show answer & explanation

Stack

Stacks follow LIFO, where the last element added is the first one removed.

Q8. Which data structure is used for browser history?

Beginner
A Queue B Tree C Stack D Graph
Show answer & explanation

Stack

Browser history uses a stack because the last visited page is on top and is accessed first (LIFO).

Q9. Arrays are considered primitive data structures.

Beginner
A True B False
Show answer & explanation

False

Arrays are non-primitive because they organize multiple values, even though they store primitive values.

Q10. Dynamic data structures allocate memory at compile time.

Beginner
A True B False
Show answer & explanation

False

Dynamic data structures allocate memory at runtime, allowing flexible size changes.

Building up · 7 questions

Q11. What is the main difference between static and dynamic data structures?

Intermediate
A Dynamic structures are always slower B Static structures have fixed size, dynamic can change at runtime C Static structures use pointers D Static structures are faster than dynamic
Show answer & explanation

Static structures have fixed size, dynamic can change at runtime

Static data structures have a fixed size allocated at compile time, while dynamic data structures can grow or shrink at runtime.

Q12. In an array, the address of the i-th element is calculated as:

Intermediate
A base address + i B base address - (i × size of element) C base address × i D base address + (i × size of element)
Show answer & explanation

base address + (i × size of element)

Array elements are stored contiguously, so the address of arr[i] is base address plus i times the size of each element.

Q13. What is an Abstract Data Type (ADT)?

Intermediate
A A logical description of data and operations without implementation details B A programming language feature C A physical storage structure D A data type with no operations
Show answer & explanation

A logical description of data and operations without implementation details

An ADT defines what operations can be performed on data but hides the implementation details, like a remote control hides internal circuits.

Q14. Which data structure is used for CPU task scheduling based on priority?

Intermediate
A Priority Queue B Array C Stack D Queue
Show answer & explanation

Priority Queue

Priority queues allow tasks with higher priority to be executed first, which is essential for CPU scheduling.

Q15. Which of the following is an example of a dynamic data structure?

Intermediate
A Static Queue B Static Stack C Linked List D Array
Show answer & explanation

Linked List

Linked lists allocate memory at runtime, allowing them to grow or shrink as needed, making them dynamic.

Q16. In a graph, what do nodes and edges represent?

Intermediate
A Nodes are files, edges are folders B Nodes are data, edges are operations C Nodes are memory locations, edges are pointers D Nodes are entities, edges are relationships
Show answer & explanation

Nodes are entities, edges are relationships

In a graph, nodes represent entities (like locations or users), and edges represent relationships (like roads or friendships).

Q17. What is the main advantage of a linked list over an array?

Intermediate
A Uses less memory B Easier insertion and deletion C Faster access to elements D Contiguous memory allocation
Show answer & explanation

Easier insertion and deletion

Linked lists allow easy insertion and deletion because they use pointers, whereas arrays require shifting elements.

Topper level · 1 questions

Q18. What is the space complexity of an adjacency matrix for a graph with V vertices?

Advanced
A O(E) B O(V) C O(V^2) D O(V+E)
Show answer & explanation

O(V^2)

An adjacency matrix stores a 2D array of size V x V, so space complexity is O(V^2).

Make your own

Your notes can be a kit like these

Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.

  • Chapter notes
  • Flashcards
  • Practice MCQs
  • Scored tests
  • Exam prep

Get Veda free See what students get

Free to start · No ads · Works in 42 languages