We use privacy-friendly product analytics (no session recording, PII masked) to improve OpenStem. Load analytics? Privacy Policy
Software: explore STEM content (page 11 of 25) · openstem
Explore STEM Content
Search the community's STEM library — free to study, yours to make your own.
Software
Programming, algorithms and systems on openstem — flashcards, notes, quizzes, sketches and flowcharts shared by the community. Study free, or clone anything into your library.
Where the Accessible Name Comes From An interactive element's 'accessible name' — what a screen reader actually reads aloud — is computed by checking several sources in a strict priority order, stopping at the first match. An element marked
Software
Software · L2 · HTML & CSS: Computing an Element's Accessible Name
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.
The Build-to-Release Chain GCP separates CI/CD into focused services: Cloud Build compiles and tests, Artifact Registry stores the resulting images/packages, and Cloud Deploy manages progressive rollout to your runtime of choice. What Happe
What is the Singleton pattern and what is its main drawback?1 / 10
Ensures a class has only one instance with a global access point. Useful for shared resources (config, logging) but is often an anti-pattern: it introduces global state, hides dependencies, and makes unit testing harder (hard to mock/reset).
What Is a Pattern? A pattern is something that repeats in the same way. You can find patterns everywhere! Computers use patterns too. When a program does the same thing over and over, it follows a pattern. Spotting patterns helps you solve
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.
Can a computer think for itself without any instructions?
AYes, computers are very smart on their ownBNo, computers only do what people tell themCOnly if they are switched onDOnly if they are connected to the internet
What is the fundamental trade-off between symmetric and asymmetric encryption?1 / 9
Symmetric ciphers (AES) are orders of magnitude faster and use one shared key, but distributing that key securely is hard. Asymmetric ciphers (RSA, ECC) solve key distribution with public/private key pairs but are far more computationally expensive. Real protocols (TLS) use asymmetric crypto only to exchange a symmetric session key, then switch to symmetric encryption for bulk data — a hybrid scheme.
Why Simple Code Breaks Under Concurrency Code like `counter++` looks like one step but is really read, add one, write — three separate steps. If two threads interleave those steps, one thread's update can silently vanish. This is the root c
Software
Software · L1 · Concurrency: Protecting Shared State
JavaScript execution in Node is single-threaded (one event loop), but I/O is handled asynchronously by libuv's thread pool and the OS. CPU-bound work blocks the loop; offload it to Worker Threads or child processes.
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.
What is the difference between a process and a thread?1 / 9
A process is an independent program with its own memory space, file handles, and resources. Threads within a process share the same memory and resources but have their own stack, registers, and program counter. Processes are isolated; threads are lightweight peers within a process.
Cache Strategies at a Glance Every caching strategy is really a decision about when the cache and the database are allowed to disagree, and for how long. Which Strategy Fits? The deciding factors are usually how tolerant the application is
Software
Software · L2 · System Design: Choosing a Cache Strategy
What are xmin and xmax on a PostgreSQL heap tuple?1 / 10
Every heap row has system columns: `xmin` is the transaction ID that inserted it; `xmax` is the XID that deleted/updated it (0 = still live). MVCC uses these to determine which rows are visible to a snapshot.
What runs in Next.js middleware, and why does its placement matter?1 / 10
Middleware executes before the matched route resolves, on every request that passes its `matcher`, letting you rewrite, redirect, or set headers/cookies (e.g. auth gating, locale routing). Because it runs on the critical path for matched requests, the work must be cheap — heavy logic or per-request data fetches there add latency to everything behind it.
Why Formal Semantics? A programming language's syntax says what programs look like; its semantics says what they mean — precisely and unambiguously enough to prove theorems about programs (does this optimisation preserve behaviour? does thi
TCP is connection-oriented and reliable — ordered, error-checked, retransmitted (web, email, file transfer). UDP is connectionless and unreliable but fast and low-overhead — no ordering or delivery guarantees (video streaming, gaming, DNS).