All Book SA & Terminal Q&A
All Book SA & Terminal Q&A
CHAPTER 1
Self-Assessment Questions – 1
Answer: True
Answer: (a) PC OS
Self-Assessment Questions – 2
Answer: (b) Gives the illusion of sole hardware disposal to each user.
Terminal Questions
(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.
(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.
Layered Approach: Divides the OS into layers, each handling specific functions.
Answer:
Parallel Systems: Multiple processors share a single memory and clock, working
together for better performance.
Answer:
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
Answer: False
2. A __________ serves as a repository of information about a process and
varies from process to process.
Self-Assessment Questions – 2
Answer: True
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 ______________.
Self-Assessment Questions – 3
Answer: False
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
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:
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.
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?
Advantages:
CHAPTER 3
Self-Assessment Questions – 1
1. Scheduling is a fundamental operating-system function. (True / False)
Answer: True
Self-Assessment Questions – 2
Answer: False
Answer: Round-Robin
Self-Assessment Questions – 3
Answer: True
Answer:
Disadvantages: Can cause convoy effect, where short processes wait for long
processes to complete.
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?
CHAPTER 4
Self-Assessment Questions – 1
Answer: True
Self-Assessment Questions – 2
Answer: True
Self-Assessment Questions – 3
Answer: True
Answer: Dijkstra
Terminal Questions
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.
Binary Semaphore: Can have only two values (0 or 1), used for mutual exclusion.
Counting Semaphore: Can have multiple values, used for resource management.
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.
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
Answer: True
Answer: Blocked
Self-Assessment Questions – 2
Answer: False
Answer: Avoidance
Self-Assessment Questions – 3
Answer: True
Terminal Questions
11. What are the necessary conditions for deadlock to occur?
Resources are represented by rectangles with dots inside them (each dot represents
an instance of the resource).
Edges (Arrows):
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.
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.
(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:
(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.
(d) Eliminating Circular Wait: Impose a total ordering of resources and force
processes to request them in order.
Example:
Resources: A, B, C
CHAPTER 6
Self-Assessment Questions – 1
Answer: True
Self-Assessment Questions – 2
4. The operating system is usually present in the upper portion of the main
memory. (True / False)
Answer: False
Answer: Compaction
Self-Assessment Questions – 3
Answer: True
Answer: Segmentation
Terminal Questions
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.
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.
Answer:
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.
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
Answer: True
Self-Assessment Questions – 2
Answer: False
Self-Assessment Questions – 3
Answer: True
Answer: Thrashing
Terminal Questions
Physical Address: The actual address in main memory where data is stored.
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
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.
Answer: Thrashing occurs when a process spends more time in page faults than
executing. Causes of thrashing:
CHAPTER 8
Self-Assessment Questions – 1
Answer: True
Answer: File
Self-Assessment Questions – 2
Answer: False
Self-Assessment Questions – 3
Answer: True
8. FAT stands for _______________.
Terminal Questions
Answer:
(a) Sequential Access: Reads/writes files sequentially, one record at a time.
(c) Indexed Sequential Access: Uses an index to locate data for faster access.
Answer:
Answer:
(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
3. The interaction between the CPU and an I/O device is usually referred to
as “_____________".
(a) Handshaking
(b) Communication
(c) Talking
(d) Listening
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
Terminal Questions
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.
Answer:
(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.
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:
CHAPTER 10
Self-Assessment Questions – 1
Answer: True
2. NOS stands for _______________.
Answer: Network Operating System
Self-Assessment Questions – 2
4. In NOS, the shared data resides on the server and clients access the
shared data. (True / False)
Answer: True
Self-Assessment Questions – 3
7. File / Printer resources software runs both on client and server. (True /
False)
Answer: False
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
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
Terminal Questions
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
Answer: Integrity
Self-Assessment Questions – 2
Answer: False
Answer: Virus
Answer: Anti-virus
Self-Assessment Questions – 3
Answer: True
Self-Assessment Questions – 4
10. Encryption is an important tool in protection, security, and authentication.
(True / False)
Answer: True
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.
Answer:
(b) Computer Virus: A malicious program that attaches itself to legitimate files and
can corrupt or delete data.
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?
(c) Public Key Encryption: Uses different keys for encryption and
decryption.
CHAPTER 12
Self-Assessment Questions – 1
Answer: True
Self-Assessment Questions – 2
Answer: False
Self-Assessment Questions – 3
Answer: True
Terminal Questions
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.
Answer:
(a) SISD (Single Instruction, Single Data): Traditional uniprocessor system.
(b) SIMD (Single Instruction, Multiple Data): Executes the same instruction on
multiple data points.
Answer:
(a) Bus-oriented systems: Processors share a common bus.
(d) Multistage switching network: Uses multiple stages of switching elements for
data transfer.
Answer:
(a) Separate Supervisors: Each processor has its own OS instance.
(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.
CHAPTER 1
Self-Assessment Questions – 1
Answer: Oak
Answer: Mosaic
Self-Assessment Questions – 2
Answer: Compilation
Answer: Portable
Answer: Multithreading
Answer: True
Self-Assessment Questions – 3
Answer: True
13. What is the Java command to disassemble Java files and print
representation of Java bytecode?
(a) javap
(b) javac
(c) javadoc
(d) jar
Self-Assessment Questions – 4
Answer: Keytool
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
Answer: Java
Answer: Certificate
Terminal Questions
Answer:
(c) Portable: Java bytecode can be executed on any platform with JVM.
(d) Secure: Java enforces strong security features through runtime checks.
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.
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
Answer: Bytecode
Self-Assessment Questions – 2
Self-Assessment Questions – 3
Self-Assessment Questions – 4
Answer: False
Self-Assessment Questions – 5
Answer: Public
Self-Assessment Questions – 6
Answer: New
Self-Assessment Questions – 7
Answer: .java
Answer: Javac
Answer: Java
Terminal Questions
Answer:
class Candidate {
String candidateName;
String candidateAddress;
String candidateCourse;
public Candidate() {
candidateName = "Arun";
candidateAddress = "Manipal";
candidateCourse = "BScIT";
}
Answer:
Answer:
Answer:
Java class files are executed using the command: java classname
CHAPTER 3
Self-Assessment Questions – 1
Answer: %
Answer: &&
3. If-else is a looping statement. (True / False)
Answer: False
Answer: False
Terminal Questions
Answer:
Answer:
• Operator precedence determines the order in which operators are evaluated
in an expression.
Answer:
Decision-Making Statements:
• if-else
• switch-case
Looping Statements:
• for loop
• while loop
• do-while loop
Other Statements:
• break
• continue
Answer:
Output:
Answer:
import java.util.Scanner;
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();
}
}
11. Write a Java program to find the sum of 1+3+5+…. for 10 terms in the
series.
Answer:
Output:
CHAPTER 4
Self-Assessment Questions – 1
Answer: Array
Answer: Index
Answer: String
Self-Assessment Questions – 2
Answer: charAt()
Answer: getChars()
Answer: equals()
Self-Assessment Questions – 3
Answer: indexOf()
Answer: lastIndexOf()
Answer: substring()
Self-Assessment Questions – 4
21. To set the length of the buffer within a StringBuffer object, use
______________ method.
Answer: setLength()
Answer: append()
23. You can reverse the characters within a StringBuffer object using
________________ method.
Answer: reverse()
Terminal Questions
Example:
25. List out with examples various character extraction functions available
in Java.
Answer:
(b) getChars(int start, int end, char[] target, int targetStart) – Extracts multiple
characters.
Example:
Answer:
Example:
27. What are the functions available in Java to modify a String? Explain with
examples.
Answer:
(a) concat() – Concatenates strings.
Example:
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:
CHAPTER 5
Self-Assessment Questions
Answer: Inheritance
Answer: Superclass
Answer: Subclass
Answer: Part-of
Answer: Package
Answer: package
Answer: True
9. The specific location that the Java compiler will consider as the root of
any package hierarchy is controlled by _______________.
Answer: CLASSPATH
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 ____________.
Terminal Questions
Answer:
(a) A-Kind-Of Relationship
(b) Is-A Relationship
(c) Part-Of Relationship
(d) Has-A Relationship
Syntax:
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.
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?
CHAPTER 6
Self-Assessment Questions
Answer: Object-oriented
Answer: Throwable
Answer: java.lang
Answer: ArithmeticException
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).
Answer:
Answer:
(a) try-catch: Used to handle exceptions by enclosing risky code in a try block
and catching exceptions in a catch block.
Example:
CHAPTER 7
Self-Assessment Questions
Answer: Streams
2. The two basic streams used are the _______ and the ________ streams.
3. _________ are used to read data from one stream and write it to another
stream.
Answer: Filters
7. The _____________ and ____________ classes are the filter streams that
allow the reading and writing of Java primitive data types.
8. The _______ and _________ classes are abstract classes that support the
reading and writing of Unicode character streams.
Answer: 16 bits
10. The most important subclasses of the Reader and Writer classes are
__________ and ___________.
11. Java provides the ________ class to perform I/O operations at specified
locations within a file.
Answer: RandomAccessFile
13. The capability of an object to exist beyond the execution of the program
that created it is known as ___________.
Answer: Persistence
Answer: Serialization
Terminal Questions
Answer:
Answer:
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.
Answer:
(b) It allows operations like filtering, mapping, sorting, and reducing large data
sets efficiently.
CHAPTER 8
Self-Assessment Questions
Answer: True
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: True
Answer: Sequence
10. The three main iterators in Java are ______, ______, ______.
Answer: False
Answer: Properties
Terminal Questions
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.
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: 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.
Answer:
Answer:
Example:
Self-Assessment Questions
Answer: False
Answer: Multithreading
Answer: Threads
Answer: False
Answer: setDaemon(True)
Answer: False
Answer: run()
13. When the Thread class extension method is used, unique ____________
are created and they consume ____________.
14. The Thread Class Extension method is the more preferable method for
thread creation and running. (True/False)
Answer: False
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: False
23. The longer the threads wait for information, the higher the
________________ of CPU cycles.
Answer: Wastage
Terminal Questions
Answer: Threads are lightweight processes that can run independently while sharing
memory space with other threads.
Answer: Synchronization ensures that multiple threads do not interfere with each other
while accessing shared resources, preventing data inconsistency.
Answer:
(a) start(): Begins execution of a thread
Answer:
(a) Non-Synchronized Threads: Multiple threads accessing the same resource
may result in data inconsistency.
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:
CHAPTER 10
Self-Assessment Questions
Answer: True
2. While executing assertion, it is believed to be true. If it fails, JVM will throw
an error named ____________.
Answer: AssertionError
Answer: Primitive
Answer: Enums
Answer: True
Answer: @interface
Answer: Marker
Answer: JUnit
Answer: Regression
Answer: False
16. Testing is the process of checking whether the application is giving the
desired output or not. (True/False)
Answer: True
18. __________________ present a fact after comparing the expected and the
actual output according to the method used.
Answer: Assertion
Answer: Three
20. Select _____________ in the Java editor to create a new JUnit test case.
Answer: MyClass
Answer: False
Answer: True
Terminal Questions
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:
Answer:
Answer: The import static feature allows accessing static members of a class
without qualifying them with the class name.
Example:
Answer: JUnit is an open-source unit testing framework for Java that helps
automate testing.
Answer:
Answer: Unit testing is the practice of testing individual units (methods, classes)
of software to validate their correctness.
Answer:
(a) Open-source framework
(b) Provides annotation support
(c) Supports assertions for testing
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
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
Answer:
Self-Assessment Questions
Answer: ActionEvent
Answer: EventObject
Answer: Event-handler
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
Answer: javafx.animation
Answer: Java
Answer: javax.swing
Terminal Questions
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)
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
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.
Answer:
(a) JButton (Button)
(b) JTextField (Text input)
(c) JLabel (Display text)
(d) JPanel (Container)
(e) JTable (Table view)
CHAPTER 12
Self-Assessment Questions
Answer: jdbc
Answer: <subname>
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: False
13. ORM has no major role to play in Hibernate and is not associated with
JPA. (True/False)
Answer: False
Answer: True
Answer: False
Answer: True
Answer: True
Terminal Questions
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.
(b) JDBC Driver Manager: Handles the selection and management of drivers.
Answer:
(a) Click on the ODBC Data Source icon in the Control Panel.
(c) Select "SQL Server" from the list and click on "Finish."
CHAPTER 1
Self-Assessment 1
a. DBMS
b. ADBMS
c. Database ✅
d. RDBMS
✅ 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
Self-Assessment 3
❌ False
Answer: Domains
Self-Assessment 4
Answer: Centralized
✅ True
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.
Answer:
Answer:
Answer:
Q5: Briefly describe the network database model and differentiate it from the
hierarchical database model.
Answer:
Q6: What are the various types of Database Management Systems (DBMS)?
Briefly explain.
Answer:
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:
Advantages:
Disadvantages:
CHAPTER 2
Self-Assessment 1
Answer: True
Self-Assessment 2
Answer: Transactions
Self-Assessment 3
Self-Assessment 4
Answer: True
Self-Assessment 5
Answer: HAVING
Self-Assessment 6
Answer: View
12. During the query execution, contents are taken from other tables.
(True/False)
Answer: True
Self-Assessment 7
Answer: True
Self-Assessment 8
15. SQL offers _________ statements that make the process of concurrent
transaction control easy.
Answer: Consistency
Self-Assessment 9
20. The Fifth Normal Form is usually useful when we have large relational
data models. (True/False)
Answer: True
Answer: True
Self-Assessment 10
24. From a __________ point of view, it is standard to have tables that are in
Third Normal Form.
Answer: False
Answer: True
Self-Assessment 11
Answer: True
28. _________ splits tables by rows, thus reducing the number of records per
table.
Q1: What are the two common query languages supported by RDBMS?
A3: Integrity constraints are rules that ensure the correctness of data in a database.
They include:
Q4: What is the difference between a Primary Key and a Foreign Key?
A4:
Q5: What are the different types of Normal Forms in database normalization?
A5:
Q6: What is the purpose of the COMMIT and ROLLBACK commands in SQL?
A6:
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.
A8: Triggers are automatic actions executed by the database when certain events
occur, such as INSERT, UPDATE, or DELETE operations.
A9:
CHAPTER 3
Self-Assessment 1
Answer: Sorting
Answer: Attributes
Answer: True
Self-Assessment 2
Answer: PROJECT
Answer: False
Self-Assessment 3
Answer: Execution
Answer: True
Self-Assessment 4
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
Self-Assessment 6
Answer: True
15. _____________ is defined as a set of rows that encode the changes made
to a specific base table.
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.
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.
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
Answer: True
5. Tuple-at-a-time, unary operations require neither _____________ nor
____________.
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: False
Self-Assessment 4
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
Answer: Partitioning the data using a hash function so that tuples requiring
processing together have the same hash value.
Self-Assessment 6
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 ______________.
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
Answer: JOIN
A1: Physical query plans are built from operators, where each operator implements
one step of the execution plan. These operators include:
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:
CHAPTER 5
Self-Assessment 1
Answer: True
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
Answer:
They allow flexible reordering of operators.
They adapt query execution dynamically based on runtime feedback.
Self-Assessment 3
Answer: True
Answer: True
Self-Assessment 4
Answer: True
Self-Assessment 5
10. Many queries can run for a very long time in large-scale systems. (True/
False)
Answer: True
Self-Assessment 6
13. ____________ utilises intervals over query cost estimates, rather than
specifying the estimates for a single value.
Self-Assessment 7
Answer: True
Answer: Possible
Self-Assessment 8
17. The algebra expression partly does not evaluate the query. (True/ False)
Answer: False
Q1: Explain the eddy architecture and how it allows for extreme flexibility.
(d) Join Algorithms and Indexes – Various strategies like nested-loop join, hash
join, and index join.
(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
✅ 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 ✅
Self-Assessment 3
5. Part II selects & inserts suitable lock modes to database (DB) operations
such as read, write, or update. (True/False)
❌ False
Self-Assessment 4
Answer: IS Lock
✅ True
Self-Assessment 5
❌ False
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
✅ True
Shrinking Phase: Transactions release locks but do not acquire new ones.
Q2: What are the different lock modes used in the locking system? Discuss.
(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.
(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.
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
Self-Assessment 2
Answer: False
Self-Assessment 3
Self-Assessment 4
Self-Assessment 5
Answer: True
Answer: View-serialisable
Self-Assessment 6
Self-Assessment 7
A1: Advantages:
Disadvantages:
A2:
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.
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.
CHAPTER 8
Self-Assessment 1
Self-Assessment 2
Self-Assessment 3
Self-Assessment 4
7. Partitioning data very much improves the managing capacity of very big
databases. (True/False)
Answer: True
Self-Assessment 5
9. The full form of OLTP is __________________.
Answer: True
Self-Assessment 6
Answer: False
Self-Assessment 7
Answer: True
Self-Assessment 8
15. The chances of any processor or disk failing are higher in a parallel
system. (True/False)
Answer: True
Answer: Data
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
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.
Techniques:
Round-robin partitioning
Hash partitioning
Range partitioning
Q4: What are the different types of partitioning techniques? Describe in detail.
A4:
Q5: What is Intra-query and Inter-query parallelism? Explain with the help of a
diagram.
A5:
(c) Illustration: Diagrams in Section 7 show how queries are split and executed in
parallel.
A6:
Feature Intra-Operation Parallelism Inter-Operation Parallelism
A7:
(a) Handling data skew
(b) Failure recovery mechanisms
(c) Managing high inter-processor communication
(d) Efficient parallel query execution
CHAPTER 9
Self-Assessment 1
Answer: Objects
Answer: False
Self-Assessment 2
Answer: True
Self-Assessment 3
Answer: Value
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
Answer: False
Self-Assessment 5
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
Answer: Abstract
Self-Assessment 7
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
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
Answer: Colon
Answer: True
Self-Assessment 10
Answer: isa
Answer: True
Self-Assessment 11
Answer: True
(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.
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.
Example:
In Embedded SQL, a developer must explicitly fetch and insert records.
In a Persistent Language, objects are directly stored and retrieved.
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:
CHAPTER 10
Self-Assessment 1
Answer: Sites
Answer: False
Self-Assessment 2
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
Answer: False
Answer: True
Self-Assessment 4
Answer: Data
Self-Assessment 5
12. For distributed transactions, each computer is not required to have a local
transaction manager. (True/False)
Answer: False
15. _______ is a transaction protocol which is used for the complexities that
are associated with distributed resource managers.
Self-Assessment 7
Answer: Processes
17. System maintains a single __________ that exists in a single chosen site.
Self-Assessment 8
18. In a _________, the inherent redundancy in the system can be utilised for
recovery.
Self-Assessment 9
20. In _________, entries are planned by identifier or name and intended for
forward lookup to locate more about the entry.
Self-Assessment 10
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
Answer: False
Components of DDBMS:
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
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.
(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.
CHAPTER 11
Self-Assessment 1
Answer: True
2. The main advantage of the object-relational data model arises from the
concept of “_____________.”
Self-Assessment 2
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
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
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
Answer: True
Self-Assessment 7
14. Out of RDBMS, OODBMS, and ORDBMS, which has the best
performance?
Answer: RDBMS
Advantages:
Supports complex data types
Enhances data modeling capabilities
Provides better query optimization
Disadvantages:
More complex than RDBMS
Performance overhead due to advanced features
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
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
Q5: What are the main reasons behind the development of ORDBMS?
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.
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
A8:
A9:
CHAPTER 12
Self-Assessment 1
Answer: Triggered
2. The main events that are defined for rules triggered are the common
SQL statements in STARBURST. (True/False)
Answer: True
Self-Assessment 2
Answer: Time-referenced
Self-Assessment 3
Answer: True
Answer: False
Self-Assessment 4
Answer: Extended
11. Video shots are processed to take out MPEG7-supporting low-level visual
characteristic signifiers. (True/False)
Answer: True
Q1: What is an active database? Explain what the active rules for Oracle are.
Example:
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
Key Features:
Minimises memory requirements.
Prefetching and caching improve video playback.
Works with media servers to provide uninterrupted streaming.
a) Starburst:
b) Oracle
c) DB2
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.
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
CHAPTER 1
Self-Assessment 1
Answer: 10
Answer: 2
Answer: F
Answer: Real
Answer: Rounding
Answer: 8
Answer: Two's
Answer: Floating
Answer: Inaccuracies
10. Conversion from decimal to binary involves dividing by _______ and
noting the remainder.
Answer: 2
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
Q9: What is the sum of the binary numbers 1010 and 1101?
Q17: What is the result of adding the hexadecimal numbers A4 and 9B?
CHAPTER 2
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
Answer: 531
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
0110₂ = 6₁₆
1101₂ = D₁₆
Q4: What is the sum of the binary numbers 1010 and 1101?
Answer: 10111
Explanation:
Perform binary addition:
1010
+ 1101
-----------
10111
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.
Answer: 0.625
Answer: 45
Answer: 111000010
1₁₆ = 0001₂
C₁₆ = 1100₂
2₁₆ = 0010₂
Answer: 1111
Explanation: Perform binary multiplication:
101
× 11
-------
101 (101 × 1)
+ 1010 (101 × 1, shifted left)
-------
1111
Answer: 110
Explanation:
Perform binary division:
101 | 110010
-101
----
110
-101
----
1
Q10: Find the result of adding the hexadecimal numbers A4 and 9B.
Answer: 13F
Answer: 4B
Explanation:
Convert to decimal:
8A16=13810,3F16=6310
8A16=13810,3F16=6310
138−63=7510
138−63=7510
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