Software Architect and System Design Quiz
I. System Requirements & architectural Drivers
I.I. System Design & Requirement Types
Question 1: We received the following requirement from the client:
We would like you to build a system that allows sharing of large files between users. After a user uploads a file, they will get a unique link that they can share with other users. Any user with that link can download the file. The link should become active no later than 1 second after the file is uploaded. Download speeds should be at least 50 Mbit/sec. You have to support at least PDF and JPG file formats, as well as the following web browsers: Google Chrome, Mozilla Firefox, and Microsoft Edge.
Which part is the functional requirement?
Question 2: We received the following requirement from the client:
We would like you to build a system that allows sharing of large files between users. After a user uploads a file, they will get a unique link that they can share with other users. Any user with that link can download the file. The link should become active no later than 1 second after the file is uploaded. Download speeds should be at least 50 Mbit/sec. You have to support at least PDF and JPG file formats, as well as the following web browsers: Google Chrome, Mozilla Firefox, and Microsoft Edge.
Which part is the non-functional / Quality Attributes requirement?
Question 3: We received the following requirement from the client:
We would like you to build a system that allows sharing of large files between users. After a user uploads a file, they will get a unique link that they can share with other users. Any user with that link can download the file. The link should become active no later than 1 second after the file is uploaded. Download speeds should be at least 50 Mbit/sec. You have to support at least PDF and JPG file formats, as well as the following web browsers: Google Chrome, Mozilla Firefox, and Microsoft Edge.
Which part is the System Constraints requirement?
Question 4:
Why is it so important to capture all the technical requirements for our system upfront before we start designing or implementing anything?
I.II. Feature Requirements - Gathering Process
Question 1:
We are tasked to design a Social Media System like Facebook. In this system, different users can post media (text, images, videos) on their wall. Their friends can like or respond to those posts, as they see them. The way we're going to monetize this platform is by allowing external advertisers to place ads which we will show on users' social media walls.
Following the three step process to gather all the functional requirements, who are the (external) actors in this system?
Question 2:
While designing an online store we created the following user flow using a sequence diagram:

What is the use-case that this user-flow represents?
I.III. Quality Attribute Requirement
Question 1:
We have the following requirement: When a user is performing a search on our system, we need to return as many results as fast as possible.
What is the correct statement about that requirement?
Question 2:
We have the following requirement: We want to offer unlimited raw, uncompressed video storage for a $1.99 annual subscription fee.
What is the correct statement about that requirement?
I.IV. System Constraints
Question 1:
While building our Multiplayer Online Game, we want to build our own proprietary game engine, to provide a better performance, optimized for our use case.
However, because of the strict deadline to release the game by the end of the year, we decided to go with an existing solution called Unreal Engine.
What type of constraint made us change our original decision to build a proprietary game engine?
Question 2:
While designing our multiplayer online game we decided to use Cassandra database for storing the information about our users.
However, we couldn't find any engineers in our team who know how to work with Cassandra.
We later found out that all the teams in our company are using MongoDB. So we decided to use MongoDB for storing the users' information instead.
What type of constraint made us choose MongoDB for our solution instead of Cassandra?
Question 3:
While designing a social media platform for sharing short videos with friends, we came up with the most optimal design and architecture.
However, before finalizing the design and starting the implementation we found out that COPPA (The Children's Online Privacy Protection Act), which is a law created to protect the privacy of children under 13, requires us to make significant changes to our design.
What type of constraint required us to make changes in our original architecture?
II. Most Important Quality Attributes
II.I. Performance
Question 1:
We measured that the response time of our system as a function of load ( measured in thousands of requests per second) and came up with the following graph:

What is the degradation point of our system?
Question 2:
We have the following response time distribution of 2 systems:
System 1:

System 2:

Which system has a shorter/better tail latency?
Question 3:
We are tasked to design a Video Transcoding and Compression as a Service System. Our system will receive raw video files from clients (video streaming companies), and our job is to transcode the raw file into different video file formats for different devices as well as compress those files.
What do you think is the most important performance metric for our system?
II.II. Scalability
Question 1:
We have the following graph that illustrates the amount of work two systems can perform as a function of their resources:

Which system is more scalable?
Question 2:
Currently we are running our systems as 2 instances on 2 separate computers
To allow our system to take more requests from users, we decided to deploy our 2 application instances on a new type of machines that run twice as fast and have 3 times more memory.
What type of scalability principle did we use?
Question 3:
Currently, our entire system runs as a single service.
The codebase of that service became very large and complex, so we decided to break it into 2 separate services that we deploy as 2 separate groups of application instances.
What scalability principle did we apply?
Question 4:
We are designing a Video on Demand system that is estimated to double the number of active users, using our system every 3 months.
What is the best scalability principle we should use, to make sure we keep up with the incoming traffic, and are able to provide all our users with good performance?
II.III. Availability
Question 1:
In the last month (30 days), we had 2 outages in our system.
The first outage lasted for 18 hours. The second outrage lasted for 6 hours.
What was our system's availability last month?
Question 2:
Our clients are asking us to design a system with "6 nines" of availability.
How much availability do we need to provide?
Question 3:
What is a potential risk of a prolonged outage of our mission critical system?
III. API Design
III.I. Introduction
Question 1:
Which one of those operations is NOT idempotent?
Question 2:
When an API is offering Pagination. What are the 2 pieces of information, the user of the API needs to provide to the server as part of the request?
Question 3:
What is the problem we may run into if we do not explicitly version our external API?
III.II. Rest API
Question 1:
We have the following resource in our online store:
/store/products/apparel/shirts/hoodie
What is the most correct statement?
Question 2:
Our company is currently offering a REST API to our users.
To reduce the overhead of authenticating a user against a database record, we are suggesting the following modification:
The user will be authenticated against the database only once, on the first request, and after that, the server in our system will cache the session information about the user in memory.
What is the most correct statement?
Question 3:
Which one of the following operations is NOT a standard REST API operation
IV. Building Blocks
Question 1: We are designing a highly scalable video-on-demand system where users can watch movies on their browsers.
To make sure that we can support traffic from millions of users all around the world, we deployed our services in 5 different data centers. In each data center, we run multiple instances of our frontend service.
What architectural building block should we use to make sure a user in India gets the home page with the catalog of all our movies from the nearest data center?
Question 2: We are designing a highly scalable video-on-demand system where users can watch movies on their browsers.
To make sure that we can support traffic from millions of users all around the world, we deployed our services in 5 different data centers. In each data center, we run multiple instances of our frontend service.
What architectural building block should we use to make sure that the traffic in each data center is evenly distributed among all our frontend service instances?
Question 3: At some point, we decided to also build a dedicated mobile app that talks to our video-on-demand system through a different API.
What architectural building block should we use to make sure we don't need to modify our internal services to support the new API?
Question 4: Once the user decides on which movie they want to watch, we want to make sure that they can watch the movie smoothly with the minimum amount of buffering time. Especially for 4k movies.
What architectural building block should we use to make it happen?
Question 5: When a user finishes watching the movie, we want to prompt them with a page that allows them to leave a review and rating for that movie.
What architectural building block should we use to make sure that we never lose any reviews, but at the same time, the user doesn't have to wait for the review to be persisted in a database?
V. Data Storage
V.I. ACID Transactions
Question 1:
Which principle of the ACID Transaction, guarantees that a record committed to the database as part of a successful transaction doesn't get lost?
Question 2:
Which principle of the ACID Transaction guarantees that two transactions that operate on the same data concurrently do not interfere with each other's results?
Question 3:
What SQL operation in a relational database allows us to analyze data from multiple tables?
V.II. Techniques to Improve Performance, Availability, Scalability
Question 1:
We are designing an Online Video Game System.
According to our estimation, we are going to collect and store about 10 TB of game-related user information per week.
What technique should we use to ensure we can keep up this incoming data rate into our system's storage?
Question 2:
What is the tradeoff made when deciding whether to add database indexing or not?
Question 3:
What type of technique improves the fault tolerance of our database and reduces the risk of data loss?
V.III. CAP Theorem
Question 1:
As part of our online bank system, we have a CP ( consistent and partition tolerant) distributed database that stores the account balance of all our clients.
To ensure we don't lose any data, we run 3 replicas of our database on different computers.
At a particular moment in time, our replicates contain the following information about a particular user:
-
Replica 1: Account Balance = $100
-
Replica 2: Account Balance = $100
-
Replica 3: Account Balance = $100
All of a sudden, we have a thunderstorm, and one of our network switches breaks down, so Replica 1 can no longer communicate with the rest of the replicas.
What happens if a particular service is trying to communicate with Replica 1 to get the current user's balance?
Question 2:
As part of our online bank system, we have an AP (available and partition tolerant) distributed database that stores the account balance of all our clients.
To ensure we don't lose any data, we run 3 replicas of our database on different computers.
At a particular moment in time, our replicas contain the following information about a particular user:
-
Replica 1: Account Balance = $100
-
Replica 2: Account Balance = $100
-
Replica 3: Account Balance = $100
All of a sudden, we have a thunderstorm, and one of our network switches breaks down, so Replica 1 can no longer communicate with the rest of the replicas. Replicas 2 and 3 can continue to communicate with each other. While the network switch is still broken, the user deposits another $50 dollars to their account, which goes through service A to Replica 2.
So the new picture of the replicas looks like this:
-
Replica 1: Account Balance = $100
-
Replica 2: Account Balance = $150
-
Replica 3: Account Balance = $150
What happens if service B is trying to communicate with our database to get the current user's balance?
Question 3:
Can we have an Available and Consistent distributed database running on 3 replicas while still guaranteeing partition tolerance?
VI. Software Architecture Patterns
VI.I. Multi-Tier Architecture
Question 1:
Which statement below is NOT a prerequisite for using the 3-tier architecture successfully?
Question 2:
What Architectural Building block should we use to scale the Presentation Tier?
Question 3:
We have the following Architecture diagram of an Online News Magazine:

What is the correct statement about this architecture diagram?
Question 4:
Why is the 3-Tier Architecture referred to as Monolithic Architecture?
VI.II. Microservices Architecture
Question 1:
Which feature of Microservices Architecture helps new developers become productive faster than in a Monolithic Architecture?
Question 2:
Due to the rise in popularity of Microservices Architecture, our organization decided to migrate its 3-Tier Web Application into Microservices as follows:
Before Migration:

After Migration:

However, after the migration, they did not see any improvement in development velocity.
In fact, development actually slowed down.
What do you think is the root cause for the adverse effect on organizational scalability after the migration?
Question 3:
You are a freelance Software Architect who helps companies with scalability in Microservices Architecture.
Recently, a company that offers premium, high volume Files Sharing services to businesses hired you to help them solve their problem after migration to Microservices.
This is the description of their problem:
"After the migration, it seems that every change that needs to be made in one microservice requires changes in other microservices...
Every operation requires data from multiple microservices, which makes the system very slow and complex
.. this is the opposite of what we expected after the migration from a Monolithic application.."
This is the Architecture diagram they shared with you:

What do you think is the cause of those problems, and what can they do to solve them?
Question 4:
What is the problem of sharing a database among multiple microservices in a Microservice Architecture?
VI.III. Event Driven Architecture
Question 1:
What is one of the purposes of the CQRS pattern in the Event-Driven Architecture?
Question 2:
Select the most correct statement that describes an event.
Question 3:
We have the following architecture diagram:

Definition: Service 1 depends on Service 2 if a change in the API of Service 2 requires changes in Service 1.
Which pairs of services have a direct dependency on one another?
Question 3:
In our online banking system, we store all the transactions that happen in the user's account as a log of events as following the Event Sourcing Pattern:

Our Fraud Detection Service detected that Event - 2 was fraudulent, and the owner of the account did not approve that transaction:

The Security specialist suggested removing that event from the log to correct the user's balance.