0% found this document useful (0 votes)
10 views5 pages

Case Study Questions

The document presents six case studies focused on designing various distributed systems, including an online conference system, a gaming platform, a banking system, a smart home hub, a social media platform, and a smart grid. Each case study addresses critical issues such as concurrency, deadlock, synchronization, and consistency, providing scenarios and questions that explore the challenges and solutions in system design. The document emphasizes the importance of proper resource management, fault tolerance, and maintaining system integrity across distributed architectures.

Uploaded by

nlprsnl
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)
10 views5 pages

Case Study Questions

The document presents six case studies focused on designing various distributed systems, including an online conference system, a gaming platform, a banking system, a smart home hub, a social media platform, and a smart grid. Each case study addresses critical issues such as concurrency, deadlock, synchronization, and consistency, providing scenarios and questions that explore the challenges and solutions in system design. The document emphasizes the importance of proper resource management, fault tolerance, and maintaining system integrity across distributed architectures.

Uploaded by

nlprsnl
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/ 5

Case Study 1: The Online Conference System

Imagine you are designing an online conference system (like Zoom or Google Meet) from scratch.
The system needs to support multiple concurrent meetings, each with many participants. The key
components are: a central server for meeting setup and state management, and peer-to-peer
connections for audio/video streaming.

Questions

Concurrent Processes & Critical Section: During meeting setup, multiple participants might try
to join a meeting simultaneously. How would you model this as a concurrent process problem?
Identify the shared resource and define the critical section. Propose a synchronization
mechanism to prevent inconsistencies, explaining why your chosen mechanism (e.g.,
semaphores, mutexes, monitors) is appropriate for this scenario.

Deadlock Analysis: Consider the scenario where two participants, P1 and P2, are trying to join a
meeting. They both need to acquire a network resource and a server-side meeting slot. Explain
how a deadlock could occur. Using the four necessary and sufficient conditions for a deadlock,
describe how your design can either prevent, avoid, or detect and recover from this potential
deadlock.

Language Mechanisms: If you were to implement the synchronization logic using a high-level
programming language like Java or C++, how would you use built-in language mechanisms (e.g.,
synchronized blocks in Java or condition variables in C++) to enforce mutual exclusion and
manage the waiting queue for participants? Provide a pseudocode snippet to illustrate your
solution for a single participant joining a meeting.

Case Study 2: The Distributed Online Gaming Platform


Your task is to design a massive multiplayer online game. The game world is divided among
multiple servers to handle a large number of players. Player actions (e.g., moving, attacking) are
messages that need to be synchronized across different servers to maintain a consistent game
state.

Questions

Global State & Inconsistency: Player A and Player B are in the same game area, but are handled
by different servers. Player A fires a weapon at Player B. Due to network latency, the message
about Player A's action arrives at Player B's server after Player B has moved. Explain the
inconsistency that arises from this scenario. How can the concept of a consistent cut and the
Chandy-Lamport algorithm be applied to a debugging tool to analyze such inconsistencies
offline?
Synchronization & Deadlock: A player wants to trade two items with another player. This
requires locking both items on both players' servers to prevent them from being used or traded by
others during the transaction. How can this simple trading mechanism lead to a deadlock?
Explain the deadlock model using reusable resources. What deadlock avoidance or prevention
strategies would you recommend for this trading system?

Axiomatic Verification: Propose a simple, formal specification for a two-phase commit protocol
used to finalize a trade. Write down the preconditions, post-conditions, and invariants for the
"prepare" phase of the protocol, demonstrating how axiomatic verification could be used to prove
the correctness of your synchronization logic.

Case Study 3: The Global Online Banking System


You are part of a team designing a new global online banking system. The system needs to support
real-time transactions from customers worldwide. To handle the immense load and ensure high
availability, the system is built on a distributed architecture with multiple servers in different
geographical locations.

Questions

Synchronization & Data Consistency: A customer in New York initiates a transfer of funds to a
customer in London. This transaction requires updating account balances on two different
servers. Explain how the critical section problem applies here. What is a specific synchronization
problem that could arise if both customers try to initiate a transaction at the same time? Use the
concept of axiomatic verification of parallel programs to outline a proof of correctness for your
two-phase commit protocol to ensure that the money is never lost or duplicated.

Deadlock in Transactions: Consider a scenario with two customers, C1 and C2, and two bank
accounts, A1 and A2. C1 wants to transfer money from A1 to A2, while C2 wants to transfer from
A2 to A1. Both transfers require locking the source and destination accounts. Describe the
conditions under which this scenario leads to a process deadlock. Propose a solution to prevent
this deadlock, explaining how your solution breaks one of the four necessary conditions.
Case Study 4: The Smart Home Automation Hub
You are developing the central hub for a new smart home automation system. The hub
communicates with dozens of different devices (lights, thermostats, security cameras, etc.)
using various protocols (Wi-Fi, Zigbee, Bluetooth). The system must be able to handle concurrent
requests from multiple users and devices and manage the complex dependencies between
them.

Questions

Inter-process Communication & State: A user issues a voice command to "set the mood." This
single command triggers multiple actions: dimming the lights, adjusting the thermostat, and
playing music. How would you model the hub's interaction with the devices as concurrent
processes? Explain how the concept of a process applies to a device driver for a smart light bulb.
How would you use a process deadlocks model to represent a situation where the hub is waiting
for a response from a device, but the device is waiting for a command from the hub?

Reusable Resources & Synchronization: A limited resource is the communication channel to


the Wi-Fi router. Only a certain number of devices can send data at a given time. Use the concept
of reusable resources to describe this scenario. Propose a synchronization mechanism to
manage access to this channel, ensuring that no device is starved of access. Justify your choice
of a synchronization mechanism (e.g., semaphores, mutexes) for this specific problem.

Case Study 5: A Globally Distributed Social Media Platform


You are a lead software architect tasked with designing a new social media platform, 'Connectify,'
that will be used by millions of users across the globe. To ensure high availability, low latency, and
fault tolerance, the platform is built on a distributed system. Your primary goal is to handle user
interactions, such as posting updates, liking content, and sending messages, while ensuring
consistency and reliability.

Questions

Event Ordering and Synchronization

Scenario: A user in Tokyo posts an update, and a user in New York comments on it a few seconds
later. Due to network latency, the comment arrives at a central server before the original post.

Question: Explain how Lamport's Logical Clock could be used to ensure the comment is
displayed after the post, even with out-of-order message delivery. How does this differ from the
information provided by a Vector Clock?

Global State and Termination Detection


Scenario: The platform's analytics team wants to generate a report on the number of active users
and in-transit messages at a specific moment. However, due to the asynchronous nature of the
system, there is no single "moment" in time that all servers can agree on.

Question: Using the concepts of Global State and Consistent Cuts, describe how you would take
a meaningful snapshot of the system's state to generate this report. Explain how this process
relates to the Termination Detection problem.

Distributed Mutual Exclusion

Scenario: Connectify implements a 'group chat' feature where only one moderator can
broadcast a system-wide announcement at a time. This requires a distributed mutual exclusion
mechanism to prevent multiple simultaneous broadcasts.

Question: Describe a potential issue with using a Non-Token Based Algorithm like Lamport's for
this specific scenario. Alternatively, explain how a Token Based Algorithm such as Suzuki-
Kasami's Broadcast Algorithm would solve this, detailing the role of the token and how it ensures
only one moderator has access to the critical section (the broadcast function).

Distributed Deadlock Detection

Scenario: Two users, C1 and C2, are trying to update their profile information. The process for C1
requires locking Resource A (the profile database) and then Resource B (the photo album
service). Simultaneously, the process for C2 requires locking Resource B and then Resource A.

Question: Describe the conditions that lead to a Distributed Deadlock in this situation. Propose
a solution using a Centralized Deadlock Detection Algorithm and explain its primary drawback.
Then, propose a solution using a Distributed Deadlock Detection Algorithm and explain why it
might be a better fit for a globally distributed system.
Case Study 6: The Distributed Smart Grid
You are the lead engineer for a new distributed smart grid system. The grid is made up of
thousands of interconnected smart devices, including power meters, transformers, and
renewable energy sources (solar panels, wind turbines). The goal is to optimize energy
distribution and ensure system stability in real-time.

Questions

Fault Tolerance and Agreement Protocols

Scenario: A fault occurs in one part of the grid, and multiple power meters simultaneously report
conflicting status updates to their respective regional servers. To prevent a cascade failure, all
servers must agree on the correct course of action (e.g., rerouting power).

Question: This problem can be modeled as a Byzantine Generals' Problem. Explain the
challenges in achieving Agreement Protocols in a system with potentially faulty (or "malicious")
components. How would a solution like the Two-Phase Commit (2PC) protocol be used to ensure
all servers either commit to a solution or abort, and what are its limitations in this scenario?

State and Consistency

Scenario: The system needs to perform a global state check to identify regions with an energy
surplus that can be redirected to regions with a deficit. However, the energy levels are constantly
fluctuating.

Question: Why is a simple, simultaneous snapshot impossible in this distributed system? Use
the concepts of Cuts and Global State to explain how a consistent view of the energy surplus and
deficit could be captured at a given point in time, even with a constantly changing environment.

You might also like