We use privacy-friendly product analytics (no session recording, PII masked) to improve OpenStem. Load analytics? Privacy Policy
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.
It begins as an HTTP request with an Upgrade: websocket header; if the server accepts (101 Switching Protocols), the connection switches to a persistent full-duplex WebSocket.
It rebuilds its widget subtree based on the latest snapshot of a Future, exposing connection state, data, and error so you can render loading, success, and failure UIs.
How does a `for` loop differ in Go from C-style languages?1 / 10
Go has a single `for` keyword that serves as for, while, and infinite loops. `for {}` is infinite, `for cond {}` is a while loop, and `for i := 0; i < n; i++ {}` is the classic three-clause form.
Define a dataflow analysis in terms of transfer functions and a lattice.1 / 7
A dataflow analysis assigns each program point a value from a lattice (L, ⊑) representing an abstract fact (e.g. the set of live variables). Each CFG edge/statement has a transfer function f: L → L propagating facts across it; the analysis computes, for every point, the least fixpoint of these equations subject to a meet (∩) or join (∪) at control-flow merge points, depending on whether the analysis is 'must' or 'may'.
Software
Software · L5 · Program Analysis & Abstract Interpretation
Streaming Replication Every write to a Postgres primary is first recorded in the Write-Ahead Log (WAL). Streaming replication ships that WAL to one or more standby servers, which replay it to reconstruct an up-to-date copy of the data — wit
Software
Software · L2 · PostgreSQL: Replication & High Availability
Applied Cryptography for Engineers Most engineers never implement a cipher, but every engineer builds systems that depend on cryptographic primitives being composed correctly. The failures that matter in practice are almost never 'AES was b
Software
Software · L4 · Applied Cryptography for Engineers
Match the Data Shape to the Database There is no single 'best' database — each type trades away something (joins, flexibility, raw speed) to excel at a particular access pattern. Picking well starts with describing the shape of the data and
Software
Software · L1 · System Design: Choosing a Database Type
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)`.
Four Ways to Satisfy a Token A provider isn't always 'a class Nest instantiates for you' — the `providers` array can register several different shapes, each resolved differently when a token is requested. Whichever shape produces the instan
What is the main trade-off introduced by applying many design patterns?1 / 10
Patterns add indirection and abstraction. Used well they decouple and clarify; used excessively they obscure control flow and raise cognitive load. The trade-off is flexibility vs simplicity.
Which statement correctly distinguishes data parallelism from model parallelism?
AData parallelism partitions the model across devices; model parallelism replicates itBData parallelism replicates the full model and shards the data across workers; model parallelism partitions the model itself because it does not fit on one deviceCThe two terms are synonyms for the same techniqueDData parallelism requires a parameter server; model parallelism never does
Software
Software · L5 · Distributed Machine Learning Systems
Compose defines and runs multi-container applications from a single YAML file. Instead of many `docker run` commands, you declare services, networks, and volumes once and start them all with `docker compose up`.
Match the Failure Mode to the Type Rust gives you three distinct ways to represent something not going as planned, and each one tells the caller a different story about how serious the situation is. Working Through It Library code in partic
What lives on the heap versus the stack in the JVM?1 / 10
Objects and their instance fields live on the shared heap (garbage-collected), while each thread's stack holds frames with local variables and references to heap objects.
What does calling `setState` do in a StatefulWidget?1 / 10
It notifies the framework that internal state has changed, scheduling a rebuild of the widget's `build` method. Mutations should happen inside the setState callback.
`go vet` is a static analysis tool that reports suspicious constructs the compiler accepts but are likely bugs, such as mismatched Printf format verbs or unreachable code.
What does the `await` keyword do inside an `async` function?1 / 10
It suspends the function until the awaited Future completes, then resumes with its result. The surrounding function returns a Future immediately to its caller.