Systems
Systems
Real software does not run as one program on one machine. It runs across processes, machines, data centers, and continents; it stores state that must survive restarts and concurrent access; it communicates through networks that can delay, reorder, or lose messages. Systems is the study of the concepts every software engineer needs to reason about programs in this larger setting — not to become a distributed-systems researcher, but to make sound choices about the parts of the stack that sit below your application.
This section covers three foundational topics:
Practice Across Systems
Use the master deck when you want a mixed review of networking, data management, and security vocabulary. Use the master quiz to practice choosing systems mechanisms under realistic trade-offs.
Systems Master Flashcards
A comprehensive mix of the systems flashcards: networking, data management, and security.
What are the two roles in a client-server architecture, and who initiates contact in the basic request-response model?
How does a peer-to-peer (P2P) architecture differ from client-server?
What is a hybrid architecture? Give a real-world example.
Explain the difference between throughput and latency.
You type a URL into your browser and press Enter. Trace the journey of that HTTP request down the four layers of the TCP/IP stack — name each layer and describe what it contributes.
What is encapsulation (package wrapping) in the TCP/IP stack?
What is the TCP three-way handshake and why is it needed?
How does TCP guarantee reliable delivery during data transfer?
What does it mean that HTTP is stateless?
Name at least three main HTTP verbs and what each does.
What is 127.0.0.1 and what is it commonly called?
What is a URL and what are its components?
What does HTTPS add on top of HTTP, and why is it important?
What four problems does a DBMS solve that an application manipulating its own files does not solve by itself?
What does it mean to say SQL is declarative? Why does it matter?
What does an ER diagram depict, and what are its three main notational elements?
What does the multiplicity N to M mean on an ER relationship, and what does it force you to add to your schema?
Define primary key and foreign key in one sentence each. What is the critical difference?
When would you use a composite primary key, and give one realistic example.
Name the four core relational-algebra operations and one-line intuition for each.
How do the four relational-algebra operations map to SQL clauses?
What is a transaction?
What do COMMIT and ROLLBACK do?
State the four ACID properties and a one-sentence intuition for each.
For each ACID letter, what class of failure does it protect against?
State the three properties named by the CAP theorem.
State the CAP theorem precisely (not the ‘pick 2 out of 3’ slogan).
What is the difference between a CP and an AP system? Give a canonical example of each.
What is eventual consistency, and with which CAP choice is it typically paired?
Why is ACID-Consistency ≠ CAP-Consistency one of the most important distinctions in data management?
What is wrong with the claim that ATMs ‘have all three’ of CAP? What do ATMs actually demonstrate?
List the four NoSQL families with one representative system and one typical fit each.
What was ‘NoSQL’ originally reacting against, and what was it later redefined to mean?
Sweet spot of RDBMS vs. sweet spot of NoSQL — state each in one sentence.
Why is ‘we use SQL so we can swap databases at any time’ an oversimplification?
Give the scenario-to-property mapping for CAP choices: for each application below, which property is primary?
What are the three security attributes named by the CIA triad, and what does each one mean in one sentence?
A laptop containing unencrypted patient health records is stolen. Which CIA property is violated?
A ransomware attack encrypts the only copy of a database. Which CIA properties are violated?
What is SQL injection in one sentence, and what is its underlying cause?
What is the standard fix for SQL injection, and why does it work?
Which CIA properties can a successful SQL injection attack violate?
What is cross-site scripting (XSS), and what is the underlying cause?
What are the main defenses against XSS?
Which CIA properties does a successful XSS attack typically violate?
Define symmetric encryption, name a common algorithm, and state its main weakness.
Define public-key (asymmetric) cryptography, and explain how it solves the key-distribution problem.
Alice wants to send Bob a private message using public-key cryptography. Which key does she use to encrypt?
What is a digital signature, and how does it work?
Why do digital signature schemes hash the document first, instead of encrypting the whole document with the private key?
Why is sending the username and password on every request a bad authentication design?
How does session-based authentication (with a session cookie) work, and what are the three cookie flags that harden it?
What is a JSON Web Token (JWT), and how does it differ from a session cookie?
What are the trade-offs between session cookies and JWTs?
Does the HttpOnly cookie flag fully protect a session against XSS? Explain.
State the Zero Trust security principle in one sentence and give one operational consequence.
What is security through obscurity, and why is it a bad foundation?
When should you apply public scrutiny vs. complementary obscurity?
State the Principle of Least Privilege and give one concrete application.
What four questions does a security plan answer?
What four dimensions does a useful threat model describe?
What is the attack surface of a system, and why does shrinking it matter?
Why are session cookies still vulnerable to XSS even when HttpOnly is set?
Distinguish authenticity from the three CIA properties. Why isn’t it part of the triad?
Systems Master Quiz
A comprehensive mix of the systems quizzes: networking fundamentals and decisions, data management, and security.
In a client-server architecture, which statement is TRUE?
What is the key advantage of peer-to-peer (P2P) architecture over client-server?
What is the difference between throughput and latency?
In the TCP/IP stack, what is the purpose of the Transport Layer?
When data travels down through the TCP/IP stack before being sent, what happens at each layer?
A student runs node server.js and their terminal shows: Server listening on http://localhost:5000. They open a browser on the same machine. Which URL should they visit?
HTTP is described as a ‘stateless’ protocol. What does this mean?
Your Express route handler queries the database for a course by ID, but no matching course exists. Which HTTP status code should the handler return?
Why was HTTPS created, and what does it add on top of HTTP?
Arrange the TCP/IP layers in order from bottom (closest to hardware) to top (closest to the application).
Link LayerInternet LayerTransport LayerApplication Layer
Which of the following are guarantees provided by TCP but NOT by UDP by itself? (Select all that apply)
You are building a collaborative coding interview platform where the candidate and the interviewer edit the same file at the same time, character by character. The candidate types def foo():, then immediately replaces it with def bar():. If those two edits arrive at the interviewer in the wrong order, the interviewer’s screen ends up showing def foo(): even though the candidate’s screen shows def bar():. Which transport protocol should the editing channel use?
You’re building a smart doorbell with a live camera feed. When a visitor presses the button, the homeowner’s phone displays the camera in real time so the homeowner can see who’s there before deciding to answer. Which transport protocol should carry the camera video stream?
An indie team is building an online multiplayer racing game. Each player’s car position and speed update 60 times per second so all players see each other accurately on the track. The game also records lap completion events, awards podium finishes, and lets players spend earned currency on car cosmetic upgrades that persist between matches. What transport-protocol strategy fits best?
You are building a cloud file storage service similar to Dropbox or Google Drive. A user clicks ‘Upload’ on a 200 MB folder of design files. The folder must arrive at the server bit-for-bit identical so that other devices syncing the same folder see the exact same files. Which transport protocol should carry the upload?
A startup is launching an online concert ticketing platform. Fans browse upcoming shows, pay with a credit card, and receive a unique QR-code ticket. The platform must prevent two fans buying the same seat, and it must keep an immutable record of every sale for tax and refunds. Should the backend be client-server or peer-to-peer?
A research consortium is designing a distributed scientific data archive: each participating university hosts a copy of selected genome datasets and serves them directly to other universities that request a copy. There must be no single institution that controls or can take down the archive, and the system should keep functioning even if several universities go offline at once. Which architecture fits these requirements best?
You are building a walkie-talkie style voice app for outdoor crews — a hiker holds the talk button, speaks for a few seconds, and any teammate within range hears the audio in real time. The audio must feel immediate, and a brief audio gap is far less disruptive than a hesitation in the middle of a sentence. Which transport protocol should carry the voice audio?
A smart-home product ships a phone app that refreshes every 5 seconds to show the current state of the user’s connected devices — lights on/off, thermostat temperature, door-lock status. The phone app sends a request to the company’s central hub server, which responds with the latest readings collected from devices in the home. Which architecture pattern is this?
For which of the following would TCP be the better choice over UDP? (Select all that apply)
A flight-booking service executes a transaction that (1) debits a passenger’s credit card and (2) writes a “seat reserved” row. The server crashes between the two steps. On restart, the card shows a charge but no seat is reserved. Which ACID property did the system fail to provide?
Two customer-service agents click “apply \$50 refund” on the same account at the same instant. Each reads the balance \$100, subtracts 50, and writes back \$50 — so one refund silently disappears. Which ACID property would have prevented this lost update?
A banking DBMS has the schema-level constraint CHECK (balance >= 0). A transfer transaction tries to commit a state in which an account’s balance would be \$-200. The DBMS rolls it back. Which ACID property is the DBMS enforcing?
A teammate says: “Our database is strongly consistent because we use SQL and SQL is ACID.” In the context of a distributed, multi-replica deployment, what is wrong with this claim?
A DBMS acknowledges COMMIT to your application; half a second later the server loses power. On reboot, the change is gone. Which ACID property did the system fail to provide?
You are designing the database for a payment system that processes credit-card transactions. The requirement is: we must never double-charge a customer, even if that means refusing to serve requests during a network partition. In CAP terms, you are choosing:
You run the product catalog for a large retailer. A stale read of the catalog by a few seconds is fine; a 500 error costs you a sale. A network link between two data centers flaps for ten seconds. You would rather the system be:
ATMs are sometimes presented as an example of “having all three of C, A, and P.” What is the more accurate characterization of how ATMs actually behave?
The popular phrasing of CAP — “pick two out of three” — is memorable but imprecise. Which statement better captures what the theorem actually says?
You are building a social-media-style news feed: billions of posts, heavy write volume, lots of horizontal scaling, and a few seconds of staleness in someone’s feed is acceptable. Which data-store family is typically the best fit, and why?
You are building the ledger for a new stock brokerage: every trade must be recorded atomically, there are complex relationships between accounts, trades, and positions, and regulators will audit your transactional guarantees. Which data-store family is the natural fit?
A code-review web app handles pull-request approvals. When a reviewer clicks “Approve PR”, the system does two things:
- Inserts a row into the
Reviewstable marking the PR as approved. - Posts a message to the team’s Slack channel announcing the approval.
The database insert succeeds and is committed. Immediately afterward, the call to the Slack API times out — so the PR is recorded as approved but no Slack message is posted.
Which ACID property is violated?
Consider the query “For each course, list the course ID and the number of students enrolled.” Which sequence of relational-algebra operations implements it?
You are designing an Enrollment(student_id, course_id, quarter) table. A student can only be enrolled once in a given course in a given quarter. Which of the following is the most natural primary-key design?
A foreign key Enrollment.course_id points at Course.course_id. The DBMS rejects an INSERT into Enrollment where course_id = "CS999" because no such course exists. What property is being enforced, and which ACID letter does this fall under?
Which of the following is not one of the three security attributes in the CIA triad?
A ransomware attack encrypts the only copy of a hospital’s patient records. Doctors cannot read them, and the on-disk bytes have been replaced with attacker-controlled ciphertext. Which CIA properties has the attack violated? (Select all that apply.)
Attackers exploit an unpatched server vulnerability and download the personal records of 147 million users — names, dates of birth, Social Security numbers. None of the data on the company’s servers is altered or deleted. Which CIA property is primarily violated?
A login handler runs the following query:
SELECT * FROM Users WHERE Name = "<typed username>" AND Pass = "<typed password>"
where <typed username> and <typed password> are concatenated into the SQL string. What is the most direct vulnerability in this code?
A developer fixes the SQL injection bug from the previous question by switching to a parameterized query:
SELECT * FROM Users WHERE Name = @0 AND Pass = @1
with name and pass passed as separate arguments to the database driver. What is the primary reason this prevents SQL injection?
A social-media site lets users post comments and renders each comment by interpolating the comment text directly into the HTML page. Another user later views the post in their browser. Which CIA properties can a successful XSS payload violate in this scenario? (Select all that apply.)
Your team is shipping a comments feature on a blog. Which defense most directly prevents XSS attacks via the comment field?
A startup announces a new “proprietary, never-before-published” encryption algorithm that they claim is unbreakable because “nobody knows how it works”. What is the most fundamental problem with this approach to security?
Two scenarios. (1) A research team has just designed a new public-key signature scheme and wants to know whether it is secure. (2) A company is about to deploy a production system using a well-studied existing TLS library. Which is the right disclosure stance for each?
Alice wants to send a private message to Bob that only Bob can read, using public-key cryptography. Whose key, and which one, should Alice use to encrypt the message?
In practice, a digital signature scheme hashes the document first and then encrypts the hash with the signer’s private key — rather than encrypting the entire document. Why?
A junior engineer proposes that the client send the username and password on every request, and the server verifies them every time. Which problems does this design have? (Select all that apply.)
A web app stores its session tokens in HttpOnly cookies and reads them only on the server. A teammate concludes: “That makes the app immune to XSS — the script can’t read the cookie, so we’re safe.” What is wrong with this conclusion?
Which of the following are accurate trade-offs of using a JSON Web Token (JWT) instead of a server-managed session cookie? (Select all that apply.)
You are designing a small e-commerce backend with four components: a Product Display service, an Email Notification service, an Image Upload service, and a System Backup service. Following the Principle of Least Privilege, which permission set is most appropriate for the Email Notification service?
An emergency telephone in a hospital lobby is meant to dial only 9-1-1. To enforce this, the buttons are covered with an aluminum foil shield with cutouts for the digits “9” and “1”. Which security plan element is most clearly broken in this design?
Networking
How computers communicate across networks: the layered model (application / transport / network / link), TCP vs. UDP, DNS, HTTP, TLS, and the operational decisions that follow from each. When to pick which protocol, what each layer does (and does not) guarantee, and how those guarantees shape the applications built on top.
Data Management
How software stores data reliably: why we use a DBMS at all, the relational model (tables, primary keys, foreign keys), SQL as a declarative query language, the four core relational-algebra operations (Join, Selection, Projection, Group-By), transactions and the ACID guarantees (Atomicity, Consistency, Isolation, Durability), and the CAP theorem that governs trade-offs in distributed databases. Also covers the NoSQL family of non-relational systems and when to pick one over an RDBMS.
Security and Authentication
How to reason about whether a system is secure and what kind of failure it is when it isn’t: the CIA triad (Confidentiality, Integrity, Availability), the two most common web vulnerabilities (SQL injection and cross-site scripting), the cryptographic primitives every web app eventually leans on (symmetric and public-key encryption, digital signatures), authentication mechanisms (session cookies, JSON Web Tokens), and the design principles — Zero Trust, Open Design, Principle of Least Privilege — that shape secure systems. Closes with a four-question template for building a security plan.