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.
What is a discriminated union and why is it useful?1 / 10
A union of object types each with a shared literal property that TypeScript uses to narrow: `type Shape = { kind: 'circle'; r: number } | { kind: 'rect'; w: number; h: number }`. The `kind` discriminant lets TypeScript know which branch you're in.
Why Isolation Levels Exist When multiple transactions run at once, the database has to decide how much of each other's in-progress work they can see. A stricter isolation level prevents more anomalies but forces more transactions to wait on
Site Reliability Engineering practice SRE treats operations as a software problem: reliability targets are explicit, the tradeoff between velocity and stability is quantified, and incident response is a practiced discipline rather than impr
Software
Software · L4 · Site Reliability Engineering practice
pubspec.yaml: Your Project's Manifest Every Dart/Flutter project has a `pubspec.yaml` at its root declaring the project's name, its SDK constraint, and its dependencies (and dev_dependencies, used only during development, like test tooling)
Explain the difference between == and === in JavaScript.1 / 10
`===` is strict equality — compares value AND type with no coercion. `==` is loose equality — coerces operands to a common type first (`0 == ""` is true). Always prefer `===`.
Define a Hoare triple {P} C {Q} and state what it asserts about program C.1 / 8
{P} C {Q} asserts partial correctness: if the precondition P holds in the initial state and command C terminates, then the postcondition Q holds in the resulting state. It says nothing about whether C actually terminates — a program that loops forever from any state satisfying P vacuously satisfies {P} C {Q} for any Q.
Software
Software · L5 · Hoare Logic & Program Verification
What is the difference between Compute Engine and Cloud Run?1 / 10
Compute Engine provides managed VMs (IaaS) that you size and patch. Cloud Run runs stateless containers serverlessly, scaling to zero and billing per request.
Organizations centrally manages multiple AWS accounts, enabling consolidated billing, organizational units (OUs), and Service Control Policies for governance at scale.
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.
What is the main tradeoff of leaderless (quorum-based) replication compared to leader-based replication?
AIt removes the need for any conflict resolutionBIt favors write availability during partitions, at the cost of needing explicit conflict resolution when replicas divergeCIt guarantees linearizability automaticallyDIt eliminates the need for multiple replicas
Amortised Analysis Amortised analysis assigns a cost to each operation in a sequence so that the total amortised cost bounds the total actual cost, even when individual operations are expensive. Example: Dynamic Array (Doubling) A dynamic a
Software
Software · L5 · Advanced Algorithms: Amortised Analysis and Randomisation