OS

OpenStem

@openstem · Joined Jul 2026
7420 public items8 groups
Content7420Groups8
Flashcards9 cards
When should you use threading vs multiprocessing vs asyncio in Python?1 / 9
Threading: I/O-bound concurrent tasks (GIL released on I/O). Multiprocessing: CPU-bound tasks (each process has its own GIL and memory). asyncio: high-concurrency I/O with a single thread via cooperative coroutines — best for network servers handling thousands of connections.
Software

Concurrency

@openstem
Concurrency
Flashcards9 cards
What is a metaclass in Python and what is it used for?1 / 9
A metaclass is a class whose instances are classes. `type` is the default metaclass. Custom metaclasses (by subclassing `type`) can intercept class creation to auto-register subclasses, validate class structure, or add methods automatically. Define with `class Meta(type): ...` and use `class MyClass(metaclass=Meta)`.
Software

Advanced Python

@openstem
Advanced Python
Flashcards10 cards
What is the React Fiber architecture?1 / 10
Fiber is React's internal reconciler (introduced in React 16). Each React element is a fiber node — a unit of work with priority, parent/sibling/child links. Fibers allow work to be paused, resumed, or aborted, enabling concurrent rendering.
Software

Concurrent React & Internals

@openstem
Concurrent React & Internals
Flashcards10 cards
What is the compound component pattern?1 / 10
Multiple components share implicit state via Context rather than explicit prop drilling. E.g. `<Select>` + `<Select.Option>` communicate via a shared context, giving consumers a composable API without complex prop hierarchies.
Software

Patterns & Architecture

@openstem
Patterns & Architecture
Flashcards9 cards
What is a Union-Find (Disjoint Set Union) data structure and what is its amortized complexity?1 / 9
Union-Find tracks disjoint sets. `find(x)` returns the root of x's set; `union(x, y)` merges sets. With path compression + union by rank, both ops are amortized O(α(n)) — inverse Ackermann, practically O(1).
Software

Advanced Structures

@openstem
Advanced Structures
Flashcards9 cards
What is the greedy algorithm paradigm and when does it guarantee optimality?1 / 9
Greedy makes the locally optimal choice at each step hoping it leads to a global optimum. Guaranteed optimal when a greedy-choice property holds (provable by exchange argument) and optimal substructure exists. Examples: activity selection, Huffman coding, Kruskal's MST.
Software

Algorithm Design & Analysis

@openstem
Algorithm Design & Analysis
Flashcards10 cards
What problem does the Raft consensus algorithm solve?1 / 10
Raft achieves consensus in a distributed cluster — agreement on a replicated log even when some nodes crash or are slow. It elects a leader via randomized election timeouts, and the leader serializes all writes, replicating to a majority quorum before committing.
Software

Distributed Systems Deep Dive

@openstem
Distributed Systems Deep Dive
Flashcards10 cards
How do you approach a back-of-envelope capacity estimation?1 / 10
Estimate: DAU × actions per user = requests/day → requests/second (÷86400). Estimate storage: requests × payload size. Estimate bandwidth: RPS × payload. Benchmark memory, CPU, and network against known reference points (1 Gbps NIC, 100MB/s disk, 1M ops/s Redis). Simplify with round numbers.
Software

System Design Practice

@openstem
System Design Practice
Flashcards10 cards
What is the difference between a logical plan and a physical plan?1 / 10
A logical plan is an algebraic, set-based description of WHAT to compute — joins, filters, projections, and aggregations as relational operators, independent of implementation. The physical plan is the optimizer's chosen execution strategy: it binds each logical operator to a concrete algorithm (e.g. a join becomes a hash join, a scan becomes an index scan) and fixes join order, ordering it by estimated cost. EXPLAIN shows the physical plan.
Software

Query Optimization & Execution Plans

@openstem
Query Optimization & Execution Plans
Flashcards10 cards
State each ACID property precisely, distinguishing Consistency from Isolation.1 / 10
Atomicity: a transaction's effects are all-or-nothing; a partial failure rolls everything back. Consistency: each committed transaction moves the database from one state satisfying all declared constraints (keys, checks, triggers) to another — it is a property the application+constraints uphold, not the engine alone. Isolation: concurrent transactions produce a result equivalent to some serial schedule (to the degree the chosen level guarantees). Durability: once commit returns, the changes survive a crash, usually via a write-ahead log (WAL) flushed/fsynced before acknowledgment.
Software

Transactions, Isolation & Concurrency

@openstem
Transactions, Isolation & Concurrency
Flashcards10 cards
How is an object's SHA computed, and what is the loose-object on-disk format?1 / 10
The hash is taken over the header `<type> <size>\0` concatenated with the raw content — not over the compressed bytes. On disk a loose object is that same header+content zlib-deflated, stored at `.git/objects/ab/cdef…` (first two hex chars name the directory).
Software

Git Internals: Objects, Refs & Plumbing

@openstem
Git Internals: Objects, Refs & Plumbing
Flashcards10 cards
Mechanically, how does interactive rebase apply the todo list you edit?1 / 10
Git writes the todo to `.git/rebase-merge/` and processes one line at a time, cherry-picking each `pick`/`edit`/`squash`/`fixup`/`reword`. On `edit` or a conflict it stops with HEAD detached at that point; `--continue` resumes from the saved state. The original branch tip is preserved as `ORIG_HEAD` and in the reflog.
Software

History Rewriting, Recovery & Advanced Workflows

@openstem
History Rewriting, Recovery & Advanced Workflows
Flashcards9 cards
What are G, M, and P in the Go scheduler?1 / 9
G is a goroutine, M is an OS thread (machine), and P is a logical processor holding a run queue and the resources needed to execute Go code. A G runs on an M only while that M holds a P.
Software

Runtime & Scheduler

@openstem
Runtime & Scheduler
Flashcards9 cards
What kind of garbage collector does Go use?1 / 9
A concurrent, tri-color mark-and-sweep collector with a write barrier. It runs mostly concurrently with the program to keep stop-the-world pauses very short (sub-millisecond), trading some throughput for low latency.
Software

GC, Memory & Performance

@openstem
GC, Memory & Performance
Flashcards10 cards
What five 'superpowers' does an `unsafe` block enable?1 / 10
Dereferencing raw pointers, calling unsafe functions/FFI, accessing/modifying mutable statics, implementing unsafe traits, and accessing union fields. `unsafe` does NOT turn off the borrow checker; it only permits these specific operations.
Software

Unsafe, FFI & Raw Pointers

@openstem
Unsafe, FFI & Raw Pointers
Flashcards10 cards
What method is at the core of the `Future` trait?1 / 10
`poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output>`. The executor repeatedly calls `poll`; it returns `Poll::Pending` (registering a waker) or `Poll::Ready(output)` when complete.
Software

Async Internals, Pin & Variance

@openstem
Async Internals, Pin & Variance
Flashcards10 cards
What are HotSpot's C1 and C2 compilers in tiered compilation?1 / 10
C1 (client) compiles quickly with light optimization for fast warm-up; C2 (server) applies aggressive, profile-guided optimizations for peak throughput on hot methods. Tiered compilation starts interpreted, moves to C1, then promotes the hottest code to C2.
Software

JVM Internals & Performance

@openstem
JVM Internals & Performance
Flashcards10 cards
What does a `record` declaration give you?1 / 10
A record is a transparent, immutable data carrier: the compiler generates a canonical constructor, private final fields, accessors, and value-based equals/hashCode/toString from the component list. It is ideal for DTOs and value objects.
Software

Modern Java & Memory Model

@openstem
Modern Java & Memory Model
Flashcards10 cards
Walk the critical rendering path from bytes to pixels.1 / 10
Parse HTML into the DOM and CSS into the CSSOM; combine them into the render tree (only visible nodes, with computed styles); run layout to assign each box a geometry; paint draw-order display lists into layers; then composite those layers (often on the GPU) into the final frame. DOM and CSSOM build in parallel, but the render tree needs both.
Software

Browser Rendering & Performance

@openstem
Browser Rendering & Performance
Flashcards10 cards
State the full cascade ordering the browser uses to pick a value.1 / 10
In decreasing priority: (1) origin + importance — normal user-agent, normal user, normal author, then animations, then author `!important`, user `!important`, UA `!important` (importance reverses the origin order); (2) cascade layers, where later `@layer` wins, and unlayered author styles beat layered ones; (3) specificity; (4) source order. Each tier is a tiebreaker only when the prior tiers are equal.
Software

CSS Cascade, Layout Internals & Architecture

@openstem
CSS Cascade, Layout Internals & Architecture
Flashcards10 cards
How do V8 and libuv divide responsibilities in Node.js?1 / 10
V8 compiles and executes JavaScript (heap, GC, JIT). libuv provides the event loop, async I/O, the thread pool, timers, and OS abstraction for network/file ops. Node's bindings glue the two together.
Software

Internals & Architecture

@openstem
Internals & Architecture
Flashcards10 cards
What is a graceful shutdown and how do you implement it in Node?1 / 10
Graceful shutdown stops accepting new connections, waits for in-flight requests to complete, and then exits cleanly. Implement by listening for SIGTERM/SIGINT, calling `server.close()` to stop accepting connections, and waiting for the close callback before calling `process.exit(0)`.
Software

Production Node

@openstem
Production Node
Flashcards10 cards
What transport-layer problem does HTTP/3 solve that HTTP/2 still has?1 / 10
HTTP/2 multiplexes streams over one TCP connection, so a single lost packet stalls ALL streams (TCP head-of-line blocking). HTTP/3 runs over QUIC (on UDP), where streams are independent, so loss on one stream doesn't block the others.
Software

HTTP/2, HTTP/3 & QUIC

@openstem
HTTP/2, HTTP/3 & QUIC
Flashcards10 cards
How does Anycast route a client to the nearest CDN edge?1 / 10
Anycast advertises the same IP prefix via BGP from many locations. The internet's routing fabric naturally delivers each client's packets to the topologically nearest advertising node, providing built-in proximity routing and DDoS dispersion.
Software

CDNs, Anycast & BGP

@openstem
CDNs, Anycast & BGP
Flashcards8 cards
What happens inside the kernel during a context switch between two threads?1 / 8
The scheduler saves the outgoing thread's registers (including SP and PC) into its kernel thread struct (task_struct on Linux), selects the next thread, restores its register file, switches the memory context (CR3 on x86, TLB flush if different process), then returns to the new thread's execution point.
Software

Kernel Internals

@openstem
Kernel Internals
Flashcards8 cards
What is the difference between select/poll and epoll, and why does it matter at scale?1 / 8
select() and poll() require the kernel to scan the entire set of file descriptors on each call — O(n) per wakeup. epoll uses an event-driven model: the kernel only delivers events for ready FDs, so the application scales to hundreds of thousands of connections with O(1) per event.
Software

Advanced OS Concepts

@openstem
Advanced OS Concepts
Flashcards10 cards
What is a lock-free data structure?1 / 10
A data structure where at least one thread is guaranteed to make progress in a finite number of steps, even if other threads are suspended. Uses CAS loops rather than locks — no thread can be deadlocked. Wait-free is stronger: every thread completes in a bounded number of steps.
Software

Lock-Free & Memory Models

@openstem
Lock-Free & Memory Models
Flashcards10 cards
Describe the producer-consumer pattern and its synchronization requirements.1 / 10
Producers add items to a shared buffer; consumers remove and process them. Synchronization needed: (1) mutual exclusion on the buffer, (2) consumers wait when empty, (3) producers wait when full. Typically implemented with a bounded queue + condition variables or a channel.
Software

Concurrency Patterns

@openstem
Concurrency Patterns
Flashcards10 cards
What do the letters in the STRIDE threat model stand for?1 / 10
Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, and Elevation of privilege — a taxonomy for enumerating threats against each component and data flow.
Software

Threat Modeling & Zero Trust

@openstem
Threat Modeling & Zero Trust
Flashcards10 cards
What is a software supply-chain attack?1 / 10
Compromising software via its dependencies, build pipeline, or distribution rather than the target's own code — e.g. a poisoned npm package or a tampered build server — so the malicious code reaches users through trusted channels.
Software

Secure SDLC & Supply-Chain Security

@openstem
Secure SDLC & Supply-Chain Security

We use privacy-friendly product analytics (no session recording, PII masked) to improve OpenStem. Load analytics? Privacy Policy