Interview Review: Core Concepts of MySQL, OS, Networking, Redis, and Distributed Systems
This article compiles a technical interview recap covering MySQL MVCC, atomicity and persistence mechanisms, operating‑system page cache and deadlock concepts, TCP reliability and flow‑control, Redis persistence and clustering, as well as distributed transaction and consensus fundamentals.
Problem Records
MySQL - MVCC
InnoDB implements repeatable‑read isolation via MVCC, recording multiple versions of rows; transaction IDs, undo logs and versioning allow reading consistent snapshots.
MySQL - Atomicity
Atomicity is guaranteed by the undo log: before a row is modified, its original state is stored, enabling rollback of uncommitted transactions.
MySQL - Persistence
Persistence relies on the redo log and doublewrite buffer (WAL). Changes are first written to the redo log, then flushed to disk; the doublewrite buffer copies dirty pages before the final fsync.
Operating System - Deadlock
Deadlock occurs when two or more threads hold resources the other needs, forming a circular wait; it requires the four conditions of mutual exclusion, hold‑and‑wait, no preemption, and circular wait. Breaking any condition (e.g., ordered resource allocation) prevents deadlock.
Operating System - Page Cache
The page cache stores frequently accessed file blocks in memory, reducing kernel‑space copies. Reads and writes operate on the cached pages; modified pages are later flushed back to the file.
Computer Network - TCP Reliability and Ordering
TCP ensures reliable, ordered delivery using sequence numbers, ACKs, fast retransmit, and cumulative acknowledgments to detect and recover lost packets.
Computer Network - Flow Control
Flow control uses a sliding window. The receiver advertises its available buffer size; the sender limits transmission accordingly. The example shows a window of 200 bytes and how it shrinks and expands as data is sent and ACKed.
Redis - Persistence
Redis offers two persistence methods: AOF (append‑only file) records every write operation for exact reconstruction, while RDB creates point‑in‑time snapshots. AOF has lower runtime overhead but slower restarts; RDB restarts quickly but may lose recent data.
Redis - Clustering
Redis uses a master‑slave replication model for high availability and a hash‑slot sharding scheme for horizontal scaling; each key’s hash determines its slot and the node that stores it.
Distributed - Transactions
Distributed transactions are typically handled with two‑phase commit (prepare → commit) or three‑phase commit (CanCommit → PreCommit → Commit) to improve fault tolerance.
Distributed - Paxos vs Raft
Paxos allows followers to reject a leader’s proposal, requiring three phases; Raft simplifies consensus by electing a stable leader that all followers follow.
Distributed - Majority Consensus
Requiring a majority of nodes to agree prevents Byzantine failures and ensures that a single faulty node cannot compromise consistency.
Scenario Questions
Design a thread pool
Design an LRU cache
Interview Summary
The interviewer emphasized breadth over depth, covering many fundamentals without deep probing; the candidate noted the need to strengthen basic knowledge and make scenario questions more practical.
IT Services Circle
Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.