We use privacy-friendly product analytics (no session recording, PII masked) to improve OpenStem. Load analytics? Privacy Policy
Software: explore STEM content (page 10 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.
Mount, Update, and Unmount An effect always runs after the browser paints, never blocking the render. Its cleanup function runs before the effect fires again (when a dependency changed) and once more on unmount. `useLayoutEffect` follows th
What are the three provider scopes, and what does each cost at runtime?1 / 10
`Scope.DEFAULT` (singleton) instantiates once and is shared. `Scope.REQUEST` creates a fresh instance per incoming request, so the whole injection chain above it also becomes request-scoped — adding per-request allocation and a `ContextId` lookup. `Scope.TRANSIENT` gives each consumer its own dedicated instance. Request/transient scope sacrifice the singleton fast path, so reserve them for genuinely per-request or per-consumer state.
Lambda is a serverless compute service that runs your function code in response to events without you provisioning or managing servers, billing per request and execution duration.
BFS explores level by level (queue) — optimal for shortest paths in unweighted graphs. DFS goes deep first (stack/recursion) — useful for topological sort, cycle detection, and connected components.
Init, Plan, Apply, Destroy Terraform's day-to-day workflow is short and repeatable: prepare the working directory, preview the change, then decide whether to make it real. Only apply and destroy ever touch real resources — plan is always sa
What does `on FormatException catch (e)` do differently from a plain `catch (e)`?
AIt only catches FormatException (and subtypes), letting other errors propagateBIt catches every possible error typeCIt silently ignores the error without running any codeDIt only works inside async functions
Each department and its employee count, but only departments with more than 5 employees. WHERE filters rows before grouping; HAVING filters the groups after aggregation.
Generics let you write reusable code that works with multiple types while preserving type safety. `function identity<T>(x: T): T` returns the same type it receives — T is inferred at the call site.
The event loop runs the call stack until empty, then drains ALL microtasks (Promises, queueMicrotask), then picks ONE macrotask (setTimeout, setInterval, I/O), then repeats. Microtasks always run before the next macrotask.
From main() to a Running App Calling `SpringApplication.run(App.class, args)` bootstraps the whole application: it creates the ApplicationContext, loads and registers beans, applies autoconfiguration, and (for a web app) starts the embedded
Software
Software · L1 · Spring Boot: Application Lifecycle & Logging
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.
Two Axes of Parallelism Training a large model at scale requires distributing computation across many accelerators, and there are two orthogonal ways to do it. Data parallelism replicates the entire model on every worker i and partitions a
Software
Software · L5 · Systems for Distributed Machine Learning
What is the difference between composition and inheritance in module design?1 / 10
Terraform has no inheritance — a root module composes child modules by passing outputs of one as inputs to another. Favor small, single-purpose modules wired together over deep nesting, which makes the data flow explicit and keeps blast radius and reuse bounded.
Write a failing test first (Red), write the minimal code to pass it (Green), then improve the design (Refactor) — repeat. It drives design from requirements and creates a safety net for refactoring.