0% found this document useful (0 votes)
25 views160 pages

All Book SA & Terminal Q&A

The document provides a comprehensive overview of operating systems, covering key concepts such as the functions of an OS, process management, scheduling algorithms, inter-process communication, and deadlock conditions. It includes self-assessment questions and answers to reinforce learning. Additionally, it discusses various operating system structures and the evolution of operating systems over time.

Uploaded by

akshaytopagi4895
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views160 pages

All Book SA & Terminal Q&A

The document provides a comprehensive overview of operating systems, covering key concepts such as the functions of an OS, process management, scheduling algorithms, inter-process communication, and deadlock conditions. It includes self-assessment questions and answers to reinforce learning. Additionally, it discusses various operating system structures and the evolution of operating systems over time.

Uploaded by

akshaytopagi4895
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 160

OPERATING SYSTEM (103)

CHAPTER 1

Self-Assessment Questions – 1

1. Operating System is a System Software which provides an environment


to help the user to execute the programs. (True / False)

Answer: True

2. A form of processing known as spooling is an acronym for ___________.


Answer: Simultaneous Peripheral Operation On Line

3. Disk Operating System (DOS) is an example for:


(a) PC OS
(b) Multi-processor OS
(c) Distributed OS
(d) Real Time OS

Answer: (a) PC OS

4. What does the concept of spooling in multi-programmed batched


operating systems allow?
(a) Execution of all jobs at once
(b) Storage of jobs on the disk ready for execution
(c) Immediate execution of jobs without scheduling
(d) Prioritizing user input over job execution

Answer: (b) Storage of jobs on the disk ready for execution

Self-Assessment Questions – 2

5. A typical operating system that supports a multiprogramming


environment will be less than 1MB in size. (True / False)
Answer: False

6. __________ suggested the layered approach to lessen the design and


implementation complexities of an operating system.
Answer: Dijkstra

7. The OS in IBM 370 is based on __________ approach.


(a) Kernel
(b) Virtual Machine
(c) Layered
(d) None of the above
Answer: (b) Virtual Machine

8. What does the virtual machine software layer do?


(a) Increases the speed of the hardware.
(b) Gives the illusion of sole hardware disposal to each user.
(c) Decreases the system's memory.
(d) None of the above.

Answer: (b) Gives the illusion of sole hardware disposal to each user.

Terminal Questions

9. Explain different functions of an operating system.

Answer: An operating system performs the following functions:

(a) Processor Management: Assigns the processor to different tasks.

(b) Memory Management: Allocates main memory and secondary storage for
programs and data.

(c) Input/Output Management: Coordinates and assigns input and output devices.

(d) File System Management: Maintains and manages files, allowing users to
create, delete, and move files.

(e) Establishment of Priority System: Determines and maintains execution


order of jobs.

(f) Allocation of System Resources: Distributes software and hardware


resources among users.

10. Explain the evolution of operating systems.

Answer: Operating systems evolved over time:

(a) Simple Batch OS: Used in early computers with no direct user interaction.

(b) Multi-programmed Batch OS: Introduced job pooling and CPU scheduling
to improve efficiency.

(b) Time-sharing OS: Allowed multiple users to interact with the system in real
time.

(C) Personal Computer OS: Developed for single-user operation, e.g., DOS.

(d) Multi-Processor OS: Designed for systems with multiple processors to improve
performance.
(e) Distributed OS: Used in systems where multiple computers are connected
via a network.

(f) Real-Time OS: Used in critical applications requiring immediate response,


such as industrial and medical systems.

11. Write a brief note on operating system structures.

Answer: Operating systems can be structured in different ways:

Layered Approach: Divides the OS into layers, each handling specific functions.

Kernel-Based Approach: Uses a core system (kernel) to manage essential OS


functions.

Virtual Machine Approach: Provides an interface where multiple operating systems


can run simultaneously.

12. Differentiate between Parallel Systems and Distributed Systems.

Answer:

Parallel Systems: Multiple processors share a single memory and clock, working
together for better performance.

Distributed Systems: Independent processors (computers) connected via a


network, sharing resources and tasks.

13. Write a short note on Spooling and BIOS.

Answer:

Spooling: A technique that allows input and output operations to be stored in a


buffer (disk) before being processed. This speeds up processing by overlapping I/O
with CPU execution.

BIOS (Basic Input Output System): A firmware stored in ROM that initializes
hardware and loads the operating system into memory during booting.

CHAPTER 2

Self-Assessment Questions – 1

1. A process is executed in parallel, multiple instructions at a time. (True /


False)

Answer: False
2. A __________ serves as a repository of information about a process and
varies from process to process.

Answer: Process Control Block (PCB)

3. When a process is waiting for CPU, we can say it is in __________ state.


(a) Ready
(b) New
(c) Running
(d) Waiting

Answer: (a) Ready

Self-Assessment Questions – 2

4. The main objective of multiprogramming is to see that some process is


always running so as to maximize CPU utilization. (True / False)

Answer: True

5. The operating system ________________ schedules processes from the


ready queue for execution by the CPU.

Answer: Scheduler

6. CPU switching from one process to another requires saving the state of
the current process and loading the latest state of the next process. This is
known as a ______________.

(a) Program Switch


(b) Context Switch
(c) Process Switch
(d) OS Switch

Answer: (b) Context Switch

Self-Assessment Questions – 3

7. An application program provides a mechanism for process creation and


termination. (True / False)

Answer: False

8. A process terminates when it finishes executing its last statement and


asks the operating system to delete it by using the ____________.

Answer: Exit System Call

9. Any process that shares data with other processes is a __________.


(a) Main process
(b) Independent process
(c) Co-operating process
(d) None of the above

Answer: (c) Co-operating process

Self-Assessment Questions – 4

10. Thread is a single sequence stream which allows a program to split itself
into two or more simultaneously running tasks. (True / False)

Answer: True

11. As threads have some of the properties of processes, they are sometimes
called _______________ processes.

Answer: Lightweight

12. No thread library exists in _______________ threads.


(a) User-Level
(b) Kernel-Level
(c) Either a) or b)
(d) None of the above

Answer: (b) Kernel-Level

Terminal Questions

13. Explain with a diagram all possible states a process visits during the
course of its execution.

Answer:
A process can be in the following states:

(a) New: Process is created.


(b) Ready: Process is waiting for CPU.
(c) Running: Process is executing instructions.
(d) Waiting (Blocked): Process is waiting for an event (e.g., I/O operation).
(e) Terminated: Process execution is complete.

Diagram: New → Ready → Running → (Waiting) → Ready → Running →


Terminated

14. What is PCB? What is the useful information available in PCB?

Answer: PCB (Process Control Block) is a data structure in the operating


system that stores information about a process. It includes:

(a) Process state: New, Ready, Running, Waiting, Terminated


(b) Program counter: Address of the next instruction to execute
(c) CPU registers: Stores intermediate values during execution
(d) Memory management information: Base and limit registers, page tables
(e) I/O status information: List of allocated I/O devices and open files

15. Discuss different types of schedulers.

Answer:

Long-term scheduler: Selects processes to be loaded into memory from the job queue.

Short-term scheduler: Selects processes from the ready queue to execute on the CPU.

Medium-term scheduler: Swaps processes in and out of memory to control the degree
of multiprogramming.

16. Explain different operations on a process.

Answer:

(a) Process Creation: A parent process creates a child process using system calls.

(b) Process Execution: Processes execute instructions until they need input/output
or the CPU is reassigned.

(c) Process Termination: A process finishes execution and is removed from the
system.

17. What are Co-operating processes? What are the advantages of process
co-operation?

Answer: Co-operating Process: A process that can affect or be affected by other


processes.

Advantages:

(a) Information Sharing: Allows multiple users to access shared data.

(b) Computation Speedup: Parallel execution of tasks.

(c) Modularity: System functions can be divided into separate processes.

(d) Convenience: Users can run multiple tasks simultaneously.

CHAPTER 3

Self-Assessment Questions – 1
1. Scheduling is a fundamental operating-system function. (True / False)

Answer: True

2. The _______________ selects from among the processes in memory that


are ready to execute, and allocates the CPU to one of them.

Answer: CPU Scheduler

3. In real systems, CPU utilization ranges from _________________ for a


lightly loaded system to __________________ for heavily loaded systems.

(a) 40%, 90%


(b) 50%, 50%
(c) 90%, 40%
(d) 25%, 75%

Answer: (a) 40%, 90%

Self-Assessment Questions – 2

4. The FCFS algorithm is implemented by using a Last-In-First-Out (LIFO)


queue structure. (True / False)

Answer: False

5. In _______________ algorithm, when the CPU is available, it is assigned


to the process that has the smallest next CPU burst.

Answer: Shortest-Job-First Scheduling

6. The _______________ CPU scheduling algorithm is basically a


preemptive scheduling algorithm designed for time-sharing systems.

Answer: Round-Robin

Self-Assessment Questions – 3

7. To select an algorithm, first we must define the criteria on which we can


select the best algorithm. (True / False)

Answer: True

8. N = Lambda x W is _______________ formula.

Answer: Little’s Formula


Terminal Questions

9. List out various CPU scheduling criteria.

Answer:

(a) CPU Utilization: Maximizing CPU use.


(b) Throughput: Number of processes completed per time unit.
(c) Turnaround Time: Time taken from process submission to completion.
(d) Waiting Time: Total time a process spends waiting in the ready queue.
(e) Response Time: Time taken from process submission to the first response.

10. Discuss First-Come-First-Served scheduling algorithm.

Answer: FCFS (First-Come-First-Served) schedules processes in the order they


arrive. It uses a FIFO queue.

Advantages: Simple and easy to implement.

Disadvantages: Can cause convoy effect, where short processes wait for long
processes to complete.

11. What are the drawbacks of the Shortest-Job-First scheduling algorithm?

Answer: Difficult to implement because the next CPU burst time must be known
in advance. May cause starvation, as longer processes may never get scheduled.
More suitable for batch processing than interactive systems.
12. How will you evaluate CPU schedulers by simulation?

Answer: Simulation helps compare scheduling algorithms by running them on


predefined workloads. Trace tapes record real workloads for accurate testing.
Mathematical models like Little’s Formula help predict queue performance.

CHAPTER 4

Self-Assessment Questions – 1

1. Inter Process Communication provides a mechanism to allow processes


to communicate and to synchronize their actions. (True / False)

Answer: True

2. RPC stands for _______________.

Answer: Remote Procedure Call


3. The _______________ queue has finite length n; thus, at most n messages
can reside in it.

(a) Bounded Capacity


(b) Zero Capacity
(c) Unbounded Capacity
(d) None of the above

Answer: (a) Bounded Capacity

Self-Assessment Questions – 2

4. A critical-section is a part of a program that accesses a shared resource


(data structure or device) that must not be concurrently accessed by more than
one process of execution. (True / False)

Answer: True

5. An algorithm developed for solving the critical-section problem for n


processes is also called _______________ algorithm.

Answer: Bakery Algorithm

6. If process pi is executing in its critical-section, then no other processes


can be executing in their critical-sections. This is called _______________.
(a) Bounded Waiting
(b) Mutual Exclusion
(c) Progress
(d) None of the above

Answer: (b) Mutual Exclusion

Self-Assessment Questions – 3

7. Semaphores are the classic method for restricting access to shared


resources (e.g., storage) in a multi-processing environment. (True / False)

Answer: True

8. Semaphores were invented by _______________.

Answer: Dijkstra

9. _______________ is a high-level synchronization construct which is a


collection of procedures, variables, and data structures grouped together.
(a) Semaphores
(b) Processes
(c) Monitor
(d) None of the above

Answer: (c) Monitor

Terminal Questions

10. Discuss Interprocess Communication.

Answer: Interprocess Communication (IPC) provides mechanisms for processes to


communicate and synchronize their actions. There are two main types of IPC:

Message Passing: Processes communicate by sending and receiving messages.

Shared Memory: Processes share a common memory space for communication.

IPC can be implemented using direct or indirect communication, synchronous or


asynchronous messaging, and different types of buffering mechanisms.

11. What is the critical-section problem? Explain.

Answer: A critical-section is a part of a program that accesses a shared resource


(data structure or device) that must not be concurrently accessed by more than one
process. The critical-section problem arises when multiple processes need to enter
their critical sections simultaneously, potentially leading to data inconsistency. A
solution to this problem must satisfy:

Mutual Exclusion: Only one process can be in its critical-section at a time.

Progress: If no process is in its critical-section, then other processes can proceed.

Bounded Waiting: There must be a limit on the number of times other processes can
enter before a waiting process gets its turn.

Various algorithms like Peterson’s Algorithm and Bakery Algorithm are used to solve
this problem.

12. What are semaphores? Explain.

Answer: Semaphores are synchronization primitives used to control access to


shared resources in a multiprocessing environment. There are two types of
semaphores:

Binary Semaphore: Can have only two values (0 or 1), used for mutual exclusion.

Counting Semaphore: Can have multiple values, used for resource management.

The two main operations on semaphores are:

P (Wait) Operation: Decrements the semaphore value; if it’s 0, the process waits.
V (Signal) Operation: Increments the semaphore value, allowing a waiting process to
proceed.

Semaphores help prevent race conditions and ensure orderly execution of processes.

13. What are monitors? Explain.

Answer: A monitor is a high-level synchronization construct that groups together


procedures, variables, and data structures to manage concurrent access. Only one
process can be active in a monitor at a time. Monitors prevent race conditions by
ensuring mutual exclusion. They use condition variables to allow processes to wait or
signal other processes. Example of Monitor Structure:

monitor ExampleMonitor {
int resource;
condition x;

procedure accessResource() {
if (resource == 0) wait(x);
resource--;
}

procedure releaseResource() {
resource++;
signal(x);
}
}

Monitors are easier to implement compared to semaphores and help simplify process
synchronization in operating systems.

CHAPTER 5

Self-Assessment Questions – 1

1. Several processes compete for a finite set of resources in a multi-


programmed environment. (True / False)

Answer: True

2. A process Pi that is waiting for some currently unavailable resource is


said to be _______________.

Answer: Blocked

3. A condition where at least one of the resources is non-sharable in a


system is called _______________.
(a) Mutual Exclusion
(b) Hold and Wait
(c) Circular Wait
(d) None of the above

Answer: (a) Mutual Exclusion

Self-Assessment Questions – 2

4. Shared resources always involve in deadlocks. (True / False)

Answer: False

5. A deadlock _______________ algorithm requires each process to make


known in advance the maximum number of resources of each type that it may
need.

Answer: Avoidance

6. _______________ algorithm is used where resources have multiple


instances.
(a) Resource Allocation Graph
(b) Banker’s
(c) Resource Request
(d) None of the above

Answer: (b) Banker’s

Self-Assessment Questions – 3

8. If the system does not ensure that a deadlock cannot be prevented or a


deadlock cannot be avoided, then a deadlock may occur. (True / False)

Answer: True

9. _______________ is a variant of the resource allocation graph, which can


be used to detect deadlocks in the system that has resources, all of which have
only single instances.

Answer: Wait-for Graph

10. _______________, _______________, and _______________ are the three


basic approaches to handle deadlocks.

Answer: Prevention, Avoidance, Detection

Terminal Questions
11. What are the necessary conditions for deadlock to occur?

Answer: A deadlock occurs if the following four conditions hold simultaneously:


(a) Mutual Exclusion: A resource cannot be shared among multiple processes.
(b) Hold and Wait: A process holding a resource can request additional resources.
(c) No Preemption: A resource cannot be forcibly taken from a process.
(d) Circular Wait: A cycle of processes exists where each process is waiting for a
resource held by the next process in the cycle.

12. Write a note on Resource Allocation Graph.

Answer: A Resource Allocation Graph (RAG) is a directed graph where:

Processes are represented by circles.

Resources are represented by rectangles with dots inside them (each dot represents
an instance of the resource).

Edges (Arrows):

Request Edge (P → R): Indicates that a process is requesting a resource.

Assignment Edge (R → P): Indicates that a resource is allocated to a process.

Deadlock Detection:

If a cycle exists in the graph and there is only one instance of each resource, a
deadlock is confirmed.

If multiple instances exist, a cycle may indicate a deadlock but is not a sufficient
condition.

13. Describe safe, unsafe, and deadlock states of a system.

Answer:

Safe State: The system can allocate resources without leading to a deadlock. There
exists a safe sequence of processes that can complete execution.

Unsafe State: The system may or may not lead to deadlock, depending on resource
allocation.

Deadlock State: All processes in a set are waiting indefinitely due to circular resource
dependency.

14. Explain how Banker’s algorithm is used to check the safe state of a
system.

Answer: Banker’s Algorithm is used to avoid deadlocks by checking whether granting


a resource request will leave the system in a safe state.
Steps:
(a) Each process declares its maximum resource need in advance.

(b) When a process requests a resource, the system checks if granting it will result
in a safe state.

(c) If the system remains in a safe state, the request is granted. Otherwise, the
process waits.
(d) The algorithm uses data structures such as:

Available (Resources currently free)


Max (Maximum demand of each process)
Allocation (Currently allocated resources)
Need (Remaining resource need = Max - Allocation)

(e) If a safe sequence exists where all processes can complete, the system is safe.
Otherwise, it is unsafe.

15. Explain a protocol to prevent deadlocks and show how resources will be
allocated and mention the safe sequence (if it exists).

Answer: A protocol to prevent deadlocks must eliminate at least one of the four
necessary conditions:

(a) Eliminating Mutual Exclusion: Allow shared access to resources where possible
(e.g., read-only files).

(b) Eliminating Hold and Wait: Require a process to request all needed resources
before execution starts.

(c) Eliminating No Preemption: Allow resource preemption from blocked


processes.

(d) Eliminating Circular Wait: Impose a total ordering of resources and force
processes to request them in order.

Example:

Suppose a system has:

Resources: A, B, C

Processes: P1, P2, P3

Process Maximum Demand Allocation Need


P1 (7, 5, 3) (0, 1, 0) (7, 4, 3)
P2 (3, 2, 2) (2, 0, 0) (1, 2, 2)
P3 (9, 0, 2) (3, 0, 2) (6, 0, 0)
Available Resources: (3, 3, 2)

Safe Sequence Calculation:

(a) Start with P2, which can be completed.

(b) After P2 finishes, it releases resources. Now, allocate to P1.

(c) Once P1 finishes, allocate to P3.

(d) Safe Sequence: P2 → P1 → P3

Since a safe sequence exists, the system is not in deadlock.

CHAPTER 6

Self-Assessment Questions – 1

1. The logical address is also sometimes referred to as a virtual address.


(True / False)

Answer: True

2. An address generated by the CPU is referred to as a _______________.

Answer: Logical Address

3. MAR stands for _______________.


(a) Memory Address Register
(b) Memory Allocation Register
(c) Main Address Register
(d) Main Allocation Register

Answer: (a) Memory Address Register

Self-Assessment Questions – 2

4. The operating system is usually present in the upper portion of the main
memory. (True / False)

Answer: False

5. The method of relocating processes in memory so that the fragmented


holes create one contiguous hole in memory is called_____________.

Answer: Compaction

6. PTBR stands for _______________.


(a) Page Table Box Register
(b) Page Table Base Register
(c) Physical Table Base Register
(d) Physical Table Box Register

Answer: (b) Page Table Base Register

Self-Assessment Questions – 3

7. Memory management using paging provides two entirely different views


of memory – logical view and physical view. (True / False)

Answer: True

8. _______________ is a memory management scheme that supports the


user’s view of main memory.

Answer: Segmentation

9. Segments of user programs are allocated memory by the _____________.


(a) FCFS Scheduler
(b) FIFO Scheduler
(c) Bob Scheduler
(d) LIFO Scheduler

Answer: (c) Bob Scheduler

Terminal Questions

10. What is MMU?

Answer: MMU stands for Memory Management Unit. At run time, the virtual
addresses are mapped to physical addresses by the MMU. It handles memory
protection and address translation.

11. Explain how virtual address is mapped to a physical address.

Answer: The relocation register contains a value added to every address generated
by the CPU for a user process. The MMU maps logical addresses to physical
addresses dynamically using this register.

12. Explain single partition allocation.

Answer:

(a) The operating system resides in the lower memory.


(b) User processes execute in the higher memory.
(c) A limit register and relocation register protect memory access.
(d) The relocation register contains the smallest physical address a user
process can access, while the limit register ensures that access is within the
allocated memory range.

13. Explain first-fit, best-fit, and worst-fit allocation algorithms with an


example.

Answer:

(a) First-fit: Allocates the first hole big enough to accommodate the process.
(b) Best-fit: Allocates the smallest available hole that fits the process.
(c) Worst-fit: Allocates the largest available hole to the process.

Example: Given memory holes: 100KB, 500KB, 200KB, 300KB, 600KB

(a) First-fit (for a 250KB process): Allocates 500KB


(b) Best-fit (for a 250KB process): Allocates 300KB
(c) Worst-fit (for a 250KB process): Allocates 600KB

14. Write a note on External Fragmentation.

Answer: External fragmentation occurs when free memory blocks exist but are non-
contiguous, making it impossible to allocate them to a process even if the total free
space is sufficient.

CHAPTER 7

Self-Assessment Questions – 1

1. Every process needs to be loaded into physical memory for execution.


(True / False)

Answer: True

2. _______________ is implemented using demand paging.

Answer: Virtual Memory

3. When a process is to be executed then only that page of the process,


which needs to be currently executed, is swapped into memory. This method is
called _______________.

(a) Demand Paging


(b) Request Paging
(c) Swap Paging
(d) Change Paging
Answer: (a) Demand Paging

Self-Assessment Questions – 2

4. Whenever a page fault occurs instead of using any page replacement


algorithms simply terminate the process. (True / False)

Answer: False

5. ___________ algorithm is more a benchmark algorithm for comparison.

Answer: Optimal Page Replacement

6. Generally, when the number of frames available increases, the number of


page faults should decrease. Instead, if the page faults also increase, this
unexpected result is called _______________.
(a) Charlie’s anomaly
(b) Belady’s anomaly
(c) John’s anomaly
(d) Pascal’s anomaly

Answer: (b) Belady’s anomaly

Self-Assessment Questions – 3

7. The operating system closely monitors CPU utilization. (True / False)

Answer: True

8. _______________ is a high paging activity in which a process spends


more time in paging than executing.

Answer: Thrashing

9. PFF stands for _______________.


(a) Page Fault Finder
(b) Page Finding Frequency
(c) Page Fault Frequency
(d) Page Fault Finding

Answer: (c) Page Fault Frequency

Terminal Questions

10. What is virtual memory? Distinguish between logical address and


physical address.
Answer: Virtual memory is a technique that provides an illusion of a large memory
space, allowing processes to execute even if they are partially loaded into main
memory.

Logical Address: The address generated by the CPU.

Physical Address: The actual address in main memory where data is stored.

11. Explain demand paging in a virtual memory system.

Answer: Demand paging allows only the required pages of a process to be loaded
into memory instead of loading the entire process. If a page is not in memory, a page
fault occurs, and the operating system fetches the required page from secondary
storage. This reduces memory usage and improves system efficiency.

12. Explain Belady’s anomaly with the help of FIFO page replacement
algorithm.

Answer: Belady’s anomaly occurs when increasing the number of frames increases
the number of page faults in FIFO page replacement.

Example:
(a) Reference String: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5

(b) Using 3 frames, we get 9 page faults.

(c) Using 4 frames, we get 10 page faults, showing unexpected behavior.

13. Discuss the Optimal Page Replacement algorithm.

Answer: Optimal Page Replacement replaces the page that will not be used for
the longest time in the future. It results in the minimum number of page faults but is
impractical since future memory references are unknown.

14. What is thrashing and what is its cause?

Answer: Thrashing occurs when a process spends more time in page faults than
executing. Causes of thrashing:

(a) High degree of multiprogramming

(b) Insufficient frames allocated to processes

(c) Frequent page replacements

CHAPTER 8
Self-Assessment Questions – 1

1. The operating system provides a uniform logical view of information


stored in different storage media. (True / False)

Answer: True

2. A _______________ is a collection of related information recorded on the


secondary storage.

Answer: File

3. Usually a block size will be _______________ bytes.


(a) 512
(b) 256
(c) 128
(d) 64

Answer: (a) 512

Self-Assessment Questions – 2

4. The CPU can directly process the information stored in secondary


memory without transferring it to main memory. (True / False)

Answer: False

5. In _______________ method, information in a file is accessed sequentially


one record after another.

Answer: Sequential Access

6. A _______________ is a tree of height two with the master file directory at


the root having user directories as descendants that in turn have the files
themselves as descendants.

(a) Single-level directory


(b) Tree-structured directory
(c) Two-level directory
(d) Directory

Answer: (b) Tree-structured directory

Self-Assessment Questions – 3

7. In contiguous allocation, the disk access time is reduced, as disk head


movement is usually restricted to only one track. (True / False)

Answer: True
8. FAT stands for _______________.

Answer: File Allocation Table

9. If the file size is small, then _______________ is advantageous and provides


good performance.
(a) Linked allocation
(b) Indexed allocation
(c) Contiguous file allocation
(d) Linked with indexed allocation

Answer: (c) Contiguous file allocation

Terminal Questions

10. Explain different file access methods in detail.

Answer:
(a) Sequential Access: Reads/writes files sequentially, one record at a time.

(b) Direct Access: Reads/writes specific records directly using an index.

(c) Indexed Sequential Access: Uses an index to locate data for faster access.

11. What are the different directory structures available? Explain.

Answer:

(a) Single-Level Directory: All files stored in one directory.

(b) Two-Level Directory: Each user has their own directory.


(c) Tree-Structured Directory: Directories are organized in a hierarchical structure.

12. Discuss various space allocation methods for files.

Answer:

(a) Contiguous Allocation: Files are stored in contiguous blocks.

(b) Linked Allocation: Each file block points to the next block in a chain.

(c) Indexed Allocation: A separate index block contains pointers to file blocks.

CHAPTER -9

Self-Assessment Questions – 1
1. All I/O devices operate at the same speed. (True / False)

Answer: False

2. The signal DAV stands for _______________.

Answer: Data Valid

3. The interaction between the CPU and an I/O device is usually referred to
as “_____________".
(a) Handshaking
(b) Communication
(c) Talking
(d) Listening

Answer: (a) Handshaking

Self-Assessment Questions – 2

4. The simplest I/O strategy is to use the processor itself as the I/O
controller. (True / False)

Answer: True

5. DMA stands for _______________.

Answer: Direct Memory Access


6. A 9600 baud modem can transfer approximately _______________
character(s) per millisecond.
(a) Three
(b) One
(c) Two
(d) Four

Answer: (b) One

Terminal Questions

7. Draw a block diagram of an I/O structure in a medium-scale processor


and explain its working.

Answer:
(a) In the I/O structure of medium-sized processors, the I/O controllers and main
memory are connected to the main system bus.

(b) The cache memory (usually found on-chip with the CPU) has a direct
connection to the processor as well as to the system bus.
(c) I/O devices communicate through controllers, which manage input and output
operations efficiently.

8. What are various I/O control strategies? Discuss in brief.

Answer:

(a) Program-Controlled I/O: The processor directly controls I/O operations,


checking device status before performing tasks.

(b) Interrupt-Controlled I/O: The I/O device sends an interrupt signal when ready,
reducing CPU waiting time.

(c) Direct Memory Access (DMA): Allows I/O devices to transfer data directly to
memory without CPU intervention.

9. Explain programmed I/O and interrupt I/O. How do they differ?

Answer:

(a) Programmed I/O: The CPU continuously checks the status of I/O devices,
leading to inefficient CPU usage.

(b) Interrupt I/O: The CPU executes other tasks while waiting and is interrupted
only when the I/O device is ready.

(c) Difference: Interrupt I/O is more efficient as it reduces CPU idle time compared
to programmed I/O.

10. Discuss the concept of Direct Memory Access (DMA). What are its
advantages over other methods?

Answer: Concept: DMA allows I/O devices to transfer data directly to memory,
bypassing the CPU. Advantages:

(a) Reduces CPU workload.


(b) Faster data transfer.
(c) Enables efficient handling of large data blocks.

CHAPTER 10

Self-Assessment Questions – 1

1. Distributed processing and parallel processing are two technologies


used to harness the power of a multiprocessor system. (True / False)

Answer: True
2. NOS stands for _______________.
Answer: Network Operating System

3. In _______________ distribution all computers are at the same level


implying that all computers are capable of handling any functionality.
(a) Horizontal
(b) Vertical
(c) Parallel
(d) Hierarchical

Answer: (a) Horizontal

Self-Assessment Questions – 2

4. In NOS, the shared data resides on the server and clients access the
shared data. (True / False)

Answer: True

5. RPC stands for _______________.

Answer: Remote Procedure Call

6. The _______________ software on the client generates an RPC and sends


it across the network.
(a) Network Management
(b) Communication Management
(c) Redirection
(d) File / Printer Service

Answer: (b) Communication Management

Self-Assessment Questions – 3

7. File / Printer resources software runs both on client and server. (True /
False)

Answer: False

8. OSI stands for _______________.

Answer: Open System Interconnect

9. _______________ software is responsible for monitoring the network and


its components such as computers, modems, repeaters, lines, adapters, and
multiplexers.
(a) Network Management
(b) Communication Management
(c) Redirection
(d) File / Printer

Answer: (a) Network Management

Self-Assessment Questions – 4

10. The NOS is not responsible for activities such as memory and process
management on the server. (True / False)

Answer: False

11. GOS stands for _______________.

Answer: Global Operating System

12. Migrations are necessary for optimal use of available resources.


Migrations include:
(a) Data migration
(b) Computation migration
(c) Process migration
(d) All of the above

Answer: (d) All of the above

Self-Assessment Questions – 5

13. A procedure is present on the server to locate and retrieve data present
on a shared device attached to it. (True / False)

Answer: True

14. In RPC, _______________ is very difficult because it is difficult to let


processors on different machines share a common address space.

Answer: Call by reference

15. _______________ can support multiple machines and multiple


networks/distributed file systems at the same time.
(a) DOS
(b) NetWare-386
(c) Windows
(d) Linux

Answer: (b) NetWare-386

Terminal Questions

16. Distinguish between centralized processing and distributed processing.


Answer: Centralized Processing: A single central computer performs all
processing, and users access it through terminals.

Distributed Processing: Multiple interconnected computers share processing tasks for


improved efficiency and scalability.

17. Explain Network Operating System (NOS) architecture in detail.

Answer: NOS manages network resources and enables communication between


computers. Components include:
(a) Redirection software (handles remote requests).
(b) Communication management software (ensures error-free data transfer).
File/Printer services (manages shared resources).
Network management software (monitors network components).

18. What is Global Operating System (GOS)? Explain.

Answer: GOS manages resources across all computers in a distributed system.


Functions include:

(a) User Interface Management


(b) Process Management
(c) Memory Management
(d) Resource Allocation and Load Balancing

GOS ensures optimal resource utilization and improves efficiency.

19. Explain the execution of an RPC.

Answer: Remote Procedure Call (RPC) allows a client to invoke a function on a


remote server.

Steps:
(a) Client sends an RPC request.
(b) Communication management software transmits the request.
(c) Server receives and processes the request.
(d) Server sends the result back to the client.

RPC simplifies distributed computing by making remote calls appear as local function
calls.

CHAPTER 11

Self-Assessment Questions – 1

1. Security is concerned with the ability of the operating system to enforce


control over storage and movement of data in and between the objects that the
operating system supports. (True / False)
Answer: True

2. _______________ refers to information that is not modified or deleted in


an unauthorized manner.

Answer: Integrity

3. _______________ is verification of access to system resources.


(a) Authentication
(b) Line Trapping
(c) Browsing
(d) Fabrication

Answer: (a) Authentication

Self-Assessment Questions – 2

4. Computer worm harms other programs and data. (True / False)

Answer: False

5. A computer _______________ is written with an intention of infecting


other programs.

Answer: Virus

6. _______________ software is used to remove viruses from programs.

Answer: Anti-virus

Self-Assessment Questions – 3

7. Password is the most commonly used scheme for protection against


illegal access. (True / False)

Answer: True

8. General design principles for protection were put forward by


_______________ and _______________.

Answer: Saltzer and Schroeder

9. _______________ is a way of storing the access control matrix.

Answer: Capability list

Self-Assessment Questions – 4
10. Encryption is an important tool in protection, security, and authentication.
(True / False)

Answer: True

11. Data before encryption is called _______________ text and after


encryption is called _______________ text.

Answer: Plain text, Cipher text

12. _______________ and _______________ are the two common types of


encryption.

Answer: Private key, Public key

Terminal Questions

13. Discuss the need for security and protection in computer systems.

Answer:
(a) Security ensures controlled access to storage and movement of data.
(b) It prevents unauthorized access, modification, or deletion of sensitive
information.
(c) Protection mechanisms safeguard files, databases, and network resources from
threats like viruses, worms, and hacking.

14. Write a note on computer worm and computer virus.

Answer:

(a) Computer Worm: A self-replicating program that spreads across networks,


consuming resources but not necessarily damaging files.

(b) Computer Virus: A malicious program that attaches itself to legitimate files and
can corrupt or delete data.

15. Describe authentication by using passwords.

Answer:
(a) Authentication verifies a user’s identity before granting access.
(b) The most common method is password-based authentication.
(c) Passwords should be long, complex, and changed periodically for security.
(d) Techniques like salting enhance password security.

16. What is encryption? What are the different ways in which a message can
be encrypted?

Answer: Encryption is the process of converting plaintext into ciphertext to


prevent unauthorized access. Types of Encryption:
(a) Transposition Cipher: Rearranges characters in the message.

(b) Substitution Cipher: Replaces characters with different symbols.

(c) Public Key Encryption: Uses different keys for encryption and
decryption.

CHAPTER 12

Self-Assessment Questions – 1

1. Use of multiprocessor systems speeds up an application. (True / False)

Answer: True

2. SIMD stands for _______________.

Answer: Single Instruction Stream, Multiple Data Stream

3. Distributed systems fit into the class of _______________ systems.


(a) Loosely coupled
(b) Tightly coupled
(c) Hybrid
(d) Non-hybrid

Answer: (a) Loosely coupled

Self-Assessment Questions – 2

4. Complexity, cost, IPC, and scalability are not considered in


multiprocessor interconnections. (True / False)

Answer: False

5. In _______________ approach, one processor is dedicated to execute the


operating system and the remaining processors form a pool of computational
processors.

Answer: Master / Slave

6. Simultaneous access of ‘n’ processors and ‘n’ memories is possible in


the case of _______________.
(a) Bus-oriented systems
(b) Crossbar interconnection systems
(c) Hyper cubes
(d) Multistage switch-based systems
Answer: (b) Crossbar Interconnection Systems

Self-Assessment Questions – 3

7. Multiprocessor operating systems manage available resources to


facilitate program execution and interaction with users. (True / False)

Answer: True

8. TLB stands for _______________.

Answer: Translation Look-aside Buffer

9. Processors are allocated to _______________.


(a) Software
(b) Hardware
(c) Applications
(d) Programs

Answer: (c) Applications

Terminal Questions

10. List the advantages of multiprocessor systems.

Answer:
(a) Increased throughput: Executes multiple processes simultaneously.
(b) Fault tolerance: Redundancy increases availability.
(c) Flexibility: Dynamic reconfiguration based on needs.
(d) Modular growth: Allows incremental upgrades.
(e) Cost efficiency: Lower cost per performance compared to large systems.

11. How can multiprocessors be classified?

Answer:
(a) SISD (Single Instruction, Single Data): Traditional uniprocessor system.

(b) SIMD (Single Instruction, Multiple Data): Executes the same instruction on
multiple data points.

(c) MISD (Multiple Instruction, Single Data): Not commonly used.

(d) MIMD (Multiple Instruction, Multiple Data): Multiple processors execute


different instructions on different data simultaneously.

12. Explain the various multiprocessor interconnections.

Answer:
(a) Bus-oriented systems: Processors share a common bus.

(b) Crossbar interconnection: Uses a crossbar switch for direct processor-memory


connections.

(c) Hypercube: Nodes are interconnected in a cube-like topology.

(d) Multistage switching network: Uses multiple stages of switching elements for
data transfer.

13. Describe the basic types of multiprocessor operating systems.

Answer:
(a) Separate Supervisors: Each processor has its own OS instance.

(b) Master/Slave: One processor (master) manages OS functions while others


(slaves) handle computations.

(c) Symmetric Multiprocessing (SMP): All processors share the OS and resources
equally.

14. Discuss the various issues for multiprocessor operating system design.

Answer:
(a) Processor scheduling: Allocating processors efficiently.

(b) Memory management: Managing shared and private memory.

(c) Inter-process communication: Ensuring efficient synchronization.

(d) Scalability: Handling a growing number of processors.

(e) Fault tolerance: Ensuring system reliability despite failures.


JAVA PROGRAMMING (102)

CHAPTER 1

Self-Assessment Questions – 1

1. The earlier name of Java was ___________________.

Answer: Oak

2. The members of Green Project were _______________,


_______________and ______________.

Answer: Patrick Naughton, Mike Sheridan, James Gosling

3. _________________ is the first graphical browser.

Answer: Mosaic

Self-Assessment Questions – 2

4. _________________ is the process of converting typed code to machine


code.

Answer: Compilation

5. Java code is ___________________, so that it can easily run on any


system.

Answer: Portable

6. Java bytecode can be interpreted on any system that provides a


___________________.

Answer: Java Virtual Machine (JVM)

7. _________________ is the ability of an application to perform multiple


tasks at a time.

Answer: Multithreading

8. Java is both _________________ and _________________.

Answer: Compiled, Interpreted


9. The Java Virtual Machine (JVM) maintains a lot of runtime information
about the program and the objects in the program. (True/False)

Answer: True

Self-Assessment Questions – 3

10. JVM is platform dependent because configuration of each OS differs.


(True/False)

Answer: True

11. The ___________________ is the runtime portion of Java software, which


is all you need to run it in your Web browser.

Answer: Java Runtime Environment (JRE)

12. Which of the following is used to develop Java software and is an


extended subset of a Java software development kit (SDK)?
(a) Java Development Kit (JDK)
(b) JRE
(c) JVM
(d) Applet

Answer: (a) Java Development Kit (JDK)

13. What is the Java command to disassemble Java files and print
representation of Java bytecode?
(a) javap
(b) javac
(c) javadoc
(d) jar

Answer: (a) javap

Self-Assessment Questions – 4

15. _________________ is used to create and manage public keys, private


keys, and security certificates.

Answer: Keytool

16. All information which is managed by keytool is stored in a database called


________________.

Answer: Keystore

17. Sun Microsystems includes a default key store that uses a new file format
called ________________.
Answer: JKS (Java Key Store)

18. Java archival tool used for packaging all Java programs and resource
files into a single archive file is ________________.

Answer: Jar

18. _________________ was the first programming language that could be


used to send interactive programs over the World Wide Web.

Answer: Java

19. A ________________ is an encrypted file or files that accompany a


program, indicating exactly from whom the file came.

Answer: Digital signature

20. The document that represents this digital signature is called a


_______________.

Answer: Certificate

Terminal Questions

21. Explain any five features of Java.

Answer:

(a) Simple: Java is easy to learn and use.

(b) Object-Oriented: Java follows object-oriented principles like encapsulation and


inheritance.

(c) Portable: Java bytecode can be executed on any platform with JVM.

(d) Secure: Java enforces strong security features through runtime checks.

(e) Multithreaded: Java allows concurrent execution of multiple threads.

22. What is Bytecode? Explain in brief.

Answer: Bytecode is a highly optimized set of instructions executed by the Java


Virtual Machine (JVM). Java programs are compiled into bytecode, which is platform-
independent and can run on any system with a JVM.

23. Write short notes on JDK and SDK.

Answer:
JDK (Java Development Kit): A complete software development kit that includes tools
like compiler, debugger, and JVM for Java programming.

SDK (Software Development Kit): A set of development tools used to develop software
applications for a specific platform.

24. List any ten Java command tools with a short description of each.

Answer:
(a) javac: Compiles Java source code into bytecode.
(b) java: Executes Java bytecode.
(c) javadoc: Generates API documentation from Java source code.
(d) jar: Packages Java classes into a single archive file.
(e) javap: Disassembles Java class files.
(f) jdb: Java debugger tool.
(g) jcmd: Sends diagnostic command requests to JVM.
(h) jhat: Java heap analysis tool.
(i) jconsole: Monitors and manages Java applications.
(j) keytool: Manages security keys and certificates.

25. Explain jar archival tool and jarsigner in brief.

Answer:

Jar Archival Tool: Used to compress multiple Java files into a single archive file (.jar).

Jarsigner: Digitally signs a JAR file to ensure its authenticity and integrity.

CHAPTER 2

Self-Assessment Questions – 1

1. The JAVA program converted into an intermediate language


representation by a compiler is called __________________.

Answer: Bytecode

2. The concept of __________________ is possible in Java.

Answer: Write once, run anywhere

Self-Assessment Questions – 2

3. The Type 3 comments are used for automatic generation of


documentation by a tool called _________________.
Answer: Javadoc

Self-Assessment Questions – 3

4. String is a __________________ data type in Java.

Answer: Abstract / Derived

Self-Assessment Questions – 4

5. Keywords can be used as a variable name. (True / False)

Answer: False

Self-Assessment Questions – 5

6. A _________________ access specifier allows the method to be


executed from another class.

Answer: Public

Self-Assessment Questions – 6

7. __________________ operator is used to create an object.

Answer: New

Self-Assessment Questions – 7

8. ___________________ is the extension for Java source code files.

Answer: .java

9. _________________ command is used to compile the Java source code.

Answer: Javac

10. ________________ command is used to execute the Java class file.

Answer: Java

Terminal Questions

11. Create a Candidate class with its attributes and methods.

Answer:

class Candidate {
String candidateName;
String candidateAddress;
String candidateCourse;

public Candidate() {
candidateName = "Arun";
candidateAddress = "Manipal";
candidateCourse = "BScIT";
}

public void displayDetails() {


System.out.println("Name: " + candidateName);
System.out.println("Address: " + candidateAddress);
System.out.println("Course: " + candidateCourse);
}
}

12. What do you mean by the statement: System.out.println(" ");

Answer:

This statement prints a blank line on the screen.

13. How do you compile a Java program?

Answer:

Java programs are compiled using the command: javac filename.java

14. How do you execute a Java program?

Answer:

Java class files are executed using the command: java classname

CHAPTER 3

Self-Assessment Questions – 1

1. Give the symbol for the modulus operator.

Answer: %

2. Give the symbol for the logical AND operator.

Answer: &&
3. If-else is a looping statement. (True / False)

Answer: False

4. Do…While is a decision-making statement. (True / False)

Answer: False

Terminal Questions

5. What are the different types of operators used in Java?

Answer:

Arithmetic Operators (+, -, *, /, %)

Unary Operators (++, --)

Comparison (Relational) Operators (==, !=, <, >, <=, >=)

Logical Operators (&&, ||, !)

Bitwise Operators (&, |, ^, ~, <<, >>)

6. What do you understand by operator precedence?

Answer:
• Operator precedence determines the order in which operators are evaluated
in an expression.

• Example: In the expression 10 + 5 * 8 - 15 / 5, multiplication and division are


evaluated first, resulting in 10 + 40 - 3 = 47.

• Operators are evaluated from left to right based on precedence.


• Parentheses () can be used to override the default precedence.

7. What are the different types of control statements?

Answer:

Decision-Making Statements:
• if-else
• switch-case

Looping Statements:
• for loop
• while loop
• do-while loop

Other Statements:
• break
• continue

8. Write a Java program to print the address of the study center.

Answer:

public class StudyCenter {


public static void main(String[] args) {
System.out.println("Study Center Address: 123, Java Lane, Programming
City");
}
}

Output:

Study Center Address: 123, Java Lane, Programming City

9. Write a Java program to convert Rupees to Dollars.

Answer:

import java.util.Scanner;

public class CurrencyConverter {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter amount in Rupees: ");
double rupees = scanner.nextDouble();
double dollars = rupees / 74.50; // Example conversion rate
System.out.println("Equivalent in Dollars: $" + dollars);
scanner.close();
}
}

Output (Example Input: 7450):

Enter amount in Rupees: 7450


Equivalent in Dollars: $100.0

10. Write a Java program to compare whether your height is equal to your
friend's height.

Answer:

import java.util.Scanner;
public class HeightComparison {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter your height in cm: ");
int myHeight = scanner.nextInt();
System.out.print("Enter your friend's height in cm: ");
int friendHeight = scanner.nextInt();

if (myHeight == friendHeight) {
System.out.println("Both of you have the same height.");
} else {
System.out.println("Your heights are different.");
}
scanner.close();
}
}

Output (Example Input: 170, 175):

Enter your height in cm: 170


Enter your friend's height in cm: 175
Your heights are different.

11. Write a Java program to find the sum of 1+3+5+…. for 10 terms in the
series.

Answer:

public class OddNumberSum {


public static void main(String[] args) {
int sum = 0, term = 1;

for (int i = 0; i < 10; i++) {


sum += term;
term += 2; // Move to next odd number
}

System.out.println("Sum of first 10 odd numbers: " + sum);


}
}

Output:

Sum of first 10 odd numbers: 100

CHAPTER 4
Self-Assessment Questions – 1

12. ____________ represents a number of variables which occupy


contiguous spaces in the memory.

Answer: Array

13. Each element in the array is distinguished by its _______________.

Answer: Index

14. In Java, a _____________ is a sequence of characters.

Answer: String

Self-Assessment Questions – 2

15. To extract a single character from a String, you can use


________________ method.

Answer: charAt()

16. To extract more than one character at a time, you can


use______________ method.

Answer: getChars()

17. To compare two strings for equality, use_________________ method.

Answer: equals()

Self-Assessment Questions – 3

18. _____________ method searches for the first occurrence of a character


or substring.

Answer: indexOf()

19. ____________ method searches for the last occurrence of a character or


substring.

Answer: lastIndexOf()

20. You can extract a substring using _______________ method.

Answer: substring()

Self-Assessment Questions – 4
21. To set the length of the buffer within a StringBuffer object, use
______________ method.

Answer: setLength()

22. The _________________ method concatenates the string representation


of any other type of data to the end of the invoking StringBuffer object.

Answer: append()

23. You can reverse the characters within a StringBuffer object using
________________ method.

Answer: reverse()

Terminal Questions

24. What do you mean by an array? Explain with an example.

Answer: An array represents a collection of variables that occupy contiguous


memory locations and share the same data type.

Example:

int numbers[] = {10, 20, 30, 40, 50};

25. List out with examples various character extraction functions available
in Java.

Answer:

(a) charAt(int index) – Extracts a single character.

(b) getChars(int start, int end, char[] target, int targetStart) – Extracts multiple
characters.

(c) getBytes() – Converts a string into a byte array.

Example:

String str = "Java";


char ch = str.charAt(1); // Extracts 'a'

26. List out various String comparison functions in Java.

Answer:

(a) equals() – Compares two strings (case-sensitive).


(b) equalsIgnoreCase() – Compares two strings (case-insensitive).

(c) compareTo() – Compares strings lexicographically.

(d) regionMatches() – Compares specific regions within strings.

Example:

String str1 = "Hello";


String str2 = "hello";
boolean result = str1.equalsIgnoreCase(str2); // Returns true

27. What are the functions available in Java to modify a String? Explain with
examples.

Answer:
(a) concat() – Concatenates strings.

(b) replace(char oldChar, char newChar) – Replaces characters.

(c) trim() – Removes leading and trailing spaces.

(d) toUpperCase() / toLowerCase() – Changes case.

Example:

String str = " Java ";


str = str.trim(); // Removes spaces

28. List out the functions provided by StringBuffer class in Java.

Answer:
(a) length() – Returns the number of characters in the buffer.
(b) capacity() – Returns the current capacity.
(c) setLength(int newLength) – Sets the buffer length.
(d) append(String str) – Adds text to the buffer.
(e) insert(int index, String str) – Inserts a string.
(f) reverse() – Reverses the content.

Example:

StringBuffer sb = new StringBuffer("Hello");


sb.append(" World"); // "Hello World"
sb.reverse(); // "dlroW olleH"

CHAPTER 5
Self-Assessment Questions

1. _____________ is one of the features of object-oriented programming


that allows the creation of hierarchical classifications.

Answer: Inheritance

2. A class that is inherited is called a ___________.

Answer: Superclass

3. The class that does the inheriting is called a ___________.

Answer: Subclass

4. Engine has a ___________ relationship with an automobile.

Answer: Part-of

5. ___________, ___________, and ___________ are the three types of


access specifiers in Java.

Answer: Public, Private, Protected

6. _____________ is the mechanism in Java through which the class


namespace is partitioned into more manageable chunks.

Answer: Package

7. _____________ keyword is used to define a package.

Answer: package

8. In Java, multi-leveled packages can be created. (True / False)

Answer: True

9. The specific location that the Java compiler will consider as the root of
any package hierarchy is controlled by _______________.

Answer: CLASSPATH

10. _____________ symbol denotes the current working directory.

Answer: . (dot)

11. _____________ is the mechanism through which you can specify what a
class must do, but not how it does it.

Answer: Interface
12. Variables declared inside the interface declarations are implicitly
____________ and ____________.

Answer: Final, Static

Terminal Questions

13. What are the different types of relationships?

Answer:
(a) A-Kind-Of Relationship
(b) Is-A Relationship
(c) Part-Of Relationship
(d) Has-A Relationship

14. How do you implement inheritance in Java?

Answer: Inheritance in Java is implemented using the extends keyword.

Syntax:

public class SubclassName extends SuperclassName {


// Body of class
}

14. What are the rules for overriding a method in Java?

Answer:
(a) The method name and the order of arguments must be identical to that of the
superclass method.

(b) The return type of both the methods must be the same.

(c) The overriding method cannot be less accessible than the method it overrides
(e.g., a public method in the superclass cannot be overridden as private).

(d) The overriding method cannot raise more exceptions than those raised by the
superclass method.

15. What are the uses of interfaces?

Answer:
(a) Interfaces can be used to mix in generally useful constants.

(b) They allow multiple classes to implement common methods without using
multiple inheritances.
(c) They help in separating design from implementation.
16. What are the differences between an interface and an abstract class?

Answer: An abstract class is an incomplete class that requires further


specialization, whereas an interface is just a specification of behavior. Interfaces allow
multiple inheritances, whereas abstract classes do not. An abstract class can have
implemented methods, but an interface only contains method signatures.

CHAPTER 6

Self-Assessment Questions

1. The term exception denotes a/an ____________.

Answer: Exceptional event

2. Java handles exceptions in the ____________ way.

Answer: Object-oriented

3. The class at the top of the exception classes hierarchy is


_____________.

Answer: Throwable

4. ______________ and ____________ classes are derived from Throwable


class.

Answer: Error, Exception

5. Exception classes are available in __________ package.

Answer: java.lang

6. When exceptional arithmetic conditions occur, such as division by zero,


which exception is thrown?

Answer: ArithmeticException

7. Which exception is thrown when an attempt is made to access an array


index out of bounds?

Answer: ArrayIndexOutOfBoundsException

Terminal Questions
8. What is the difference between errors and exceptions?

Answer:
Errors are serious problems that cannot be handled by an application (e.g.,
OutOfMemoryError).

Exceptions are conditions that applications might want to catch and handle (e.g.,
IOException).

9. What are the different types of exceptions?

Answer:

(a) Checked Exceptions (e.g., IOException, SQLException)


(b) Unchecked Exceptions (e.g., NullPointerException, ArithmeticException)
(c) Errors (e.g., OutOfMemoryError, StackOverflowError)

10. What are the different exception handling techniques?

Answer:
(a) try-catch: Used to handle exceptions by enclosing risky code in a try block
and catching exceptions in a catch block.

(b) finally: A block that always executes, regardless of whether an exception


occurs.
(c) throw: Used to explicitly throw an exception.
(d) throws: Declares an exception in the method signature.

11. How do we create custom exception classes? Provide an example.

Answer: Custom exceptions are created by extending the Exception class.

Example:

class InvalidAgeException extends Exception {


InvalidAgeException(String message) {
super(message);
}
}

public class TestCustomException {


static void validateAge(int age) throws InvalidAgeException {
if (age < 18) {
throw new InvalidAgeException("Age must be 18 or above.");
}
}

public static void main(String[] args) {


try {
validateAge(15);
} catch (InvalidAgeException e) {
System.out.println("Exception caught: " + e.getMessage());
}
}
}

CHAPTER 7

Self-Assessment Questions

1. Java handles all input and output in the form of ___________.

Answer: Streams

2. The two basic streams used are the _______ and the ________ streams.

Answer: Input, Output

3. _________ are used to read data from one stream and write it to another
stream.

Answer: Filters

4. ____________ provide the capability of placing “bookmarks” on the


stream and resetting it.

Answer: Markable Streams

5. ______________ method writes the specified byte of data to the output


stream.

Answer: void write(int n)

6. ____________ and______________ streams are classified as mode


streams as they read and write data from disk files.

Answer: FileInputStream, FileOutputStream

7. The _____________ and ____________ classes are the filter streams that
allow the reading and writing of Java primitive data types.

Answer: DataInputStream, DataOutputStream

8. The _______ and _________ classes are abstract classes that support the
reading and writing of Unicode character streams.

Answer: Reader, Writer


9. Unicode is used to represent data such that each character is represented
by ___________.

Answer: 16 bits

10. The most important subclasses of the Reader and Writer classes are
__________ and ___________.

Answer: InputStreamReader, OutputStreamWriter

11. Java provides the ________ class to perform I/O operations at specified
locations within a file.

Answer: RandomAccessFile

12. The RandomAccessFile class implements the __________ and ________


interfaces.

Answer: DataInput, DataOutput

13. The capability of an object to exist beyond the execution of the program
that created it is known as ___________.

Answer: Persistence

14. ____________ is the key to implement persistence.

Answer: Serialization

Terminal Questions

15. What are the uses of a stream class?

Answer:

(a) Streams abstract the details of input/output (I/O) operations.


(b) They provide a standard mechanism to read/write data from various sources
like files, memory, and network.

16. What is the syntax of FileInputStream and FileOutputStream?

Answer:

FileInputStream inputfile = new FileInputStream("Employee.dat");

FileOutputStream outputfile = new FileOutputStream("binus.dat");

17. What are the different methods under DataInputStream and


DataOutputStream?
Answer:

(a) DataInputStream methods:


boolean readBoolean()
byte readByte()
char readChar()
int readInt()

(b) DataOutputStream methods:


void writeChar(int v)
void writeLong(long v)
void writeInt(int v)

18. What are the uses of random access file over sequential access file?

Answer:

(a) Random access files allow data to be read or written at any position within the
file.

(b) Unlike sequential access files, which require reading from the beginning to
reach a specific location, random access allows efficient file operations.

19. Mention the use of Stream API.

Answer:

(a) The Java Streams API provides a functional programming approach to


process collections of objects.

(b) It allows operations like filtering, mapping, sorting, and reducing large data
sets efficiently.

CHAPTER 8

Self-Assessment Questions

1. The collection ______________.

Answer: Extends Iterable class

2. List, Set, and Queue extend collection. (True / False)

Answer: True

3. _____________ is the root and fundamental interface of collections in


Java.
Answer: Collection

4. Which interface is part of the collection framework but doesn’t inherit the
collection interface?
(a) Set
(b) List
(c) Map
(d) None

Answer: (c) Map

5. Which interface handles sequence?


(a) Set
(b) List
(c) Map
(d) Collection

Answer: (b) List

6. Which of the following is an outdated class but still in use?


(a) ArrayList
(b) Vector
(c) Hashtable
(d) Both (b) and (c)

Answer: (d) Both (b) and (c)

7. All methods must be implemented in an interface. (True / False)

Answer: True

8. Which of the following is true about methods in an interface in Java?


(a) An interface can contain only abstract methods
(b) We can define a method in an interface
(c) Private and protected access modifiers can also be used to declare methods in
Java
(d) None of the above

Answer: (a) An interface can contain only abstract methods

9. A list interface is also called a _________ interface.

Answer: Sequence

10. The three main iterators in Java are ______, ______, ______.

Answer: Enumeration, Iterator, ListIterator


11. The Iterator supports the replacement or insertion of new elements.
(True / False)

Answer: False

12. Java programs are:


(a) Faster than others
(b) Platform independent
(c) Not scalable
(d) Not reusable

Answer: (b) Platform independent

13. Which of the following packages stores all standard classes?


(a) lang
(b) java
(c) util
(d) java.packages

Answer: (b) java

14. _____________ is a subtype of Hashtable.

Answer: Properties

Terminal Questions

15. Explain the List interface.

Answer: The List interface represents an ordered collection of elements that


allows duplicates. It provides positional access, search, iteration, and range-view
operations. Implementations: ArrayList, LinkedList, Vector.

16. What are the limitations of HashSet?

Answer:
(a) HashSet does not maintain insertion order.
(b) It does not allow duplicate elements.
(c) It uses hashing, so performance may degrade if the initial capacity is too high
or too low.

17. List the categories of collection classes.

Answer:
(a) List (e.g., ArrayList, LinkedList)
(b) Set (e.g., HashSet, TreeSet)
(c) Queue (e.g., PriorityQueue, Deque)
(d) Map (e.g., HashMap, TreeMap)
18. Define the Properties class in Java collections.

Answer: The Properties class is a subclass of Hashtable. It is used for


managing configuration settings stored as key-value pairs in .properties files.

19. Why do you need collection classes?

Answer: Collections provide dynamic data structures that can grow and shrink in
size. They offer powerful algorithms for sorting, searching, and iteration. They
improve performance by providing optimized implementations like HashMap and
ArrayList.

20. Explain the hierarchy of the Collection framework.

Answer:

The Collection framework consists of fundamental interfaces:


(a) Collection (root interface)
(b) List (ordered collection)
(c) Set (unique elements)
(d) Queue (FIFO order)
(e) Map (key-value pairs, does not extend Collection)
It also includes utility classes like Collections and Arrays.

21. Mention and describe different kinds of iterators in Java collections.


Answer:

(a) Enumeration: Used for legacy classes (Vector, Hashtable).


(b) Iterator: Can iterate over List, Set, Queue, and Map.
(c) ListIterator: Supports bidirectional iteration for List implementations.

22. Explain the difference between Comparable and Comparator interfaces.

Answer:

(a) Comparable: Used for natural ordering of objects. Implemented using


compareTo().

(b) Comparator: Provides custom sorting logic. Implemented using compare().

Example:

class Employee implements Comparable<Employee> {


int id;
String name;

public int compareTo(Employee e) {


return this.id - e.id;
}
}
CHAPTER 9

Self-Assessment Questions

1. Who is the father of Java?

Answer: James Gosling

2. Java was released in 1999? (True/False)

Answer: False

3. Which principle of Java aids in multitasking?

Answer: Multithreading

4. What are the smallest units of processing?

Answer: Threads

5. Threads are heavy and difficult to process. (True/False)

Answer: False

6. When a thread is inactive, it exists in which stage?


(a) Running
(b) Blocked
(c) Suspended
(d) Terminated

Answer: (c) Suspended

7. What are the high-priority threads also known as?

Answer: User threads or main threads

8. Which method is used to convert a user thread to a daemon thread?

Answer: setDaemon(True)

9. There are 5 ways to create and run a thread. (True/False)

Answer: False

10. The components of a thread class are called ________________.


(a) Objects
(b) Units
(c) Constructors
(d) None of the above

Answer: (c) Constructors

11 Which method is always targeted for overriding?

Answer: run()

12. Which function calls the execution of the run() method?


(a) main()
(b) start()
(c) Thread()
(d) None of the above

Answer: (b) start()

13. When the Thread class extension method is used, unique ____________
are created and they consume ____________.

Answer: Objects, memory spaces

14. The Thread Class Extension method is the more preferable method for
thread creation and running. (True/False)

Answer: False

15. What benefits are lost in thread class extension?

Answer: Inheritance benefits

16. A thread can be created by ________________.

Answer: Extending Thread class and implementing Runnable interface

17. What are blocks or segments of code that are executed only when they
are called?

Answer: Methods

18. Which method suspends the thread for a certain period and shifts the
thread into the Suspended stage?
(a) void start()
(b) void yield()
(c) void sleep()
(d) None of the above

Answer: (c) void sleep()


19. The isAlive() method starts the execution of a thread. (True/False)

Answer: False

20. Synchronization of threads avoids problems caused by


________________ and ________________.

Answer: Thread interference and consistency issues

21. The objects in Java are all associated individually with a


________________, and only ________________ can lock or unlock these
________________.

Answer: Monitor, threads, monitors

22. What works by reusing available or previously created threads to execute


tasks?

Answer: Thread pools

23. The longer the threads wait for information, the higher the
________________ of CPU cycles.

Answer: Wastage

Terminal Questions

24. What is multithreading?

Answer: Multithreading is the capability of a CPU to execute multiple threads


concurrently to improve efficiency and performance.

25. What are threads?

Answer: Threads are lightweight processes that can run independently while sharing
memory space with other threads.

26. Explain synchronization of threads.

Answer: Synchronization ensures that multiple threads do not interfere with each other
while accessing shared resources, preventing data inconsistency.

27. List the key methods of threads.

Answer:
(a) start(): Begins execution of a thread

(b) run(): Entry point for the thread

(c) sleep(): Puts the thread to sleep for a specified time


(d) yield(): Temporarily pauses the thread execution

(e) join(): Makes one thread wait for another to complete

(f) isAlive(): Checks if a thread is still running

28. What is inter-thread communication?

Answer: Inter-thread communication allows multiple threads to communicate with


each other using methods like wait(), notify(), and notifyAll() to prevent resource
contention.

29. Elaborate on how you would create and start a thread.

Answer: Threads can be created in two ways:

(a) Implementing Runnable Interface:

class MyThread implements Runnable {


public void run() {
System.out.println("Thread is running...");
}
}
public class Main {
public static void main(String[] args) {
Thread t = new Thread(new MyThread());
t.start();
}
}

(b) Extending Thread Class:

class MyThread extends Thread {


public void run() {
System.out.println("Thread is running...");
}
}
public class Main {
public static void main(String[] args) {
MyThread t = new MyThread();
t.start();
}
}

30. Compare non-synchronized vs. synchronized threads and their outputs.

Answer:
(a) Non-Synchronized Threads: Multiple threads accessing the same resource
may result in data inconsistency.

(b) Synchronized Threads: Ensures controlled access using synchronized keyword


to prevent conflicts.

Example (Synchronized Block):

class Table {
synchronized void printTable(int n) {
for (int i = 1; i <= 5; i++) {
System.out.println(n * i);
}
}
}

31. How does synchronization work? Elaborate on the two types of thread
synchronization.

Answer:

(a) Mutual Exclusion: Only one thread can access a shared resource at a time.

(b) Cooperation: Threads work together using wait(), notify(), and notifyAll().

32. What are the challenges with multithreading and how are they addressed?

Answer:

(a) Deadlocks: Resolved using proper thread synchronization techniques.

(b) Thread Interference: Handled using synchronized methods.

(c) Resource Starvation: Prevented using priority-based scheduling.

CHAPTER 10

Self-Assessment Questions

1. If assertion is enabled, then the assert statement will be evaluated.


Otherwise, it does not get executed. (True/False)

Answer: True
2. While executing assertion, it is believed to be true. If it fails, JVM will throw
an error named ____________.

Answer: AssertionError

3. The ___________ allows the method to accept zero or multiple


arguments.
Answer: varargs

4. The ____________ feature of Java 5 facilitates the Java programmer to


access any static member of a class directly.

Answer: Static Import

5. The automatic conversion of primitive data types into its equivalent


Wrapper type is known as ________ and opposite operation is known as
________.

Answer: Autoboxing, Unboxing

6. The Java compiler applies unboxing when an object of a wrapper class is


assigned to a variable of the corresponding ________ type.

Answer: Primitive

7. Java ____________ can be thought of as classes that have a fixed set of


constants.

Answer: Enums

8. The enum can be defined within or outside the class. (True/False)

Answer: True

9. The __________ element is used to declare an annotation.

Answer: @interface

10. An annotation that has no method is called __________ annotation.

Answer: Marker

11. The __________ annotation marks the annotation to be inherited to


subclasses.
.
Answer: @Inherited

12. _____________ is that language that is formed on an object-oriented


programming model, and it is easy to establish and utilize by programmers.
Answer: Java

13. _____________ framework is employed for evaluating codes of Java.

Answer: JUnit

14. Testing is used to remove ___________ bugs.

Answer: Regression

15. Manual testing is preferred over automated testing. (True/False)

Answer: False

16. Testing is the process of checking whether the application is giving the
desired output or not. (True/False)

Answer: True

17. Which of the following can be considered as the benefit of manual


testing?
(A) Bugs can be easily found and removed
(B) The programmers spend more time refining their code
(C) Both A and B
(D) None of these

Answer: (C) Both A and B

18. __________________ present a fact after comparing the expected and the
actual output according to the method used.

Answer: Assertion

19. assertEquals has _________________ parameters.

Answer: Three

20. Select _____________ in the Java editor to create a new JUnit test case.

Answer: MyClass

21. assertCheckTrue is a method in the assert class. (True/False)

Answer: False

22. assertNotNull is a method in the assert class. (True/False)

Answer: True

23. Which of the following is not a method in the assert class?


(A) assertFalse
(B) assertCheckFalse
(C) assertSame
(D) assertNotEquals

Answer: (B) assertCheckFalse

Terminal Questions

24. What is Autoboxing and Unboxing in Java? Explain with an example.

Answer:

Autoboxing is the automatic conversion of a primitive data type into its corresponding
wrapper class by the compiler.

Unboxing is the opposite process where a wrapper class object is converted back to
its primitive type.

Example:

Integer num = 10; // Autoboxing


int value = num; // Unboxing

25. What are the different types of annotations?

Answer:

(a) Marker Annotation: No methods, only metadata (@Override)

(b) Single-Value Annotation: One method (@SuppressWarnings("unchecked"))

(c) Multi-Value Annotation: Multiple methods (@MyAnnotation(value1=10,


value2="Test"))

26. Explain Java Static Import with an example.

Answer: The import static feature allows accessing static members of a class
without qualifying them with the class name.

Example:

import static java.lang.System.out;


public class StaticImportExample {
public static void main(String[] args) {
out.println("Hello, Java!");
}
}
27. What is JUnit?

Answer: JUnit is an open-source unit testing framework for Java that helps
automate testing.

28. What is the difference between manual and automated testing?

Answer:

Manual Testing: Performed manually by testers, time-consuming.

Automated Testing: Uses tools like JUnit to test automatically.

29. What is Unit Testing?

Answer: Unit testing is the practice of testing individual units (methods, classes)
of software to validate their correctness.

30. What are some of the features of JUnit?

Answer:
(a) Open-source framework
(b) Provides annotation support
(c) Supports assertions for testing

31. Write annotations of JUnit5.

Answer:
(a) @Test – Marks a test method
(b) @BeforeEach – Runs before each test
(c) @AfterEach – Runs after each test
(d) @RepeatedTest(n) – Repeats test n times

32. Explain JUnit5 architecture.

Answer:
(a) JUnit 5 consists of three components:
(b) JUnit Platform: Foundation for test execution
(c) JUnit Jupiter: New programming model
(d) JUnit Vintage: Supports older JUnit versions

33. Why is JUnit5 better than previous versions?

Answer:

(a) Modular structure


(b) More annotations and better support for Java 8+
(c) Supports dynamic and nested tests
CHAPTER 11

Self-Assessment Questions

1. When the user interacts with the application by pressing a key or


clicking a mouse button, what is generated?

Answer: ActionEvent

2. Which class is at the top of the event class hierarchy?

Answer: EventObject

3. What is the name of the component that registers a listener, which


contains event handlers?

Answer: Event-handler

4. Which JavaFX package contains a set of classes responsible for the


JavaFX application life cycle?

Answer: javafx.application

5. Which JavaFX node manages the web engine and displays its contents?

Answer: WebView

6. In a static layout, when are the position and size of nodes calculated?

Answer: Once

7. Which JavaFX package contains classes to add transition-based


animations such as fill, fade, rotate, scale, and translation?

Answer: javafx.animation

8. Java Foundation Classes are a superset that contains AWT and is


completely written in ___________.

Answer: Java

9. Swing components are all part of which package?

Answer: javax.swing

10. A scene represents the ___________ of a JavaFX application.


Answer: Physical contents

Terminal Questions

11. What are the important packages of Java Swing?

Answer:
(a) javax.swing (Main Swing package)
(b) javax.swing.plaf (Look and feel)
(c) javax.swing.event (Event handling)
(d) javax.swing.table (Tables)
(e) javax.swing.tree (Trees)

12. What are the important packages of JavaFX?

Answer:
(a) javafx.animation (Animations)
(b) javafx.application (Application lifecycle)
(c) javafx.scene (Scene graph and UI elements)
(d) javafx.stage (Top-level window container)
(e) javafx.event (Event handling)

13. What are the important steps required to create a JavaFX FXML
Application?

Answer:
(a) Create a JavaFX project in an IDE
(b) Use an FXML file to define UI elements
(c) Load FXML using FXMLLoader
(d) Implement a controller class to handle events

14. Briefly explain the Adapter class.

Answer: An Adapter class provides a default implementation of listener interfaces.


It helps avoid overriding all methods in an interface when only a few are needed.
Example: WindowAdapter for handling window events.

15. Describe the Node class in JavaFX.

Answer: A Node is a visual object in the JavaFX scene graph. It can be a UI


control, shape, or image. Examples: Rectangle, Text, Button, Group, etc.

16. Explain the concept of Event Handling.

Answer: Event handling allows Java programs to respond to user actions. Events
originate from event sources like buttons, key presses, or mouse clicks. Handlers
process events via interfaces like ActionListener.

17. What are the heavyweight AWT components?


Answer:
(a) Button (Push button)
(b) Checkbox (Toggle button)
(c) List (Scrollable list)
(d) Menu (Pull-down menu)
(e) TextField (Single-line text input)

18. Write short notes on Java Foundation Classes (JFC).

Answer: JFC is a set of libraries for building graphical applications in Java. It


includes AWT, Swing, and Accessibility APIs. Swing is a lightweight, platform-
independent framework for UI development.

19. List the Java Swing Component classes.

Answer:
(a) JButton (Button)
(b) JTextField (Text input)
(c) JLabel (Display text)
(d) JPanel (Container)
(e) JTable (Table view)

20. Explain the Architecture of JavaFX API.

Answer: JavaFX is based on a Scene Graph. It contains a hierarchy of nodes


like UI controls, shapes, and media elements. JavaFX applications consist of a
Stage, Scene, and Nodes.

CHAPTER 12

Self-Assessment Questions

1. Java API stands for ________________.

Answer: Java Application Programming Interface

2. Give some examples of DBMS products.

Answer: MS-Access, SQL Server, MySQL, Oracle, Sybase

3. <protocol> in a JDBC URL is always _______________.

Answer: jdbc

4. <subprotocol> in JDBC URL must be ________________.


Answer: odbc

5. __________________ is used to identify the database in the JDBC URL.

Answer: <subname>

6. A ___________ is a collection of related information, and a ___________


is the software that provides a mechanism to manipulate data in the database.

Answer: Database, Database Management System (DBMS)

7. MS-Access stores the data in __________ file format, whereas MS-SQL


Server stores the data in __________ file format.

Answer: .MDB, .DAT

8. Which tool keeps the object model and persistence model separate from
each other?
(a) ORM
(b) OTM
(c) OPM
(d) Operational Relational Mapping

Answer: (a) ORM

9. Which one of the following is also known as a code library?


(a) Operational Relational Mapping
(b) Object Relational Manager
(c) Object Relational Mapping
(d) Operation Role Mapping

Answer: (b) Object Relational Manager

10. Full form of ORM is ___________.

Answer: Object Relational Mapping

11. The problem of identity in mismatch paradigm can be solved using


____________.

Answer: Surrogate keys

12. ORM is a programming language. (True/False)

Answer: False

13. ORM has no major role to play in Hibernate and is not associated with
JPA. (True/False)
Answer: False

14. Which of the following is known as a full-text library of Hibernate?


(a) ORM
(b) API
(c) Hibernate Search
(d) None of the above

Answer: (c) Hibernate Search

15. Which of the following are not related to Hibernate?


(a) ORM
(b) JPA
(c) Hibernate Shards
(d) None of the above

Answer: (d) None of the above

16. Hibernate ORM provides a framework in Java to map an object-oriented


domain model to a database. (True/False)

Answer: True

17. Hibernate is a closed-source framework. (True/False)

Answer: False

18. _________________ is responsible for auditing persistent classes.

Answer: Hibernate Envers

19. Which of the following is not a component of class-level architecture of


JPA?
(a) Query
(b) Entity
(c) Entity Manager
(d) Coding

Answer: (d) Coding

20. Persistence is used to obtain the Entity Manager Factory instances.


(True/False)

Answer: True

21. Query is an interface implemented by each JPA vendor. (True/False)

Answer: True

22. _______________ is stored in database records.


Answer: Entity

23. _______________ is the full form of API.

Answer: Application Programming Interface

Terminal Questions

24. What is JDBC?

Answer: JDBC stands for Java Database Connectivity. It is an API that enables
Java applications to interact with databases. It allows Java applications to execute
SQL queries and retrieve results.

25. Draw and explain the JDBC Application Architecture.

Answer: JDBC architecture consists of:


(a) JDBC API: Provides methods for querying and updating databases.

(b) JDBC Driver Manager: Handles the selection and management of drivers.

(c) JDBC Drivers: Translates API calls into database-specific calls.


(d) Database: Stores and manages data.

26. How will you load the ODBC driver?

Answer:
(a) Click on the ODBC Data Source icon in the Control Panel.

(b) Click on "Add."

(c) Select "SQL Server" from the list and click on "Finish."

(d) Enter the data source name and click "Next."

(e) Select SQL Server authentication and enter login credentials.

(f) Select the database and click "Next."

(g) Click "Finish" and test the data source connectivity.


DATABASE MANAGEMENT SYSTEM (104)

CHAPTER 1

Self-Assessment 1

1. What is a repository of data intended to assist proficient storage of data,


retrieval, and preservation called?

a. DBMS
b. ADBMS
c. Database ✅
d. RDBMS

2. DBMS can provide a simultaneous implementation of different portions


of the database. (True/False)

✅ True

Self-Assessment 2

3. For sharing data among clients, the most frequent way is the creation of
two-tier client/server databases. (True/False)

✅ True

4. An application program comprises two components, one being the GUI.


Name the other component.
a. Presentation logic
b. Business logic ✅
c. Message logic
d. User interface logic

5. The requirements of information from various branches and divisions are


successfully supported by a _________ database.

Answer: Enterprise Database

Self-Assessment 3

6. In a _________ schema, we organize data into a structure that appears as


a tree.

Answer: Hierarchical Schema


7. Network schema provides permission for only 1:1 relationships.
(True/False)

❌ False

8. In case of a relational schema, every tuple is separated into fields known


as ________.

Answer: Domains

9. Which of the following is NOT considered a logical structure of a


database?
a. Tree
b. Relational
c. Network
d. Chain ✅

10. Relational model makes use of some unknown terminology. A tuple is


said to be equal to a _________.

Answer: Row in a table

11. Logical data structure having a 1:M relationship is considered as a:


a. Network
b. Tree ✅
c. Chain
d. Relation

Self-Assessment 4

12. It is easy to preserve and update the _________ database.

Answer: Centralized

13. In the case of a distributed database, data is handled by numerous


servers. (True/False)

✅ True

Terminal Questions and Answers

Q1: Explain the hierarchical model and network model.

Answer:
Hierarchical Model organizes data in a tree-like structure where each node has one
parent but can have multiple children.
Network Model is similar but allows multiple parent-child relationships, forming a
network structure.

Q2: Describe a relational model and its characteristics.

Answer:

The Relational Model represents data as a collection of tables (relations).


Each table consists of rows (tuples) and columns (attributes).
Data integrity, normalization, and ACID compliance are key features.

Q3: Explain the significance of a database.

Answer:

(a) Reduces data redundancy


(b) Enhances data security
(c) Supports multi-user access
(d) Ensures data integrity and consistency
(e) Provides backup and recovery mechanisms

Q4: Discuss the various applications of a database.

Answer:

(a) E-commerce: Storing customer transactions


(b) Healthcare: Managing patient records
(c) Banking: Storing customer account details
(d) Education: Student management systems

Q5: Briefly describe the network database model and differentiate it from the
hierarchical database model.

Answer:

(a) Network Database Model: Allows multiple parent-child relationships (N:M).


(b) Hierarchical Model: Follows a strict tree structure (1:M).
(c) Difference: The network model is more flexible and allows multiple
relationships, whereas the hierarchical model is rigid and follows a fixed structure.

Q6: What are the various types of Database Management Systems (DBMS)?
Briefly explain.

Answer: DBMS can be classified based on:

(a) Data Model: Hierarchical, Network, Relational, Object-Oriented


(b) Number of Users: Single-user, Multi-user
(c) Location of Data: Centralized, Distributed
(d) Cost: Open-source, Licensed
(e) Purpose: General-purpose, Special-purpose
Q7: Discuss the classification of DBMS based on the location of the database.

Answer:

(a) Centralized DBMS: Data stored at a single location.


(b) Distributed DBMS: Data is spread across multiple locations but managed
centrally.

Q8: Differentiate between centralized and distributed database systems.

Answer:
Feature Centralized Database Distributed Database
Location Stored in one place Data spread across multiple
locations
Administration Managed by a single server Managed by multiple servers
Ease of Maintenance Easier to maintain More complex to maintain
Cost Low High
Integrity Easier to ensure data integrity More difficult to maintain
consistency
Security More secure Requires additional security for
remote sites
Q9: What do you understand by the term RDBMS? When and by whom was it
developed?

Answer: RDBMS (Relational Database Management System) is based on the


relational model developed by E.F. Codd in the 1970s. It organizes data into tables
and follows ACID (Atomicity, Consistency, Isolation, Durability) properties.

Q10: Enumerate the advantages and disadvantages of RDBMS.

Answer:
Advantages:

✔ Supports ACID properties for data consistency.


✔ Eliminates redundancy through normalization.
✔ Easy data retrieval using SQL.
✔ Secure with role-based access control.

Disadvantages:

❌ Expensive setup and maintenance.


❌ Performance issues with very large datasets.
❌ Normalization can lead to complex queries.

CHAPTER 2
Self-Assessment 1

1. QBE stands for _________.

Answer: Query By Example (QBE)

2. SQL is supported by RDBMS. (True/False)

Answer: True

Self-Assessment 2

3. SELECT, INSERT, DELETE and UPDATE commands are used by


_________ to modify the data.

Answer: Data Manipulation Language (DML)

4. SQL commands define the actions to be taken to control _________.

Answer: Transactions

Self-Assessment 3

5. _________ is formed with the combination of PK and FK.

Answer: Referential Integrity

6. Domain integrity is also called as ‘_________' integrity.

Answer: Attribute Integrity

Self-Assessment 4

7. There are two types of DROP commands: CASCADE and RESTRICT.


(True/False)

Answer: True

8. _________ command helps in the creation of SQL relations.

Answer: CREATE TABLE

Self-Assessment 5

9. With the help of WHERE and _________ commands, it is possible to


embed a SQL statement into another.

Answer: HAVING

10. It is not possible to query multiple relations in SQL. (True/False)


Answer: False

Self-Assessment 6

11. A _________ is a subschema in which logical tables are generated from


more than one base table.

Answer: View

12. During the query execution, contents are taken from other tables.
(True/False)

Answer: True

Self-Assessment 7

13. To recognize embedded SQL requests to the pre-processor, we use the


_________ statement.

Answer: EXEC SQL

14. It is a good practice to append a colon before the host variables to


differentiate them from other variables used in SQL. (True/False)

Answer: True

Self-Assessment 8

15. SQL offers _________ statements that make the process of concurrent
transaction control easy.

Answer: COMMIT and ROLLBACK

16. In transaction processing, the integrity rules of a database are maintained


by _________ property.

Answer: Consistency

Self-Assessment 9

17. How does Normalization help?


A. By eliminating various database anomalies
B. By minimizing redundancy
C. By eliminating data inconsistency
D. All of the above ✅

18. An attribute (column) is said to be _____ if its value can be determined by


any one or more attributes of the primary key, but not all.
Answer: Partially Dependent

19. A table which is in __________ normal form may contain redundancies


due to transitive dependencies.

Answer: Second Normal Form (2NF)

20. The Fifth Normal Form is usually useful when we have large relational
data models. (True/False)

Answer: True

21. The join dependency is a more generalized form of __________


dependency.

Answer: Multivalued Dependency (MVD)

22. An FD is a special case of an MVD, and every FD is an MVD. (True/False)

Answer: True

23. The fifth normal form is also called __________.

Answer: Project-Join Normal Form (PJNF)

Self-Assessment 10

24. From a __________ point of view, it is standard to have tables that are in
Third Normal Form.

Answer: Relational Database

25. According to relational database rules, a completely normalized database


always has the best performance. (True/False).

Answer: False

26. Denormalization is done to increase the performance of the database.


(True/False).

Answer: True

Self-Assessment 11

27. Denormalization is a technique to move from higher to lesser normal


forms of database modeling in order to get faster access to the database.
(True/False).

Answer: True
28. _________ splits tables by rows, thus reducing the number of records per
table.

Answer: Horizontal Partitioning

Terminal Questions and Answers

Q1: What are the two common query languages supported by RDBMS?

A1: The two common query languages are:

SQL (Structured Query Language)


QBE (Query by Example)

Q2: What are the key SQL components?

A2: SQL includes the following components:

DDL (Data Definition Language) – CREATE, ALTER, DROP


DML (Data Manipulation Language) – SELECT, INSERT, UPDATE, DELETE
DCL (Data Control Language) – GRANT, REVOKE
TCL (Transaction Control Language) – COMMIT, ROLLBACK

Q3: What are integrity constraints in RDBMS?

A3: Integrity constraints are rules that ensure the correctness of data in a database.
They include:

Entity Integrity: Ensures uniqueness of primary keys.


Domain Integrity: Defines valid values for attributes.
Referential Integrity: Ensures relationships between tables remain consistent.

Q4: What is the difference between a Primary Key and a Foreign Key?

A4:

Primary Key: A unique identifier for each record in a table.


Foreign Key: A reference to a primary key in another table to maintain referential
integrity.

Q5: What are the different types of Normal Forms in database normalization?

A5:

1NF (First Normal Form) – Eliminates repeating groups.


2NF (Second Normal Form) – Removes partial dependencies.
3NF (Third Normal Form) – Removes transitive dependencies.
BCNF (Boyce-Codd Normal Form) – Ensures every determinant is a candidate
key.
4NF (Fourth Normal Form) – Eliminates multivalued dependencies.
5NF (Fifth Normal Form) – Eliminates join dependencies.

Q6: What is the purpose of the COMMIT and ROLLBACK commands in SQL?

A6:

COMMIT: Saves all changes made in the current transaction.


ROLLBACK: Reverts all changes made in the current transaction to the last
COMMIT.

Q7: What is a View in SQL?

A7: A View is a virtual table created using a SQL query, which does not store data
itself but retrieves it from one or more tables dynamically.

Q8: What are Triggers in SQL?

A8: Triggers are automatic actions executed by the database when certain events
occur, such as INSERT, UPDATE, or DELETE operations.

Q9: What are the differences between Denormalization and Normalization?

A9:

Normalization: Reduces redundancy and improves data integrity.


Denormalization: Increases performance by adding redundancy to reduce complex
joins.

CHAPTER 3

Self-Assessment 1

1. ______________ may be avoided if an appropriate index exists to allow


ordered access to the records.

Answer: Sorting

2. Relations are said to be Union compatible if they have the same


_____________ and that too from the same domain.

Answer: Attributes

3. JOIN operation is the most time-consuming operation. (True/False)

Answer: True

4. _____________ is another name given to search algorithms.


Answer: File scans

Self-Assessment 2

5. The size of the file can be reduced by SELECT and ____________


operations.

Answer: PROJECT

6. _____________ represents a relational calculus expression.

Answer: Query graph

7. The query graph representation also indicates an order in which


operations perform first. (True/False).

Answer: False

Self-Assessment 3

8. Semantic query optimisation helps in efficient query __________ by


modifying one query into another.

Answer: Execution

9. Relational database constraints are used in semantic query optimisation


techniques. (True/False)

Answer: True

Self-Assessment 4

10. The key to achieving good stream processing performance is to optimise


____________ together.

Answer: Multiple queries

11. MQO (Multi Query Optimisation) saves the evaluation cost and execution
time by executing the common operations once over a set of queries.
(True/False)

Answer: True

Self-Assessment 5

12. _____________ rely on nested loop joins for implementation.

Answer: Navigational strategies


13. _____________ works reversely; it starts with a sub-query first and then
executes the outer query.

Answer: Reverse lookup

Self-Assessment 6

14. It is required to validate update operations against stated relational


database constraints. (True/False)

Answer: True

15. _____________ is defined as a set of rows that encode the changes made
to a specific base table.

Answer: Delta stream

Terminal Questions and Answers

Q1: Explain the various heuristics involved in query optimisation.

A1: The heuristics approach to query optimisation uses heuristic rules and algebraic
techniques to improve the efficiency of query execution. Some of the rules include:

Performing SELECT and PROJECT operations before JOIN to reduce data size.
Transforming query trees into optimal query execution plans for efficiency.
Using query graphs and trees to represent and optimise queries.

Q2: Explain the various algorithms for executing query operations.

A2: The algorithms for executing query operations include:

External Sorting – Used for large datasets stored on disks.


Linear Search and Binary Search – Methods for data retrieval.
Hash Search and Indexing – Faster lookup techniques.
JOIN Operations – Nested loop join, single loop join, sort-merge join, and hash
join.
Set Operations – UNION, INTERSECTION, and SET DIFFERENCE.

Q3: Write a short note on Semantic Query Optimisation.

A3: Semantic Query Optimisation modifies one query into another using relational
database constraints. This process ensures that unnecessary queries are not
executed when the result is predictable.

Example: If an employee’s salary is always lower than the supervisor’s, a query


searching for employees earning more than their supervisor can be eliminated.

Q4: Describe Multi-Query Optimisation (MQO) and its application.


A4: Multi-Query Optimisation (MQO) is a methodology used to optimise a group of
SQL queries simultaneously, rather than individually. Applications include:

Reducing computational overhead by sharing query results.


Optimising view selection and caching strategies.
Enhancing mobile database query efficiency by handling multiple requests in
batches.

Q5: What are the various execution strategies for SQL sub-queries?

A5:

Navigational Strategies:
Uses nested loop joins for query execution.
Can follow forward lookup (outer query first) or reverse lookup (sub-query first).

Set-Oriented Strategies:
Queries are de-correlated to allow efficient execution.
Uses hash joins, merge joins, and sorting techniques for performance
improvement.

CHAPTER 4

Self-Assessment 1

1. The system knows the blocks containing the tuples of R, and it is not
possible to get the blocks one by one. (True/ False)

Answer: False

2. We can use the index not only to get all the tuples of the relation it
indexes, but also ___________.

Answer: To get only those tuples that have a specific value or range of values in the
attribute(s).

3. It is the open function that initiates the process of getting tuples, but it
does not get a tuple. (True/ False)

Answer: True

Self-Assessment 2

4. The selection of an algorithm for each operator is one of the most


fundamental elements of the process of transformation of a logical query plan
into a physical query plan. (True/ False)

Answer: True
5. Tuple-at-a-time, unary operations require neither _____________ nor
____________.

Answer: An entire relation nor a large part of it in memory at once.

Self-Assessment 3

6. ______________ joins can be used for relations of any size. One relation
does not need to necessarily fit in the main memory.

Answer: Nested-loop joins

7. Nested-loop does not allow us to avoid storing intermediate relations on


disk in some situations. (True/ False)

Answer: False

Self-Assessment 4

8. In ______________ algorithms, data is read into main memory from the


operand relations.

Answer: Two-pass algorithms

9. In the second pass, all the sorted sublists are _____________.

Answer: Merged

Self-Assessment 5

10. If there are M buffers available and we can pick M as the number of
buckets, we can gain a factor of M in the size of the relations that we can handle.
(True/ False)

Answer: True

11. The essential idea behind all hash-based algorithms is _________.

Answer: Partitioning the data using a hash function so that tuples requiring
processing together have the same hash value.

Self-Assessment 6

12. The existence of an index on one or more attributes of a relation makes


available some algorithms that _________.

Answer: Would not be feasible without the index.


13. Index-based algorithms are extremely useful for the selection operator.
(True/ False)

Answer: True

Self-Assessment 7

14. The buffers are rarely allocated in advance to the _____________, and the
value of M may vary depending on system conditions.

Answer: Operator

15. If the buffered block has not been changed, then it may simply be erased
from ______________.

Answer: Main memory

Self-Assessment 8

16. The disks are accessible from any of the processors through the
____________ network.

Answer: Communication

17. The number of disks stored and processors need not be identical. (True/
False)

Answer: True

Self-Assessment 9

18. The _______________ terminates at the execution of the root node. This
makes the result relation for the query.

Answer: Execution

19. The first query tree is transformed by the heuristic query optimizer into a
final query tree that is efficient to execute. (True/ False)

Answer: True

Self-Assessment 10

20. The index can be used for _________.

Answer: JOIN

21. _________ can be used to implement INTERSECTION, UNION, and SET


DIFFERENCE.
Answer: Hashing

Terminal Questions and Answers

Q1: Explain the physical query plan operators.

A1: Physical query plans are built from operators, where each operator implements
one step of the execution plan. These operators include:

Table scan: Reads an entire relation.


Index scan: Uses an index to access specific tuples.
Sort scan: Reads and sorts data simultaneously.
Join operations: Nested-loop join, hash join, and sort-merge join.

Refer to Section 5.2 for more details.

Q2: Discuss the One-Pass algorithm for database operations.

A2: One-pass algorithms process data using a single read from the disk. They are
used when at least one operand fits entirely in the main memory. They include:

Tuple-at-a-time operations: SELECT and PROJECT operations.


Full-relation binary operations: UNION, INTERSECTION, and JOIN when one
operand fits in memory.

Refer to Section 5.3 for more details.

Q3: What is buffer management?

A3: Buffer management is responsible for allocating main-memory buffers to


database processes to minimize unsatisfiable and delayed memory requests. It
optimizes memory usage and avoids performance issues such as thrashing.

Refer to Section 5.8 for more details.

Q4: Describe the most important classes of parallel machines.

A4: The three main classes of parallel machines are:

Shared Memory: All processors have direct access to a common memory.


Shared Disk: Each processor has its memory but shares disk storage with others.
Shared Nothing: Each processor has its memory and disk, communicating via
messages.

Refer to Section 5.9 for more details.

CHAPTER 5
Self-Assessment 1

1. An eddy is a query processing mechanism that constantly reorders


operators in a query plan as it runs. (True/ False)

Answer: True

2. The eddy functions by _______________.

Answer: Reordering operators dynamically to improve query efficiency.

Self-Assessment 2

3. An eddy zeroes the Done bits and sets the Ready bits suitably when it
receives a tuple from one of its inputs. (True/ False)

Answer: True

4. Two properties of eddies are______________.

Answer:
They allow flexible reordering of operators.
They adapt query execution dynamically based on runtime feedback.

Self-Assessment 3

5. Ripple joins were designed to allow changing rates for ______________.

Answer: Each input stream dynamically.

6. At a modest overhead in performance and memory footprint, the ripple


join family offers attractive adaptivity features. (True/ False)

Answer: True

7. The possible join orderings are constrained by a pre-optimiser’s choice


of an index join algorithm. (True/ False)

Answer: True

Self-Assessment 4

8. Adaptive query processing has been utilised to detect and correct


optimiser errors due to wrong statistics. (True/ False)

Answer: True

9. Adaptive data query and processing are required by ____________ to


provide better quality of services (QoS) to users.
Answer: Data grids

Self-Assessment 5

10. Many queries can run for a very long time in large-scale systems. (True/
False)

Answer: True

11. In wide-area environments, variabilities are frequent in _____________.

Answer: Hardware and workload complexity

Self-Assessment 6

12. The needed probability distributions over the parameters can be


calculated by use of _______________ or ______________ information.

Answer: Histograms, Query Workload

13. ____________ utilises intervals over query cost estimates, rather than
specifying the estimates for a single value.

Answer: Error-aware optimisation (EAO)

Self-Assessment 7

14. In-memory hash table of database objects is utilised by hashing-based


query processing algorithms. (True/ False)

Answer: True

15. Iterator implementations can take benefit of buffer management


mechanisms which ______________.

Answer: Provide efficient memory management for query execution.

16. It is _____________ to scan an index without ever retrieving records.

Answer: Possible

Self-Assessment 8

17. The algebra expression partly does not evaluate the query. (True/ False)

Answer: False

18. To get a fully specific evaluation plan, we should decide on a ___________


for each of the algebra operations involved.
Answer: Implementation

Terminal Questions and Answers

Q1: Explain the eddy architecture and how it allows for extreme flexibility.

A1: Eddy architecture is implemented in the River framework, a shared-nothing


parallel query processing framework. It allows dynamic reordering of query operators
at runtime, enabling better adaptability and performance in changing database
environments.

Q2: What are the basic properties of query processing algorithms?

A2: The fundamental properties include:

(a) Reorderability of Plans – Operators can be rearranged dynamically.

(b) Moments of Symmetry – Points in query execution where reordering can


occur.

(c) Synchronisation Barriers – Constraints due to dependencies between


operations.

(d) Join Algorithms and Indexes – Various strategies like nested-loop join, hash
join, and index join.

Q3: Discuss where adaptive query processing is most widely used.

A3: Adaptive query processing is widely used in:

(a) Internet Applications – Optimizing queries in web-based environments.

(b) Data Grids – Integrating multiple distributed data sources.

(c) Web-based Data Integration – Handling multiple conflicting objectives in


mediator systems.

(d) Wide-area Database Systems – Adapting to dynamic environments and


varying query workloads.

Q4: Explain the query evaluation techniques for large databases.

A4: The main techniques include:

(a) Sorting and Hashing – Optimizing query performance through efficient data
ordering.

(b) Disk Access Optimization – Using indexing, read-ahead strategies, and buffer
management.
(c) Iterator-Based Query Execution – Allowing operators to process data
incrementally rather than loading entire datasets into memory.

(d) Query Evaluation Plans – Using structured query trees and execution
strategies.

CHAPTER 6

Self-Assessment 1

1. Which phase of locking defines the process of acquiring and giving up


the locks?
a) Growing Phase
b) Shrinking Phase
c) Two Phase ✅
d) None of the above

2. Locking scheduler permits lock requests only if it is in a legal schedule.


(True/False)

✅ True

Self-Assessment 2

3. Which types of locks are used for incrementing & decrementing stored
values?
a) Exclusive locks
b) Upgrade locks
c) Decrement locks
d) Increment lock ✅

3. In shared locks, only one user is permitted to update a specific part of


data.
(True/False) ❌ False

Self-Assessment 3

4. The ______________ represents a relation which is related with the


database elements with information regarding locking.

Answer: Lock Table

5. Part II selects & inserts suitable lock modes to database (DB) operations
such as read, write, or update. (True/False)
❌ False

Self-Assessment 4

6. ______________ lock specifies the intention to request an S lock.

Answer: IS Lock

7. The process of managing locks on a hierarchy of database elements is


performed by the warning protocol. (True/False)

✅ True

Self-Assessment 5

8. If we present the wrong transaction first, it is not necessary to abort it.


(True/False)

❌ False

9. What is the minimum time passed among two neighboring timestamps


known as?
a) Timestamp Collection
b) Timestamp Locking
c) Timestamp Resolution ✅
d) Timestamp Revision

Self-Assessment 6

10. What do you call a set of transactions that have initiated, but have not still
finished their validation phase?
a) START ✅
b) VAL
c) FIN
d) STOP

11. FIN is a set of transactions that have finished validation, but still not
finished their write phase. (True/False)

❌ False

Self-Assessment 7

12. Which type of backup of the database is used to copy only the last
modifications that are performed on the database?
a) Full database backup
b) Differential backup ✅
c) Transaction log backup
d) None of the above

13. A temporary storage area in primary memory is known as buffer.


(True/False)

✅ True

Terminal Questions and Answers

Q1: How is the two-phase locking method used to ensure serialisability?


Illustrate.

A1: Two-phase locking (2PL) ensures serialisability by dividing transaction


execution into two phases:

Growing Phase: Transactions acquire locks but do not release them.

Shrinking Phase: Transactions release locks but do not acquire new ones.

If all transactions follow 2PL, then interleaved execution results in a serialisable


schedule.

Q2: What are the different lock modes used in the locking system? Discuss.

A2: Locking systems use several lock modes:

(a) Shared Lock (S): Allows multiple transactions to read but not modify data.
(b) Exclusive Lock (X): Grants full access to modify data.
(c) Update Lock (U): A temporary lock that ensures a row is updated only once.
(d) Upgrading Lock: Converts a shared lock into an exclusive lock.
(e) Increment Lock: Used to modify numeric values incrementally, such as in
ticket booking systems.

Q3: Explain the architecture for a Locking Scheduler.

A3: A locking scheduler consists of two parts:


(a) Part I: Determines lock mode and inserts locks into the database.

(b) Part II: Executes database operations, determines whether locks can be
granted, and maintains the lock table.

It ensures that transactions execute in a legal schedule and prevents conflicts between
concurrent transactions.

Q4: Illustrate the concept of locks with multiple granularity with an example.

A4: Locks with multiple granularity enable transactions to lock either large or small
database elements.
Example:

(a) Relation-Level Lock: A transaction locks the entire "Account Balances" table.

(b) Tuple-Level Lock: Transactions lock individual rows for deposits or


withdrawals.

(c) Using fine-grained locks improves concurrency but increases overhead.

Q5: Explain the concept of database recovery management. Discuss the


different levels of backup used for recovering data.

A5: Database Recovery Management restores the database to a correct state after
failures.

Backup Types:
(a) Full Backup: Copies the entire database.
(b) Differential Backup: Copies only changes made since the last full backup.
(c) Transaction Log Backup: Copies uncommitted transactions for quick recovery.
(d) Recovery methods use write-ahead logging, checkpointing, and redundant logs
to maintain data consistency.

CHAPTER 7

Self-Assessment 1

(a) To provide which type of assurance is each change in the


database logged individually on disk?
a) Continuity
b) Stability ✅
c) Concurrency
d) Speed

2. To whom do the transaction commands inform about the


transaction's start and end?
a) Transaction commander
b) Transaction Coordinator
c) Transaction manager ✅
d) Transaction master

Self-Assessment 2

3. _________ transaction processing system can make the


process of monitoring every transaction simpler.
Answer: Organised

4. In a transaction processing system, errors are not required to


be managed in a secure and consistent manner. (True/False)

Answer: False
Self-Assessment 3

5. What is the primary purpose of atomicity in a transaction


schedule?
a) To enhance system throughput.
b) To treat a transaction as a single, indivisible unit. ✅
c) To control access to data items.
d) To order transactions based on timestamps.

6. Which type of schedule allows multiple transactions to execute


simultaneously, potentially leading to increased system throughput?
a) Serial Schedule.
b) Concurrent Schedule. ✅
c) Timestamp Ordering.
d) Durability Schedule.

Self-Assessment 4

7. When data is written by a non-committed transaction, what is


it called?
a) Dirty ✅
b) Strict
c) Rolled back
d) Serialisable

8. Write locks should not be released by a transaction in case of


strict locking until the transaction is either committed or aborted. (True/False)
Answer: True

Self-Assessment 5

9. In the case of View-serialisability, all the associations among


transactions T and U are regarded such that T writes a database element, the
value of which is read by U (True/False).

Answer: True

10. A schedule S is said to be _________ if S is view-equivalent to


a sequential schedule.

Answer: View-serialisable

Self-Assessment 6

11. What is Distributed Transaction Processing (DTP)?


a) A transaction that occurs within a single database
b) A transaction that involves multiple processes or nodes in different locations ✅
c) A transaction that is isolated from other transactions.
d) A transaction that occurs in a centralised computing environment

12. Why are two-phase commit protocols commonly used in


Distributed Transaction Processing?
a) To introduce blocking and increase vulnerability to network failures.
b) To simplify the coordination of transactions across multiple nodes. ✅
c) To complicate the coordination process for enhanced security.
d) To eliminate the need for a coordinator in distributed transactions.

13. What is the purpose of a distributed transaction manager in


DTP?
a) To initiate single node transactions
b) Coordinating and synchronising components of a distributed transaction ✅
c) To increase network vulnerabilities.

Self-Assessment 7

14. What is a key characteristic of Real-time Transaction


Processing (RTTP)?
a) Emphasis on batch processing
b) Low latency ✅
c) Slower response time
d) Reliance on offline databases

15. Which technology is often employed in RTTP systems to


further reduce latency?
a) Blockchain
b) In-memory databases and caching mechanisms ✅
c) Traditional file systems
d) Sequential processing algorithms

Terminal Questions and Answers

Q1: What are the advantages and disadvantages of a transaction processing


system?

A1: Advantages:

(a) Ensures data accuracy and consistency.


(b) Improves efficiency by handling multiple transactions.
(c) Provides data security through controlled access.

Disadvantages:

(a) Requires handling of multiple concurrent transactions.


(b) Error management is critical to avoid system failures.
(c) High resource consumption, especially in large-scale applications.
Refer to Section 3 for more details.

Q2: Explain the concept of serialisability and recoverability. Illustrate how to


manage rollbacks by locking.

A2:

(a) Serialisability ensures that a concurrent transaction schedule


produces the same result as a serial execution.
(a) Recoverability prevents committed transactions from reading
uncommitted changes.
(c) Cascading Rollback occurs when one failure leads to multiple
rollbacks.
Strict Locking prevents rollback issues by holding locks until commit/abort.

Refer to Section 6 for more details.

Q3: What do you mean by View-serialisability? Illustrate the concept.

A3: View-serialisability ensures that a concurrent schedule produces the same


output as a serial schedule. It considers read-write dependencies between
transactions.

Refer to Section 7 for more details.

Q4: Explain the different methods used for resolving deadlocks.

A4:
Deadlock Detection by Timeout – A transaction is rolled back if it exceeds a set time.

Waits-For Graph – A directed graph showing which transactions are waiting for
resources.

Refer to Section 8 for more details.

Q5: What are the problems that occur during long transactions? Illustrate.

A5:

(a) Lock contention – Holding locks for too long affects other
transactions.
(b) Resource blocking – Increases the waiting time for other queries.
(c) Performance issues – Leads to slow transaction processing.

Refer to Section 10 for more details.

CHAPTER 8
Self-Assessment 1

1. Nearly all traditional DBMSs use a relational database approach.


(True/False)
Answer: True

2. In which architecture does each processor have private memory and


one or more private disk storage?
a) Shared memory
b) Shared Disk
c) Shared nothing ✅
d) Pipelined

Self-Assessment 2

3. Oracle is capable of increasing or decreasing the number of parallel


execution servers based on the requirement. (True/False)
Answer: True

4. The basic unit of work in parallelism is _______________.


Answer: Granule

Self-Assessment 3

5. Which of the following operations require the output of other


operations?
a) Child operations
b) Dependent operations
c) Parent operations ✅
d) Inter-related operations

6. The number of ____________ linked with a single operation is known as


the degree of parallelism.

Answer: Parallel-execution servers

Self-Assessment 4

7. Partitioning data very much improves the managing capacity of very big
databases. (True/False)

Answer: True

8. _____________ partitioning is very suitable for point queries and also


range queries.

Answer: Range Partitioning

Self-Assessment 5
9. The full form of OLTP is __________________.

Answer: On-line Transaction Processing

10. Inter-query parallelism aids in increasing the transaction throughput.


(True/False)

Answer: True

Self-Assessment 6

11. Intra-query parallelism is sometimes also referred to as ______ .

Answer: Parallel Query Processing

12. `One cannot employ intra-partition parallelism and inter-partition


parallelism at the same time. (True/False)

Answer: False

Self-Assessment 7

13. Intra-operation parallelism performs better with increasing parallelism.


(True/False)

Answer: True

14. In ____________ parallelism, the various operations in a query


expression are executed in parallel.

Answer: Inter-operation parallelism

Self-Assessment 8

15. The chances of any processor or disk failing are higher in a parallel
system. (True/False)

Answer: True

16. There must be a suitable technique to manage ____________ skew


problem in parallel system design.

Answer: Data

Terminal Questions and Answers

Q1: What do you mean by parallel database? What are the advantages and
disadvantages of parallel databases?
A1: Parallel Database: A database that has numerous memory areas and shares a
single disk drive.

Advantages:
Increased throughput
Faster query execution
High availability
Scalability

Disadvantages:
High startup costs
Interference between processes
Complexity in management

Refer to Section 2 for more details.

Q2: What are the three machine architectures upon which parallel DBMSs run?

A2:

(a) Shared Memory Multiprocessor: Multiple processors share memory and disks.
(b) Shared Disk Multiprocessor: Each processor has private memory but shares
disks.
(c) Shared Nothing Multiprocessor: Each processor has private memory and
private disks.

Refer to Section 3 for more details.

Q3: Discuss in detail the concept of I/O Parallelism.

A3: I/O Parallelism (Input/Output Parallelism) minimizes disk access time by


distributing data across multiple disks.

Techniques:
Round-robin partitioning
Hash partitioning
Range partitioning

Benefits: Reduces query response time and improves performance.

Refer to Section 5 for more details.

Q4: What are the different types of partitioning techniques? Describe in detail.

A4:

(a) Round-Robin Partitioning: Distributes tuples evenly in a cyclic order.


(b) Hash Partitioning: Uses a hash function to distribute tuples across disks.
(c) Range Partitioning: Allocates data to partitions based on attribute value
ranges.
Refer to Section 5 for more details.

Q5: What is Intra-query and Inter-query parallelism? Explain with the help of a
diagram.

A5:

(a) Intra-query parallelism: A single query is broken into multiple subtasks


executed in parallel.

(b) Inter-query parallelism: Multiple independent queries run simultaneously on


different processors.

(c) Illustration: Diagrams in Section 7 show how queries are split and executed in
parallel.

Refer to Sections 7.1 & 7.2 for more details.

Q6: Differentiate between inter-operation and intra-operation parallelism.

A6:
Feature Intra-Operation Parallelism Inter-Operation Parallelism

Definition Parallel execution of a single operation Parallel execution of different


operations

Example Parallel sorting of a table Parallel execution of JOIN and


SORT operations

Performance Improves with more parallelism Limited by dependencies


between operations

Refer to Section 8 for more details.

Q7: What are the major design issues of parallel systems?

A7:
(a) Handling data skew
(b) Failure recovery mechanisms
(c) Managing high inter-processor communication
(d) Efficient parallel query execution

Refer to Section 9 for more details.

CHAPTER 9
Self-Assessment 1

1. __________ are said to be self-reliant and may be utilised in other suitably


similar applications.

Answer: Objects

2. The methods of an object cannot be classified as either read-only or


updated. (True/False)

Answer: False

Self-Assessment 2

3. In which of the following approaches is the unit of transfer to the client


from the server regarded as a page?
a) Page Server ✅
b) File Server
c) Object Server
d) Blade Server

4. You can define object clustering as the potential of an application to offer


information to object-oriented DBMS. (True/False)

Answer: True

Self-Assessment 3

5. The __________ of object identity can’t be seen by the user.

Answer: Value

6. The value of OID can’t be viewed by the external user. (True/False)

Answer: True

Self-Assessment 4

7. Which of the following processes hides the internal data of the object
from the outside classes?
a) Implementation
b) Encapsulation ✅
c) Attribute Hiding
d) Inheritance

8. By means of behaviour encapsulation, the users of the class are allowed


to view the internal implementation of behaviour. (True/False)

Answer: False
Self-Assessment 5

9. You cannot use a database system to implement a data model.


(True/False)

Answer: False

10. Which of the following can be defined as the group of values for the
object’s attributes?
a) State ✅
b) Class
c) Behaviour
d) Method

Self-Assessment 6

11. Relationships can be considered as __________ entities that permit


objects to refer to each other.

Answer: Abstract

12. Which of the following components of the object-oriented paradigm is


used to carry out navigation-based data access?
a) Identifiers
b) Relationships ✅
c) Inheritance
d) Attributes

Self-Assessment 7

13. Object identifiers cannot be accumulated as a field of an object.


(True/False)

Answer: False

14. For identifying the object in some systems, only __________ bytes with
object index or object position in the file is sufficient.

Answer: Four

Self-Assessment 8

15. Object is considered as an __________ of a class.

Answer: Instance

16. What do you call the process where the behaviour and properties of the
parent object are inherited by the child object?
a) Encapsulation
b) Inheritance ✅
c) Polymorphism
d) Message Passing

Self-Assessment 9

17. If you want to implement one or more interfaces by a class, then a


separation between those interfaces from a class name is provided by a
__________.

Answer: Colon

18. An interface illustrates the behaviour or ability of a class without


performing a specific implementation. (True/False)

Answer: True

Self-Assessment 10

19. A class can be considered as a specialisation of another class by using


the keyword __________.

Answer: isa

20. The object types can be specified by means of a type hierarchy.


(True/False).

Answer: True

Self-Assessment 11

21. A programming language which is expanded by means of constructs to


manage persistent data is known as a __________.

Answer: Persistent programming language

22. Performing routine high-level optimisation in a persistent programming


language is tough. (True/False)

Answer: True

Terminal Questions and Answers

Q1: Explain various architectural approaches of OODBMS.

A1: The various architectural approaches of OODBMS include:

(a) Distributed Client-Server Approach – Uses multiple processes for database


services.
(b) Data Access Mechanism – Manages how data is retrieved from storage.
(c) Object Clustering – Groups frequently accessed objects together.
(d) Heterogeneous Operation – Supports different platforms accessing the same
DB.

Refer to Section 3 for more details.

Q2: Illustrate the concept of an object-oriented data model.

A2: The Object-Oriented Data Model includes:

(a) Objects and Object Identifiers (OIDs) – Each object is uniquely identified.
(b) Attributes and Methods – Define object properties and behaviours.
(c) Class Hierarchy & Inheritance – Allows sharing of attributes and methods.

Refer to Section 6 for more details.

Q3: Discuss the concept of type hierarchy and inheritance with examples,
including multiple inheritance.

A3: Type Hierarchy allows objects to inherit properties from parent classes.
(a) Single Inheritance – A class inherits from one parent class.
(b) Multiple Inheritance – A class inherits from multiple parent classes, increasing
complexity.

Example:
A Person class can have Employee and Customer subclasses.
Employee can have further subclasses like Manager and Clerk.

Refer to Section 11 for more details.

Q4: What is a persistent programming language? How can it be differentiated


from embedded SQL? Illustrate.

A4: Persistent Programming Language – Supports objects that persist beyond


program execution.

Embedded SQL vs Persistent Language:


Embedded SQL requires explicit code to handle database operations.
Persistent Language integrates database operations natively.

Example:
In Embedded SQL, a developer must explicitly fetch and insert records.
In a Persistent Language, objects are directly stored and retrieved.

Refer to Section 12 for more details.

Q5: Discuss the declaration of interfaces and classes. Also, illustrate how a
class can implement one or more interfaces.
A5: Interfaces define expected behaviours without implementation. Classes
implement interfaces and provide functionality.

Example Syntax:

Class Employee : Workable, Reportable {


void performTask();
void generateReport();
};

If a class implements multiple interfaces, a colon : is used for separation.

Refer to Section 10 for more details.

CHAPTER 10

Self-Assessment 1

1. A distributed database system consists of a collection of _________,


every one of which has a local database system.

Answer: Sites

2. The consumer is aware of the database, which is fragmented.


(True/False)

Answer: False

3. The most widespread channels are ________ baseband coaxial, fibre


optics, and broadband coaxial.

Answer: Twisted pair

4. Which of the following is the basic component of a Distributed Database


Management System?
a) Data Processor ✅
b) Data Definition
c) Data Warehousing
d) Data Mining

Self-Assessment 2

5. A homogenous database allows the sharing of data among different


________ simpler.

Answer: Users
6. In which type of database communication between various DBMSs is
translation required?
a) Relational Database
b) Heterogeneous Database ✅
c) Flat-file Database
d) Operational Database

Self-Assessment 3

7. Horizontal fragmentation splits the relation by allotting each node of N to


one fragment. (True/False)

Answer: False

8. Vertical fragmentation of a relation or a table can be acquired by splitting


the table into several sub-tables having disjoint columns. (True/False)

Answer: True

9. _______ makes concurrency control and recovery techniques more


expensive.

Answer: Data Replication

Self-Assessment 4

10. The ________ in the distributed database system are so scattered as to


match the requirements of the users.

Answer: Data

11. What is the primary drawback of distributed database systems?


a) Complexity ✅
b) Standards
c) Overheads
d) Control

Self-Assessment 5

12. For distributed transactions, each computer is not required to have a local
transaction manager. (True/False)

Answer: False

13. __________ manage constant or durable data and work in cooperation


with the Distributed Transaction Coordinator.

Answer: Resource Managers


Self-Assessment 6

14. _______ are utilised to ensure atomicity across sites.

Answer: Commit Protocols

15. _______ is a transaction protocol which is used for the complexities that
are associated with distributed resource managers.

Answer: Two-phase commit

Self-Assessment 7

16. A transaction is distributed across __________.

Answer: Processes

17. System maintains a single __________ that exists in a single chosen site.

Answer: Lock Manager

Self-Assessment 8

18. In a _________, the inherent redundancy in the system can be utilised for
recovery.

Answer: Replicated Database Approach

19. In __________, the consistency of the recovered data should also be


considered.

Answer: Distributed Databases

Self-Assessment 9

20. In _________, entries are planned by identifier or name and intended for
forward lookup to locate more about the entry.

Answer: White Pages

21. In ____________, entries are designed/planned by properties to locate


entries matching particular requirements.

Answer: Yellow Pages

Self-Assessment 10

22. The distribution transparency feature permits one distributed database to


be treated as a single (albeit logical) database. (True/False)
Answer: True

23. ___________ feature permits the distributed database to continue to be


operational even if there is a failure at some nodes.

Answer: Failure Transparency

Self-Assessment 11

24. Which transparency exists when the programmer should indicate both
fragment names as well as their locations?
a) Fragmentation Transparency
b) Local Mapping Transparency ✅
c) Location Transparency
d) Failure of Transparency

25. The end user or programmer needs to recognise whether a database is


partitioned or not. (True/False)

Answer: False

Terminal Questions and Answers

Q1: Explain the functions and components of DDBMS.

A1: The functions of DDBMS include:

(a) Tracking of data – Managing distributed, replicated, and fragmented data.


(b) Distributed query processing – Executing queries across multiple sites.
(c) Distributed transaction management – Coordinating multi-site transactions.
(d) Security and Recovery – Handling system failures and ensuring secure
transactions.

Components of DDBMS:

(a) Sites/Nodes: Workstations that host the database.


(b) Network hardware/software: Enables communication between sites.
(c) Transaction Processor (TP): Manages user queries and transactions.
(d) Data Processor (DP): Handles data storage and retrieval at each site.

Refer to Section 2 for more details.

Q2: What is the difference between homogeneous and heterogeneous


databases?

A2:
Feature Homogeneous Database Heterogeneous Database
DBMS Type Single DBMS Multiple DBMSs
Compatibility Fully compatible Requires translation between
DBMSs
Data Format Common definitions and formats Various definitions and
structures

Refer to Section 3 for more details.

Q3: Discuss data fragmentation and its types.

A3:
(a) Horizontal Fragmentation: Divides a table into subsets of rows.
(b) Vertical Fragmentation: Divides a table into subsets of columns.
(c) Mixed Fragmentation: A combination of horizontal and vertical fragmentation.

Refer to Section 4.1 for more details.

Q4: What are commit protocols?

A4: Commit protocols ensure atomicity across multiple sites in distributed


transactions.

(a) Two-Phase Commit (2PC): Ensures all sites commit or abort a transaction.
(b) Three-Phase Commit (3PC): Reduces the chances of transaction failure but is
complex.

Refer to Section 7.2 for more details.

CHAPTER 11

Self-Assessment 1

1. For relational database users, it is easy to migrate to object-relational


databases. (True/False)

Answer: True

2. The main advantage of the object-relational data model arises from the
concept of “_____________.”

Answer: Reuse and sharing

Self-Assessment 2

3. ORDBMS acts as a framework into which specialised software modules


can be embedded. (True/False)

Answer: True
4. Which of the following is the application package for Informix Universal
Server?
a) Extenders
b) Data Blades ✅
c) Data Cartridge
d) Blade Smith

Self-Assessment 3

5. __________ language defines how to formulate a database schema (the


structure of a database).

Answer: Object Definition Language (ODL)**

6. The _____________ concept in SQL3 helps the database developer to


associate values stored in the tables with methods.

Answer: Abstract Data Types (ADT)**

7. Select the name of the predefined column in SQL3 that contains row
identifiers, which can be used as values in other rows.
a) ADT
b) Key
c) Identity ✅
d) Index

Self-Assessment 4

8. The nested relational model is also known as ____________.

Answer: Non-First Normal Form (NFNF)**

9. Nested attributes are also called internal relation schemas. (True/False)

Answer: True

Self-Assessment 5

10. ORDBMS does not care about the logic’s return value. (True/False)

Answer: False

11. The standard RDBMS index structures support only equality conditions
(B+ trees and hash indexes) and range conditions (B+ trees). (True/False)

Answer: True

Self-Assessment 6
12. Which linking is available in various types of ORDBMS?
a) Dynamic linking ✅
b) Refresh linking
c) Static linking
d) Pure linking

13. It must be possible to execute the queries inside functions in DBMS.


(True/False)

Answer: True

Self-Assessment 7

14. Out of RDBMS, OODBMS, and ORDBMS, which has the best
performance?

Answer: RDBMS

15. Which one of the following is the easiest to use?


a) ORDBMS
b) OODBMS
c) RDBMS ✅
d) DBMS

Terminal Questions and Answers

Q1: What do you mean by an object-relational database? Also, explain its


advantages and disadvantages.

A1: Object-Relational Database (ORDBMS) combines relational databases with


object-oriented features like inheritance and encapsulation.

Advantages:
Supports complex data types
Enhances data modeling capabilities
Provides better query optimization

Disadvantages:
More complex than RDBMS
Performance overhead due to advanced features

Refer to Section 2 for more details.

Q2: Explain the characteristics of object-relational databases.

A2:
(a) Support for complex data types like arrays, user-defined types, and
multimedia data
(b) Object-oriented features such as encapsulation and inheritance
(c) Extended SQL capabilities to support object-oriented queries

Refer to Section 2.4 for more details.

Q3: Write short notes on ODMG standards.

A3: The Object Data Management Group (ODMG) sets standards for OODBMS.

Key components:
Object Model
Object Definition Language (ODL)
Object Query Language (OQL)
Bindings for C++, Java, and Smalltalk

Refer to Section 4.1 for more details.

Q4: Briefly describe SQL3 and its important features.

A4: SQL3 extends SQL with object-oriented features, including:


(a) User-defined data types (ADT)
(b) Inheritance and polymorphism
(c) Complex queries with objects

Refer to Section 4.3 for more details.

Q5: What are the main reasons behind the development of ORDBMS?

A5: ORDBMS was developed to handle complex applications requiring multimedia,


spatial data, and object-oriented features. Integrates relational and object-oriented
concepts for better data management.

Refer to Section 2.1 for more details.

Q6: Describe the various implementation issues for extended types.

A6:
(a) Dynamic Linking: User-defined functions must be linked dynamically.
(b) Client-Server Concerns: Functions must run efficiently within DBMS.
(c) Efficient Storage & Access: ORDBMS must support large object data and
indexing for ADTs.

Refer to Section 7 for more details.

Q7: Differentiate between RDBMS, OODBMS, and ORDBMS.

A7:
Feature RDBMS OODBMS ORDBMS
Defining Standard SQL2 ODMG-2.0 SQL3 (in
progress)
Object-Oriented Support No Full Partial
Performance High Moderate Expected to
improve
Complex Relationships Not supported Fully supported Limited support

Refer to Table 1 in Section 8 for more details.

Q8: What are the various components of ODMG-93?

A8:

(a) Object Model: Defines object structure and relationships


(b) Object Definition Language (ODL): Used to create database schemas
(c) Object Query Language (OQL): Query language for objects
(d) Programming Language Bindings: Supports C++, Java, and Smalltalk

Refer to Section 4.1 for more details.

Q9: What are the storage methods in ORDBMS? Briefly describe.

A9:

(a) ORDBMS uses page-based storage like RDBMS.


(b) Caching mechanism optimizes repeated queries.
(c) Large object storage (LOBs): Handles multimedia and complex data
efficiently.

Refer to Section 6 for more details.

CHAPTER 12

Self-Assessment 1

1. Events ____________ by the rule action that automatically identifies.

Answer: Triggered

2. The main events that are defined for rules triggered are the common
SQL statements in STARBURST. (True/False)

Answer: True

3. What does the CREATE TRIGGER statement state?


a) Trigger name ✅
b) Trigger class
c) Trigger function
d) Trigger variable
4. The model which is utilised to state active database rules is known as
____________ model.

Answer: Event-Condition-Action (ECA)

Self-Assessment 2

5. Temporal databases are the technique which record ____________ Data.

Answer: Time-referenced

6. The financial function of the temporal database includes:


a) Banking
b) Accounting
c) Portfolio organisation
d) All of the above ✅

Self-Assessment 3

7. The main type of database query that is required to include locating


multimedia sources consists of certain objects of interest. (True/False)

Answer: True

8. Identifying the contents of multimedia sources is an easy task.


(True/False)

Answer: False

Self-Assessment 4

9. The video database management method is used to take care of


____________ storage hierarchies.

Answer: Extended

10. In Video database management, the database ____________ and the


streaming zone are split by the buffer pool.

Answer: Buffer zone

11. Video shots are processed to take out MPEG7-supporting low-level visual
characteristic signifiers. (True/False)

Answer: True

12. Which processing is used by the VDBMS video pre-processing toolkit to


partition raw video?
a) Semantic-based query processing ✅
b) Distributed query processing
c) Both
d) None of the above

Terminal Questions and Answers

Q1: What is an active database? Explain what the active rules for Oracle are.

A1: Active Database: A database that includes production-style rules that


automatically trigger when predefined conditions occur.

Active Rules in Oracle:


Defined using the Event-Condition-Action (ECA) model.
Triggered based on operations like INSERT, UPDATE, and DELETE.

Example:

CREATE TRIGGER Total_sal1


AFTER INSERT ON EMPLOYEE
FOR EACH ROW
WHEN (NEW.Dno IS NOT NULL)
UPDATE DEPARTMENT
SET Total_sal = Total_sal + NEW.Salary
WHERE Dno = NEW.Dno;

Oracle supports row-level and statement-level triggers.

Refer to Section 2 for more details.

Q2: What is the difference between temporal and multimedia databases?

A2:
Feature Temporal Database Multimedia
Database
Data Type Time-referenced data Images, videos, audio,
text
Application Banking, medical records, reservations Video indexing, content
retrieval
Storage Method Historical and transaction time storage Content-based indexing
and storage

Refer to Sections 3 & 4 for more details.


Q3: Explain the storage management for video.

A3: Storage management for video in Video Database Management System


(VDBMS) is crucial due to the large size of video files.
Key Features:
Buffer management: Splits database and streaming zones.
Cache disk management: Maintains frequently accessed video files.
Hierarchical storage: Uses disk, buffer, and tertiary storage.

Refer to Section 5.1 for more details.

Q4: Discuss real-time buffer management.

A4: Real-time buffer management ensures efficient streaming of video content.

Key Features:
Minimises memory requirements.
Prefetching and caching improve video playback.
Works with media servers to provide uninterrupted streaming.

Refer to Section 5.4 for more details.

Q5: Write short notes on:

a) Starburst:

A research project that introduced active database rules.


Uses statement-level rules that trigger on INSERT, UPDATE, DELETE.
Example:

CREATE RULE Total_sal1 ON EMPLOYEE


WHEN INSERTED
IF EXISTS (SELECT * FROM INSERTED WHERE Dno IS NOT NULL)
THEN UPDATE DEPARTMENT
SET Total_sal = Total_sal + (SELECT SUM(Salary) FROM INSERTED WHERE
D.Dno = I.Dno)
WHERE D.Dno IN (SELECT Dno FROM INSERTED);

b) Oracle

Uses the Event-Condition-Action (ECA) model for active rules.


Supports row-level and statement-level triggers.
Can be used to automate salary updates, department transfers, etc.

c) DB2

IBM’s relational database management system.


Uses CREATE TRIGGER statements to define rules.
Supports BEFORE and AFTER triggers for complex applications.

Refer to Section 2.5 for more details.

Q6: How do cloud databases democratise access to data and streamline


database management tasks?

A6: Cloud databases allow anyone with internet access to retrieve and manage
data.
Benefits:
Automated management (provisioning, backups).
Scalability without large infrastructure costs.
Secure and globally accessible.

Refer to Section 6 for more details.

Q7: Compare and contrast the scalability and flexibility offered by cloud
databases with traditional database management systems.

A7:
Feature Cloud Databases Traditional Databases
Scalability Easily scalable Requires manual hardware
upgrades
Flexibility Supports multiple data models Limited by initial setup
Management Automated backups, replication Requires manual intervention
Cost Pay-as-you-go pricing High initial investment

Refer to Section 6.2 for more details.


COMPUTATIONAL MATHEMATICS (101)

CHAPTER 1

Self-Assessment 1

1. The decimal system is based on _______ unique digits.

Answer: 10

2. In the binary system, each position represents a power of _______.

Answer: 2

3. The hexadecimal number system uses digits and letters up to _______.

Answer: F

4. Floating-point arithmetic is used to represent _______ numbers in


computing.

Answer: Real

5. _______ errors occur due to the finite representation of numbers in


computers.

Answer: Rounding

6. The octal number system is based on base _______.

Answer: 8

7. A negative number is represented in binary using the _______


complement method.

Answer: Two's

8. The representation of real numbers that cannot be accurately depicted as


simple fractions or integers uses _______ point numbers.

Answer: Floating

9. Rounding errors in floating-point arithmetic can lead to _______ in


computational results.

Answer: Inaccuracies
10. Conversion from decimal to binary involves dividing by _______ and
noting the remainder.

Answer: 2

11. Which of the following is not a base used in number systems?


A) 2
B) 8
C) 10
D) 12 ✅

12. What does the MSB in a binary number represent?


A) Most Significant Bit ✅
B) Medium Size Bit
C) Minimum Significant Bit
D) Most Small Bit

13. Which of the following is true for the hexadecimal system?


A) It uses only numbers.
B) It is based on base-8.
C) It includes letters A to F. ✅
D) It is rarely used in computing.

14. What type of error does not occur in digital computing?


A) Rounding error
B) Syntax error ✅
C) Truncation error
D) Overflow error

15. In floating-point arithmetic, the part of the number that represents the
significant digits is called the:
A) Exponent
B) Mantissa ✅
C) Base
D) Coefficient

Terminal Questions and Answers

Q1: Convert the decimal number 156 to binary.

A1: (156)₁₀ = (10011100)₂

Q2: Convert the binary number 101101 to decimal.

A2: (101101)₂ = (45)₁₀


Q3: Convert the hexadecimal number A3F to decimal.

A3: (A3F)₁₆ = (2623)₁₀


Q4: Convert the decimal number 345 to octal.

A4: (345)₁₀ = (531)₈

Q5: Convert the binary number 1101101 to hexadecimal.

A5: (1101101)₂ = (6D)₁₆

Q6: If the binary representation of a number is 100111, what is its decimal


equivalent?

A6: (100111)₂ = (39)₁₀

Q7: Convert the octal number 764 to binary.

A7: (764)₈ = (111110100)₂

Q8: Convert the hexadecimal number 1C2 to binary.

A8: (1C2)₁₆ = (111000010)₂

Q9: What is the sum of the binary numbers 1010 and 1101?

A9: (1010)₂ + (1101)₂ = (10111)₂

Q10: Subtract the binary number 1001 from 11011.

A10: (11011)₂ - (1001)₂ = (10110)₂

Q11: Multiply the binary numbers 101 and 11.

A11: (101)₂ × (11)₂ = (1111)₂

Q12: Divide the binary number 110010 by 101.

A12: (110010)₂ ÷ (101)₂ = (110)₂

Q13: Convert the decimal fraction 0.375 to binary.

A13: (0.375)₁₀ = (0.011)₂

Q14: Convert the binary fraction 0.101 to decimal.

A14: (0.101)₂ = (0.625)₁₀

Q15: If a floating-point number is represented as 1.01 × 2³, what is its decimal


equivalent?

A15: (1.01 × 2³)₂ = (8.5)₁₀


Q16: Convert the octal number 357 to decimal.

A16: (357)₈ = (239)₁₀

Q17: What is the result of adding the hexadecimal numbers A4 and 9B?

A17: (A4)₁₆ + (9B)₁₆ = (13F)₁₆

Q18: Subtract the hexadecimal number 3F from 8A.

A18: (8A)₁₆ - (3F)₁₆ = (4B)₁₆

Q19: Multiply the octal numbers 17 and 21.

A19: (17)₈ × (21)₈ = (367)₈

Q20: Divide the hexadecimal number F4 by 2.

A20: (F4)₁₆ ÷ (2)₁₆ = (7A)₁₆

CHAPTER 2

Self-Assessment Questions and Answers with Explanations

Q1: What is the value of the hexadecimal number A3F in decimal?

Answer: 2623

Explanation: Hexadecimal (base-16) numbers use digits 0-9 and letters A-F, where
A=10, B=11, ..., F=15. To convert A3F₁₆ to decimal, expand it using powers of 16:
(A×162)+(3×161)+(F×160)
(A×162)+(3×161)+(F×160)
(10×256)+(3×16)+(15×1)=2560+48+15=2623
(10×256)+(3×16)+(15×1)=2560+48+15=2623

Q2: Convert the decimal number 345 to octal.

Answer: 531

Explanation: To convert 345₁₀ to octal (base-8), divide it by 8 and record


remainders:
345÷8=43 remainder 1
345÷8=43 remainder 1
43÷8=5 remainder 3
43÷8=5 remainder 3
5÷8=0 remainder 5
5÷8=0 remainder 5
Reading the remainders from bottom to top, we get 531₈.

Q3: Convert the binary number 1101101 to hexadecimal.

Answer: 6D

Explanation: Group the binary digits into sets of four from right to left:
1101101
1101101

Since the second group has fewer than four digits, add leading zeros:
01101101
01101101

Convert each group to hexadecimal:

0110₂ = 6₁₆
1101₂ = D₁₆

Thus, 1101101₂ = 6D₁₆.

Q4: What is the sum of the binary numbers 1010 and 1101?

Answer: 10111

Explanation:
Perform binary addition:

1010
+ 1101
-----------
10111

Starting from the right:

0+1 = 1
1+0 = 1
0+1 = 1
1+1 = 10 (write 0, carry 1)
Carrying 1 results in an additional 1 at the leftmost position.

Thus, 1010₂ + 1101₂ = 10111₂.

Q5: What is the decimal equivalent of the binary fraction 0.101?

Answer: 0.625

Explanation: Expand using negative powers of 2:


0.1012=(1×2−1)+(0×2−2)+(1×2−3)
0.1012=(1×2−1)+(0×2−2)+(1×2−3)
=(1×0.5)+(0×0.25)+(1×0.125)
=(1×0.5)+(0×0.25)+(1×0.125)
=0.5+0+0.125=0.625
=0.5+0+0.125=0.625
Terminal Questions and Answers with Explanations

Q6: Convert (101101)₂ to decimal.

Answer: 45

Explanation: Expand using powers of 2:


(1×25)+(0×24)+(1×23)+(1×22)+(0×21)+(1×20)
(1×25)+(0×24)+(1×23)+(1×22)+(0×21)+(1×20)
=32+0+8+4+0+1=45
=32+0+8+4+0+1=45

Q7: Convert (1C2)₁₆ to binary.

Answer: 111000010

Explanation: Convert each hexadecimal digit to 4-bit binary:

1₁₆ = 0001₂
C₁₆ = 1100₂
2₁₆ = 0010₂

Thus, 1C2₁₆ = 0001 1100 0010₂ or 111000010₂ (removing leading zeros).

Q8: Multiply the binary numbers 101 and 11.

Answer: 1111
Explanation: Perform binary multiplication:

101
× 11
-------
101 (101 × 1)
+ 1010 (101 × 1, shifted left)
-------
1111

Thus, 101₂ × 11₂ = 1111₂.

Q9: Divide the binary number 110010 by 101.

Answer: 110
Explanation:
Perform binary division:

101 | 110010
-101
----
110
-101
----
1

The quotient is 110₂.

Q10: Find the result of adding the hexadecimal numbers A4 and 9B.

Answer: 13F

Explanation: Convert to decimal, add, and convert back:


A416=16410,9B16=15510
A416=16410,9B16=15510
164+155=31910
164+155=31910

Convert 319₁₀ to hexadecimal:


319÷16=19 remainder 15(F)
319÷16=19 remainder 15(F)
19÷16=1 remainder 3
19÷16=1 remainder 3

Thus, A4₁₆ + 9B₁₆ = 13F₁₆.

Q11: Subtract the hexadecimal number 3F from 8A.

Answer: 4B
Explanation:
Convert to decimal:
8A16=13810,3F16=6310
8A16=13810,3F16=6310
138−63=7510
138−63=7510

Convert 75₁₀ to hexadecimal:


75÷16=4 remainder 11(B)
75÷16=4 remainder 11(B)

Thus, 8A₁₆ - 3F₁₆ = 4B₁₆.


Q12: Multiply the octal numbers 17 and 21.

Answer: 367
Explanation:
Convert to decimal:
178=(1×81)+(7×80)=8+7=1510
178=(1×81)+(7×80)=8+7=1510
218=(2×81)+(1×80)=16+1=1710
218=(2×81)+(1×80)=16+1=1710

Multiply:
15×17=25510
15×17=25510

Convert 255₁₀ to octal:


255÷8=31 remainder 7
255÷8=31 remainder 7
31÷8=3 remainder 7
31÷8=3 remainder 7

Thus, 17₈ × 21₈ = 367₈.


CHAPTER 3
CHAPTER 4
CHAPTER 5
CHAPTER 6
CHAPTER 7
CHAPTER 8
CHAPTER-9
CHAPTER 10
CHAPTER 11
CHAPTER 12

You might also like