0% found this document useful (0 votes)
2 views10 pages

Chapter 1

The document covers key concepts in distributed systems, including processes, threads, and virtualization. It includes multiple-choice, short answer, and long answer questions to assess understanding of these topics. Key points discussed include the differences between processes and threads, advantages of multi-threading, types of virtualization, and challenges of code migration.

Uploaded by

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

Chapter 1

The document covers key concepts in distributed systems, including processes, threads, and virtualization. It includes multiple-choice, short answer, and long answer questions to assess understanding of these topics. Key points discussed include the differences between processes and threads, advantages of multi-threading, types of virtualization, and challenges of code migration.

Uploaded by

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

Chapter 1: Process & Threads in

Distributed Systems
1. Multiple Choice Questions (MCQs)

Q1: What is a process?


A) A program in execution
B) A thread inside an application
C) A set of system calls
D) A network protocol

Q2: Which of the following is not a component of a process?


A) Program Counter
B) Stack
C) Kernel Module
D) Heap

Q3: Which of the following is true about threads?


A) A thread cannot exist without a process
B) Threads do not share memory
C) Creating a new process is faster than creating a thread
D) Each thread has a separate program counter and stack

Q4: What is the key advantage of multi-threading in distributed systems?


A) Reduces power consumption
B) Improves performance by utilizing parallelism
C) Increases the memory size
D) Makes processes more expensive

2. Short Answer Questions

Q5: What are the key components of a process?

✅ Answer:

 Program Code (Text Section) – Contains executable instructions.


 Program Counter – Tracks execution progress.
 Processor Registers – Store temporary computation values.
 Stack – Stores function calls, parameters, and return addresses.
 Data Section – Contains global variables.
 Heap – Stores dynamically allocated memory.
Q6: Explain the difference between process and thread.

✅ Answer:

Feature Process Thread


Definition A program in execution A lightweight unit of execution within a
process
Memory Has its own memory space Shares memory with other threads
Execution Slow (needs OS Fast (context switching is lightweight)
intervention)
Communicatio Needs IPC (expensive) Direct memory sharing (fast)
n

Q7: What is the dispatcher/worker model in multi-threaded servers?

✅ Answer:

 Dispatcher Thread: Accepts incoming client requests.


 Worker Threads: Process each request in parallel.
 Example: Web servers use multiple worker threads to handle HTTP requests
concurrently.

3. Long Answer Questions

Q8: Explain User-Level Threads vs. Kernel-Level Threads with their pros and cons.

✅ Answer:

Feature User-Level Threads Kernel-Level Threads


Managemen Managed by application Managed by OS
t
Speed Fast (no system calls) Slower (involves OS)
Blocking Entire process gets blocked if a Other threads continue if one is
thread blocks blocked
Flexibility More flexible Less flexible
Use Case Used when threads frequently switch Used when multiple processes need
threading

Pros of User-Level Threads: Fast, lightweight, efficient.


Cons of User-Level Threads: A blocking thread blocks the entire process.

Pros of Kernel-Level Threads: Can handle blocking threads efficiently.


Cons of Kernel-Level Threads: Expensive due to system calls.
Chapter 2: Virtualization & Code
Migration in Distributed Systems
1. Multiple Choice Questions (MCQs)

Q1: What is virtualization?


A) Running multiple processes on a single thread
B) Creating a virtual version of a physical resource
C) Storing memory in a cloud
D) Moving files from one OS to another

✅ Answer: B) Creating a virtual version of a physical resource

Q2: What is not a type of virtualization?


A) Application Virtualization
B) Network Virtualization
C) Process Execution Virtualization
D) Storage Virtualization

✅ Answer: C) Process Execution Virtualization

Q3: What is the primary benefit of virtualization in cloud computing?


A) Reduces hardware dependency
B) Makes the network faster
C) Decreases power consumption
D) Eliminates the need for an operating system

✅ Answer: A) Reduces hardware dependency

Q4: In which of the following scenarios is code migration useful?


A) Running a program on a single-threaded processor
B) Moving processes from an overloaded system to a less loaded one
C) Storing large files in a database
D) Making a CPU run faster

✅ Answer: B) Moving processes from an overloaded system to a less loaded one

2. Short Answer Questions

Q5: What are the different types of virtualization?


✅ Answer:

1. Application Virtualization – Running software without installing it locally (e.g.,


Java Virtual Machine).
2. Network Virtualization – Creating virtual private networks (VPNs).
3. Server Virtualization – Running multiple OS instances on one machine (e.g.,
VMware).
4. Storage Virtualization – Pooling multiple storage devices into a logical unit.
5. Desktop Virtualization – Remotely accessing a full desktop environment.

Q6: What are the key advantages of virtualization in distributed systems?

✅ Answer:

 Resource Efficiency: Multiple virtual machines (VMs) on a single physical server.


 Portability: Applications can run on any virtualized environment.
 Security Isolation: Virtual machines are isolated from each other.
 Cost Savings: Reduces the need for physical servers.

3. Long Answer Questions

Q7: Explain the role of virtualization in cloud computing with an example.

✅ Answer:

 Infrastructure-as-a-Service (IaaS): Cloud providers rent virtual machines instead of


physical servers (e.g., AWS EC2).
 Example: Instead of maintaining a data center, a company rents virtual machines
from a cloud provider, scaling up or down as needed.

Q8: Compare Weak Mobility vs. Strong Mobility in Code Migration.

✅ Answer:

Feature Weak Mobility Strong Mobility


Definition Moves only the code segment Moves code + execution state
Execution The program starts fresh after migration Resumes execution from where it left off
Example Java Applets Process migration in cloud computing

Use Cases:

 Weak Mobility: Sending a script to execute on another machine.


 Strong Mobility: Live migration of a virtual machine.
Q9: What are the challenges of code migration in heterogeneous systems?

✅ Answer:

1. Platform Differences: Different operating systems and hardware.


2. Execution Environment: Code might not be compatible with the target system.
3. Security Risks: Running external code could be dangerous.
4. Performance Overhead: Migration takes time and affects system availability.

Solution: Using Virtual Machines (VMs) or Interpreted Languages (e.g., Java VM,
Python) to enable cross-platform compatibility.

Final Exam Practice


1. Define and compare process, thread, and virtual machine.
2. Explain how multi-threading improves performance in distributed systems.
3. What are the key differences between IaaS, PaaS, and SaaS?
4. Describe an example of code migration and explain its advantages.
5. Why is virtualization important in cloud computing?

Would you like me to generate more questions or a mock exam for extra practice? 🚀

4o

You said:

also for distributed system part


ChatGPT said:

ChatGPT

Here is a complete set of exam-style questions with detailed solutions covering


Distributed Systems, Process & Threads, Virtualization, and Code Migration.

📌 Exam Questions and Solutions:


Distributed Systems
Chapter 1: Introduction to Distributed Systems
1. Multiple Choice Questions (MCQs)

Q1: What is a distributed system?


A) A single computer with multiple CPUs
B) A network of independent computers appearing as a single system
C) A single-user computer system
D) A system that does not require communication between processes

✅ Answer: B) A network of independent computers appearing as a single system

Q2: Which of the following is NOT a characteristic of a distributed system?


A) No global clock
B) Single point of failure
C) Independent failures
D) Concurrency

✅ Answer: B) Single point of failure (Distributed systems aim for fault tolerance)

Q3: What is the main goal of a distributed system?


A) To replace traditional single-user systems
B) To provide transparency, fault tolerance, and scalability
C) To make computing expensive
D) To reduce communication between computers

✅ Answer: B) To provide transparency, fault tolerance, and scalability

Q4: What is scalability in a distributed system?


A) The ability to shrink in size
B) The ability to handle increased workloads efficiently
C) The process of removing unused resources
D) A method for slowing down system performance

✅ Answer: B) The ability to handle increased workloads efficiently

2. Short Answer Questions

Q5: List and explain the three types of scalability in distributed systems.

✅ Answer:

1. Size Scalability: The system can handle more users and resources efficiently.
2. Geographical Scalability: The system works across different locations worldwide.
3. Administrative Scalability: The system remains manageable as it grows in
complexity.

Q6: What are the main transparency types in a distributed system?

✅ Answer:

1. Access Transparency: Users access resources without knowing if they are remote or
local.
2. Location Transparency: Users don’t need to know where a resource is stored.
3. Replication Transparency: Users see a single resource even if multiple copies exist.
4. Failure Transparency: The system continues working despite failures.
5. Concurrency Transparency: Multiple users can access resources simultaneously.

3. Long Answer Questions

Q7: Explain the differences between Grid Computing and Cluster Computing.

✅ Answer:

Feature Grid Computing Cluster Computing


Architecture Decentralized Centralized
Homogeneous (same OS,
Nodes Heterogeneous (different OS, hardware)
hardware)
Communication Uses the internet (WAN) Uses a local network (LAN)
Large-scale computation across multiple High-performance parallel
Purpose
institutions processing
Example SETI@Home Google Search Engine Clusters

📌 Exam Questions and Solutions: Process


& Threads
Chapter 2: Process & Thread Management
1. Multiple Choice Questions (MCQs)

Q1: What is a process?


A) A program stored on a hard drive
B) A program in execution
C) A single line of code
D) A network message
✅ Answer: B) A program in execution

Q2: Which component of a process stores function calls and local variables?
A) Heap
B) Stack
C) Data Section
D) Program Counter

✅ Answer: B) Stack

2. Short Answer Questions

Q3: Explain the differences between a process and a thread.

✅ Answer:

 Process: An independent program execution with its own memory.


 Thread: A lightweight execution unit within a process that shares memory.

Feature Process Thread


Memory Has its own memory space Shares memory with other threads
Slow (context switching requires OS
Execution Fast (low overhead)
intervention)
A web browser and a video player A browser using multiple threads for
Example
running separately rendering, downloading, etc.

Q4: What is the benefit of multi-threading in servers?

✅ Answer:

 Faster Request Handling – Handles multiple requests concurrently.


 Hides Network Latency – Continues processing while waiting for data.
 Lower Overhead – Creating threads is cheaper than creating new processes.

📌 Exam Questions and Solutions:


Virtualization & Code Migration
Chapter 3: Virtualization in Distributed Systems
1. Multiple Choice Questions (MCQs)
Q1: What is virtualization?
A) A method to reduce internet speed
B) A technology that allows multiple virtual instances on a single physical machine
C) A system that prevents OS from running
D) A method to delete duplicate files

✅ Answer: B) A technology that allows multiple virtual instances on a single physical


machine

Q2: Which of the following is not a type of virtualization?


A) Network Virtualization
B) Storage Virtualization
C) Cloud Virtualization
D) Application Virtualization

✅ Answer: C) Cloud Virtualization (Cloud computing is a broader concept, while


virtualization is a technique used in cloud computing.)

2. Short Answer Questions

Q3: Explain three types of virtualization with examples.

✅ Answer:

1. Server Virtualization: Running multiple OS on one machine (e.g., VMware,


VirtualBox).
2. Network Virtualization: Creating virtual private networks (VPNs).
3. Storage Virtualization: Pooling multiple storage devices into a single logical storage
unit.

Chapter 4: Code Migration in Distributed Systems


1. Multiple Choice Questions (MCQs)

Q1: What is the primary purpose of code migration in distributed systems?


A) To slow down execution speed
B) To improve performance and load balancing
C) To prevent code execution
D) To remove unnecessary files

✅ Answer: B) To improve performance and load balancing


Q2: What is weak mobility in code migration?
A) The ability to migrate an entire execution state
B) Moving only the code segment
C) The ability to execute code only in one machine
D) Migrating code without changing its state

✅ Answer: B) Moving only the code segment

2. Short Answer Questions

Q3: Compare Weak Mobility vs. Strong Mobility.

✅ Answer:

Feature Weak Mobility Strong Mobility


Definition Moves only the code segment Moves code + execution state
Execution Starts fresh on the new machine Resumes execution from where it stopped
Example Java Applets Live migration of a virtual machine

Q4: What are the challenges of code migration in heterogeneous systems?

✅ Answer:

 Platform Compatibility: The target machine may not support the migrated code.
 Security Issues: Running unverified code from another machine poses risks.
 Performance Overhead: Migration can cause system downtime.

Solution: Using Virtual Machines (VMs) or Interpreted Languages (e.g., Java VM,
Python) to ensure cross-platform compatibility.

📌 Final Exam Practice Questions


1. Explain the key differences between Distributed Systems and Standalone
Systems.
2. Why is transparency important in Distributed Systems? Give examples.
3. What are the three types of scalability in distributed systems?
4. How do multi-threaded servers improve performance?
5. What are the advantages of virtualization in cloud computing?
6. Describe an example where code migration improves efficiency in a system.

You might also like