0% found this document useful (0 votes)
6 views14 pages

Previous Year Solved

Uploaded by

Subham Garain
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)
6 views14 pages

Previous Year Solved

Uploaded by

Subham Garain
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/ 14

2 Marks

1. What is meant by clustering support?

Clustering support refers to enabling multiple servers or systems to work together as a single unit to
ensure high availability, fault tolerance, and scalability in distributed systems. Example: Database
clustering for load balancing.

2. What do you understand by DNS?

The Domain Name System (DNS) translates human-readable domain names (e.g.,
www.example.com) into IP addresses (e.g., 192.168.1.1) for network communication.

3. Replace the purpose of swap space in a virtual memory system.

Swap space is used as a backup for RAM to store inactive pages or processes when physical memory
is full. It helps run larger programs by extending memory virtually but can slow down performance.

4. What do you understand by UDP?

User Datagram Protocol (UDP) is a connectionless transport layer protocol that allows fast,
lightweight data transmission without guaranteeing delivery, order, or reliability. Example: Streaming
and gaming.

5. Explain why critical section is very important for concurrent programming.

A critical section is a block of code that accesses shared resources (e.g., variables, files). It is crucial to
ensure mutual exclusion, preventing race conditions and data inconsistency in concurrent
programming.

6. What is a firewall?

A firewall is a security system that monitors and controls incoming and outgoing network traffic
based on predefined rules. It acts as a barrier to block unauthorized access to or from private
networks.

7. Explain the context of Thread Local Storage in the context of multi-threading.

Thread Local Storage (TLS) allows threads in a multi-threaded program to store data unique to each
thread. It ensures data isolation, preventing data conflicts among threads.

8. Give disadvantages of peer-to-peer network.

• Lack of centralized management.


• Security risks due to decentralized nature.

• Difficult to back up data.

• Not suitable for large-scale applications.

9. Summarize the working principle of Belady's anomaly in the page replacement algorithm.

Belady's anomaly occurs when increasing the number of page frames leads to more page faults in
FIFO (First-In, First-Out) page replacement, contrary to intuition. This happens due to suboptimal
eviction decisions.

10. Compare and contrast "thrashing" & "overcommitting" in the virtual memory system.

Feature Thrashing Overcommitting

Excessive page swapping due to Allocating more memory to processes than


Cause
insufficient memory. physically available.

May lead to thrashing if overcommitment


Impact Severe performance degradation.
exceeds limits.

Increase physical memory or reduce Overcommitment control via kernel


Prevention
multiprogramming. parameters.

11. Summarize the significance of "fork()" and "exec()" system calls in UNIX-like Operating
Systems.

• fork(): Creates a new child process by duplicating the parent process.

• exec(): Replaces the current process image with a new one (i.e., runs a new program in the
same process space).

12. What is Left Recursion?

Left recursion occurs in a grammar rule where the leftmost symbol in a production can derive itself,
causing infinite recursion in top-down parsers. Example: A → Aα | β. Fixed by converting to A → βA',
A' → αA' | ε.

13. In which OSI Layer does the header and trailer add?

• Headers are added at each OSI layer (except Physical).

• Trailers are added only at the Data Link Layer.

14. Explain why duplicate tuples are not allowed in a relation.


Relational databases adhere to the principle of set theory, where relations are sets of tuples, and
sets do not allow duplicates. This ensures data integrity and uniqueness.

15. Explain Piggybacking.

In networking, piggybacking refers to combining acknowledgment and data in a single frame to


reduce overhead. Used in bidirectional communication.

16. Compare between total and partial participation.

Feature Total Participation Partial Participation

Every entity in the set participates in the Some entities in the set participate in the
Definition
relationship. relationship.

All employees must belong to a Some students opt for extracurricular


Example
department. activities.

17. What is Metadata?

Metadata is "data about data," providing information like structure, format, or properties of data.
Example: In a database, metadata includes table names, column types, and constraints.
5 Marks

The error in the expression a = bc; will be encountered during the Semantic Analysis phase of the
compilation process.

Explanation:

1. Compilation Process Phases:

o Lexical Analysis: Breaks the input into tokens. Here, a, =, b, c, and ; are identified as
tokens. No error is detected since the tokens are valid.

o Syntax Analysis: Checks if the arrangement of tokens follows the grammar rules. In
this case, the syntax (a = bc;) is grammatically valid, so no error is detected.

o Semantic Analysis: Checks for semantic correctness, such as type compatibility and
variable definitions. The error occurs here if:

▪ a is not defined.

▪ bc is treated as a multiplication (if implied) and there’s a type mismatch or


undefined variable b or c.

2. Why Not in Previous Phases?:

o The Lexical Analysis phase only identifies tokens and doesn’t check their meaning or
context.

o The Syntax Analysis phase checks the structure of the code but doesn’t evaluate
data types, variable definitions, or operations.

o The error depends on understanding the meaning and type context, which is the
responsibility of Semantic Analysis.

Key Reason:

Errors like undeclared variables, type mismatches, or invalid operations require context and type
information, which are unavailable in earlier phases. Hence, this error is detected during Semantic
Analysis.
Theta Join in DBMS

A Theta Join is a type of join operation that combines rows from two tables based on a condition
involving a comparison operator. The condition can use operators such as =, <, >, <=, >=, or !=. It is
more general than an Equi Join, which only uses the = operator.

Syntax

sql

Copy code

SELECT *

FROM Table1

JOIN Table2

ON Table1.column operator Table2.column;

Example

Consider the following two tables:

Table: Employees

EmpID EmpName DeptID

1 Alice 101

2 Bob 102

3 Carol 103

Table: Departments

DeptID DeptName Budget

101 HR 50000

102 IT 100000

103 Finance 75000

Query: Find all Employees whose Department Budget is greater than 70,000

sql

Copy code

SELECT Employees.EmpID, Employees.EmpName, Departments.DeptName, Departments.Budget


FROM Employees

JOIN Departments

ON Employees.DeptID = Departments.DeptID AND Departments.Budget > 70000;

Result

EmpID EmpName DeptName Budget

2 Bob IT 100000

3 Carol Finance 75000

Key Points

1. The Theta Join uses the condition Departments.Budget > 70000 in addition to the equality
condition Employees.DeptID = Departments.DeptID.

2. It allows flexibility to apply complex comparison conditions beyond just equality.

Theta Join in DBMS

A Theta Join is a type of join operation that combines rows from two tables based on a condition
involving a comparison operator. The condition can use operators such as =, <, >, <=, >=, or !=. It is
more general than an Equi Join, which only uses the = operator.

Syntax

SELECT *

FROM Table1

JOIN Table2

ON Table1.column operator Table2.column;

Example

Consider the following two tables:

Table: Employees

EmpID EmpName DeptID

1 Alice 101

2 Bob 102
EmpID EmpName DeptID

3 Carol 103

Table: Departments

DeptID DeptName Budget

101 HR 50000

102 IT 100000

103 Finance 75000

Query: Find all Employees whose Department Budget is greater than 70,000

SELECT Employees.EmpID, Employees.EmpName, Departments.DeptName, Departments.Budget

FROM Employees

JOIN Departments

ON Employees.DeptID = Departments.DeptID AND Departments.Budget > 70000;

Result

EmpID EmpName DeptName Budget

2 Bob IT 100000

3 Carol Finance 75000

Key Points

1. The Theta Join uses the condition Departments.Budget > 70000 in addition to the equality
condition Employees.DeptID = Departments.DeptID.

2. It allows flexibility to apply complex comparison conditions beyond just equality.


Routers

• Definition: A router is a networking device that forwards data packets between computer
networks. It determines the best path for data to travel across networks based on IP
addresses.

• Key Functions:

1. Connects multiple networks (e.g., LANs and WANs).

2. Routes data using protocols like OSPF, BGP, and RIP.

3. Manages traffic and prevents congestion.

• Example: A home router connects your devices to the internet.

Subnets

• Definition: A subnet (short for subnetwork) is a logical subdivision of an IP network. Subnets


allow large networks to be divided into smaller, more manageable segments.

• Purpose:

1. Improve network efficiency by reducing broadcast traffic.

2. Enhance security by isolating sections of a network.

3. Assign IP ranges to specific departments or functions.

• Example: A company divides its network into subnets for HR, IT, and Finance.

Switched Bridges

• Definition: A switched bridge (or simply a switch) is a networking device that connects
multiple devices in a LAN and uses MAC addresses to forward data only to the intended
recipient.

• Key Characteristics:

1. Operates at the Data Link Layer (Layer 2 of the OSI model).

2. Segments a network to reduce collisions.

3. Maintains a MAC address table to direct traffic efficiently.

• Example: A switch connects computers and printers within an office.

Comparison:

Feature Router Subnet Switched Bridge

Layer Network Layer (Layer 3) Logical subdivision of IPs Data Link Layer (Layer 2)
Feature Router Subnet Switched Bridge

Purpose Connect networks Divide networks Connect devices in a LAN

Address Used IP Address IP Address MAC Address

Traffic Scope Between networks Within a network Within a LAN (limits broadcast)

Each of these components plays a crucial role in modern networking, helping to manage, segment,
and direct traffic for optimal performance and security.

Foreign Key

A Foreign Key is a column (or a set of columns) in one table that serves as a link to the Primary Key
in another table. It establishes a relationship between the two tables and ensures referential
integrity by enforcing a rule that the value in the foreign key column must match a value in the
referenced table's primary key.

Key Concepts:

1. Referential Integrity:

o Ensures that the foreign key value in one table corresponds to an existing value in
the primary key column of the referenced table.

o Prevents orphan records (rows in a table that refer to nonexistent rows in another
table).

2. Parent-Child Relationship:

o The table containing the primary key is called the Parent Table.

o The table containing the foreign key is called the Child Table.

3. Enforcement:

o Foreign key constraints ensure data consistency and enforce business rules.

VPN (Virtual Private Network)

A Virtual Private Network (VPN) is a secure connection between a user’s device and another
network over the internet. It creates an encrypted tunnel that ensures privacy and security for data
transmitted across the network.

Key Features of VPN:

1. Privacy:
o Hides the user’s IP address and location by routing traffic through the VPN
server.
2. Security:
o Encrypts data, making it unreadable to hackers or unauthorized entities.
3. Bypass Restrictions:
o Allows users to access geo-blocked content by masking their location.
4. Anonymity:
o Users can browse the internet without revealing their identity.

How VPN Works:

1. When you connect to a VPN, your internet traffic is routed through an encrypted tunnel to a
VPN server.

2. The VPN server forwards your request to the internet, masking your original IP address.

3. Responses from the internet pass back through the VPN server to your device securely.

Benefits of Using a VPN:

• Secure Public Wi-Fi: Protects your data on untrusted networks.

• Access Restricted Content: Enables access to services or websites unavailable in your


location.

• Data Protection: Prevents ISPs, advertisers, or hackers from tracking your online activities.

Types of VPN Protocols:

1. OpenVPN: Highly secure and widely used.

2. IPSec/L2TP: Common for securing network connections.

3. PPTP: Faster but less secure.

4. WireGuard: A modern, lightweight, and fast VPN protocol.

VPNs play a vital role in enhancing privacy, security, and accessibility in today’s interconnected world.
10 Marks
To find the candidate keys of a relation R=(A,B,C,D,E,H)R = (A, B, C, D, E, H) with the functional
dependencies:

1. A→BA \to B

2. BC→DBC \to D

3. E→CE \to C

4. D→AD \to A

Step 1: Determine the closure of attributes

The candidate key is the minimal set of attributes whose closure includes all attributes in RR.

Closure of a set of attributes

The closure of a set XX (denoted X+X^+) is all attributes that can be functionally determined from
XX.

Step 2: Attribute dependency analysis

From the given functional dependencies:

1. A→BA \to B: Knowing AA, you can determine BB.

2. BC→DBC \to D: Knowing BB and CC, you can determine DD.

3. E→CE \to C: Knowing EE, you can determine CC.

4. D→AD \to A: Knowing DD, you can determine AA, which also determines BB (via A→BA \to
B).

Step 3: Compute closure to find candidate keys

Start with the smallest possible attribute sets:

• Single attributes:

o A+={A,B}A^+ = \{A, B\}: Cannot determine C,D,E,HC, D, E, H.

o B+={B}B^+ = \{B\}: Cannot determine A,C,D,E,HA, C, D, E, H.

o C+={C}C^+ = \{C\}: Cannot determine A,B,D,E,HA, B, D, E, H.

o D+={D,A,B}D^+ = \{D, A, B\}: Cannot determine C,E,HC, E, H.

o E+={E,C}E^+ = \{E, C\}: Cannot determine A,B,D,HA, B, D, H.

o H+={H}H^+ = \{H\}: Cannot determine A,B,C,D,EA, B, C, D, E.

None of the single attributes are keys.


• Combinations of attributes:

o DE+={D,E,C,A,B}DE^+ = \{D, E, C, A, B\}: Cannot determine HH.

o CE+={C,E}CE^+ = \{C, E\}: Cannot determine A,B,D,HA, B, D, H.

o BC+={B,C,D,A}BC^+ = \{B, C, D, A\}: Cannot determine E,HE, H.

o BE+={B,E,C}BE^+ = \{B, E, C\}: Cannot determine A,D,HA, D, H.

o CD+={C,D,A,B}CD^+ = \{C, D, A, B\}: Cannot determine E,HE, H.

• Minimal key: The smallest set of attributes whose closure includes {A,B,C,D,E,H}\{A, B, C,
D, E, H\} is DEHDEH.

Candidate Keys:

• The candidate key for RR is: {DEH}\{DEH\}.


To solve this, we use subnetting principles for the given block 16.0.0.0/816.0.0.0/8 to create 500
fixed-length subnets.

Given:

• Network: 16.0.0.0/816.0.0.0/8

• Subnets required: 500500

Step 1: Calculate the subnet mask

1. Determine the number of bits needed for subnetting:

o Total subnets required = 500

o Formula: 2n≥5002^n \geq 500, where nn is the number of bits borrowed for
subnetting.

o 29=512≥5002^9 = 512 \geq 500, so n=9n = 9.

2. Update the prefix length:

o Original prefix length = 88

o New prefix length = 8+9=178 + 9 = 17.

3. Subnet mask:

o Convert 1717 to dotted decimal:

▪ 11111111.11111111.10000000.0000000011111111.11111111.10000000.00
000000

▪ 255.255.128.0255.255.128.0

Subnet mask = 255.255.128.0255.255.128.0.

Step 2: Number of addresses in each subnet

1. Formula for number of addresses per subnet:

o 2number of host bits2^{\text{number of host bits}}

o Host bits = 32−17=1532 - 17 = 15

o 215=32,7682^{15} = 32,768

Number of addresses in each subnet = 32,768.

Step 3: First and last address in the first subnet

1. First subnet range:


o Network ID of the first subnet: 16.0.0.016.0.0.0.

o Broadcast address of the first subnet:

▪ Add 32,768−1=32,76732,768 - 1 = 32,767 to the network ID.

▪ Convert 32,76732,767 into IP address terms:

▪ 16.0.0.0+32,767=16.0.127.25516.0.0.0 + 32,767 = 16.0.127.255.

2. First and last addresses:

o First address: 16.0.0.116.0.0.1 (network ID + 1).

o Last address: 16.0.127.25416.0.127.254 (broadcast address - 1).

Final Answer:

a. Subnet mask: 255.255.128.0255.255.128.0


b. Number of addresses in each subnet: 32,76832,768
c. First subnet range:

• First address: 16.0.0.116.0.0.1

• Last address: 16.0.127.25416.0.127.254

You might also like