1. Which data structure uses LIFO (Last In, First Out) ordering?
A. Queue
B. Stack
C. Array
D. Linked List
Answer: B) Stack
Rationale: A stack follows the LIFO principle, meaning the last element
added is the first one to be removed.
2. What is the function of a compiler?
A. To interpret code line by line
B. To convert high-level code into machine code
C. To run the program directly from the source code
D. To manage memory during program execution
Answer: B) To convert high-level code into machine code
Rationale: A compiler translates high-level source code into machine
code or an intermediate code that can be executed by the computer.
3. What is the purpose of an index in a database?
A. To store the data itself
,B. To provide a faster way to retrieve data
C. To restrict access to certain records
D. To back up data
Answer: B) To provide a faster way to retrieve data
Rationale: Indexes are used in databases to speed up the retrieval of
data by creating a fast lookup mechanism based on indexed fields.
4. In which of the following scenarios would a queue be the most
suitable data structure?
A. Implementing undo functionality
B. Scheduling tasks in a print queue
C. Implementing a priority system
D. Storing elements in reverse order
Answer: B) Scheduling tasks in a print queue
Rationale: A queue follows FIFO (First In, First Out) and is ideal for
situations where tasks are processed in the order they arrive, like in a
print queue.
5. What is the primary advantage of using a linked list over an array?
A. Faster access to elements
B. Fixed size of the data structure
C. Dynamic memory allocation
D. Easier to perform sorting
, Answer: C) Dynamic memory allocation
Rationale: Linked lists allow for dynamic memory allocation, making
them more flexible than arrays, which have a fixed size and require
resizing if they become full.
6. Which of the following is a characteristic of cloud storage?
A. Provides local access to data only
B. Data is stored on personal hard drives
C. Allows for remote access to data over the internet
D. It does not support data synchronization
Answer: C) Allows for remote access to data over the internet
Rationale: Cloud storage allows users to store data on remote servers
and access it from any device with an internet connection.
7. Which type of memory is non-volatile?
A. RAM
B. Cache
C. ROM
D. Registers
Answer: C) ROM
Rationale: ROM (Read-Only Memory) is non-volatile, meaning it
retains its data even when the power is turned off.
A. Queue
B. Stack
C. Array
D. Linked List
Answer: B) Stack
Rationale: A stack follows the LIFO principle, meaning the last element
added is the first one to be removed.
2. What is the function of a compiler?
A. To interpret code line by line
B. To convert high-level code into machine code
C. To run the program directly from the source code
D. To manage memory during program execution
Answer: B) To convert high-level code into machine code
Rationale: A compiler translates high-level source code into machine
code or an intermediate code that can be executed by the computer.
3. What is the purpose of an index in a database?
A. To store the data itself
,B. To provide a faster way to retrieve data
C. To restrict access to certain records
D. To back up data
Answer: B) To provide a faster way to retrieve data
Rationale: Indexes are used in databases to speed up the retrieval of
data by creating a fast lookup mechanism based on indexed fields.
4. In which of the following scenarios would a queue be the most
suitable data structure?
A. Implementing undo functionality
B. Scheduling tasks in a print queue
C. Implementing a priority system
D. Storing elements in reverse order
Answer: B) Scheduling tasks in a print queue
Rationale: A queue follows FIFO (First In, First Out) and is ideal for
situations where tasks are processed in the order they arrive, like in a
print queue.
5. What is the primary advantage of using a linked list over an array?
A. Faster access to elements
B. Fixed size of the data structure
C. Dynamic memory allocation
D. Easier to perform sorting
, Answer: C) Dynamic memory allocation
Rationale: Linked lists allow for dynamic memory allocation, making
them more flexible than arrays, which have a fixed size and require
resizing if they become full.
6. Which of the following is a characteristic of cloud storage?
A. Provides local access to data only
B. Data is stored on personal hard drives
C. Allows for remote access to data over the internet
D. It does not support data synchronization
Answer: C) Allows for remote access to data over the internet
Rationale: Cloud storage allows users to store data on remote servers
and access it from any device with an internet connection.
7. Which type of memory is non-volatile?
A. RAM
B. Cache
C. ROM
D. Registers
Answer: C) ROM
Rationale: ROM (Read-Only Memory) is non-volatile, meaning it
retains its data even when the power is turned off.