ErTayari

Home › Exam guide › Chapter 7

Chapter 7: Data Structures and Algorithm, Database System and Operating System: MCQ Practice for the NEC License Exam (AItE)

This chapter contributes 10 of the 100 questions in the IT Engineering license exam. Below are its subtopics, what is usually tested, and 12 free sample questions with answers and explanations.

Start a full mock test

Subtopics in this chapter

What is usually tested

Data-structure questions cover complexity notation, stacks, queues, linked lists, trees and traversals, sorting and searching algorithms, hashing, and graph algorithms such as spanning trees and shortest paths. Database questions ask about the E-R model, keys, normal forms, SQL, relational algebra, transactions, ACID properties, locking and recovery. Operating-system questions cover processes and threads, scheduling, synchronisation, deadlock, paging, page replacement, file allocation and basic administration.

Sample questions with answers

Try each question before opening the answer. These 12 are taken from the 219 questions for this chapter in the practice bank.

1. Which data structure follows LIFO order? (7.1 Introduction to data structure, list, linked lists and trees)

  1. Stack
  2. Queue
  3. Linked list
  4. Tree
Show answer
Answer: A. Stack
Stack: Last In, First Out.

2. An abstract data type (ADT) specifies: (7.1 Introduction to data structure, list, linked lists and trees)

  1. A set of data and the operations on it, without saying how they are implemented
  2. The exact memory layout of the data
  3. The programming language to be used
  4. The speed of the processor
Show answer
Answer: A. A set of data and the operations on it, without saying how they are implemented
A stack ADT, for example, can be implemented with either an array or a linked list.

3. The worst-case time complexity of quicksort is: (7.2 Sorting, searching, and graphs)

  1. O(n log n)
  2. O(n)
  3. O(n²)
  4. O(log n)
Show answer
Answer: C. O(n²)
Poor pivot choices lead to O(n²) in the worst case.

4. External sorting is used when: (7.2 Sorting, searching, and graphs)

  1. The data is already sorted
  2. The data is too large to fit in main memory
  3. The keys are all equal
  4. Only two items have to be sorted
Show answer
Answer: B. The data is too large to fit in main memory
The data stays on disk and is sorted in pieces, usually with a merge-based method.

5. Which SQL command removes a table and its structure completely? (7.3 Introduction to data models, normalization, and SQL)

  1. DELETE
  2. TRUNCATE
  3. DROP
  4. REMOVE
Show answer
Answer: C. DROP
DROP removes the table definition and data.

6. The three levels of data abstraction in a database system are: (7.3 Introduction to data models, normalization, and SQL)

  1. Physical, logical and view
  2. Input, process and output
  3. Hardware, software and data
  4. Primary, secondary and tertiary
Show answer
Answer: A. Physical, logical and view
The physical level describes how the data is stored, the logical level what is stored, and the view level what each user sees.

7. Which ACID property ensures a transaction is all-or-nothing? (7.4 Transaction processing, concurrency control and crash recovery)

  1. Atomicity
  2. Consistency
  3. Isolation
  4. Durability
Show answer
Answer: A. Atomicity
Atomicity: either all operations complete, or none do.

8. Which of the following is NOT a necessary condition for deadlock? (7.4 Transaction processing, concurrency control and crash recovery)

  1. Mutual exclusion
  2. Hold and wait
  3. Circular wait
  4. Preemption
Show answer
Answer: D. Preemption
The condition is NO preemption; preemption actually prevents deadlock.

9. An operating system is best described as: (7.5 Introduction to Operating System and process management)

  1. A program that manages the hardware resources and provides services to other programs
  2. A program that translates source code into machine code
  3. A device that stores data permanently
  4. An application for editing documents
Show answer
Answer: A. A program that manages the hardware resources and provides services to other programs
It acts as an interface between the user and the computer hardware.

10. The main aim of multiprogramming is to: (7.5 Introduction to Operating System and process management)

  1. Let one user run only one program
  2. Keep the CPU busy by switching to another job when one job waits for I/O
  3. Remove the need for main memory
  4. Run programs without an operating system
Show answer
Answer: B. Keep the CPU busy by switching to another job when one job waits for I/O
Several jobs are kept in memory at the same time.

11. Belady's anomaly is associated with which page replacement algorithm? (7.6 Memory management, file systems and system administration)

  1. LRU
  2. Optimal
  3. LFU
  4. FIFO
Show answer
Answer: D. FIFO
In FIFO, more frames can sometimes cause more page faults.

12. The address generated by the CPU during the execution of a program is called a: (7.6 Memory management, file systems and system administration)

  1. MAC address
  2. Physical address
  3. Port address
  4. Logical (virtual) address
Show answer
Answer: D. Logical (virtual) address
The memory management unit translates it into a physical address.

Practise this chapter

The full mock tests mix 10 questions from this chapter with 10 from each of the other nine, under the real 2-hour limit. Chapter practice mode lets you work through this chapter alone, untimed, with the explanation shown after every question.

Go to the mock tests
← Chapter 6: Computer Graphics & Multimedia Chapter 8: Software Engineering & OOAD →

All chapters