We use privacy-friendly product analytics (no session recording, PII masked) to improve OpenStem. Load analytics? Privacy Policy
Software: explore STEM content (page 4 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.
What does the `new` keyword actually do in `Car c = new Car();`?
AAllocates memory for the object and invokes its constructorBDeclares the Car classCImports the Car class from another packageDDeletes any existing Car object
What is a database index and how does it work?1 / 9
An index is typically a B-tree data structure that maps column values to row locations, enabling fast lookups without a full table scan. Read speed improves from O(n) to O(log n). Each write must update all relevant indexes — there's a write overhead.
What is the difference between `git fetch` and `git pull`?1 / 10
`git fetch` downloads remote changes into the remote-tracking branch but does NOT change your working directory. `git pull` = `git fetch` + `git merge` (or rebase with `--rebase`). Fetching first lets you review changes before integrating.
Small-step semantics defines a one-step reduction relation e → e' capturing a single unit of computation; the meaning of a program is the (possibly infinite) sequence of steps e →* e_final. Big-step semantics defines a relation e ⇓ v directly relating an expression to its final value, described all at once. Small-step exposes intermediate states (useful for reasoning about non-termination, concurrency, and interleaving); big-step is more concise for defining evaluators but cannot directly express non-termination as a first-class judgement.
What are the main root-cause categories of flaky tests?1 / 10
Uncontrolled time (wall-clock, timezones, sleeps), randomness (unseeded RNG, random ordering), concurrency and test-ordering dependencies, network/external services, and shared mutable state (files, DB rows, global singletons) leaking between tests. Each introduces a non-deterministic input the assertion silently depends on.
Explain list comprehension vs a generator expression.1 / 8
A list comprehension `[x for x in it]` eagerly builds the whole list in memory. A generator `(x for x in it)` yields lazily — far more memory-efficient for large or infinite sequences.
Fetching JSON with the http Package `http.get(Uri.parse(url))` returns a Future<Response> with a status code and body string. Check `response.statusCode == 200` before decoding, then use `jsonDecode(response.body)` (from dart:convert) to tu
Every type has a zero value used when a variable is declared without initialization: 0 for numbers, false for bool, "" for strings, and nil for pointers, slices, maps, channels, and interfaces. There is no 'uninitialized' state.
What does virtual memory provide to a process?1 / 8
Each process sees its own large, contiguous virtual address space that the OS maps to physical frames on demand, isolating processes and allowing more memory than RAM via paging to disk.
Which statement best describes the Church–Turing thesis?
AA theorem proving Turing machines can compute any functionBAn unprovable but well-supported claim that Turing machines capture every intuitively effective computational procedureCA proof that P = NPDA theorem stating all decidable languages are regular
What is the 'testing trophy' and how does it differ from the pyramid?1 / 10
Popularized for component/frontend work, it emphasizes integration tests as the largest middle layer (with static analysis at the base), arguing they give the best confidence-per-cost trade-off.
What is relational algebra, and why is it considered the formal foundation of SQL?1 / 7
Relational algebra (Codd, 1970) is a procedural query language of operators — selection σ, projection π, union ∪, set difference −, Cartesian product ×, and (derived) join ⋈ — that transform relations (sets of tuples) into relations. Every SQL query has an equivalent relational-algebra expression, and query engines internally translate declarative SQL into an algebra expression (a logical plan) precisely so they can apply algebraic identities to transform it into an equivalent but cheaper plan before execution.
Software
Software · L5 · Database Theory & Query Optimization
An abstraction giving each process its own large, contiguous address space, mapped to physical RAM (and disk) by the MMU via page tables. It enables isolation, allows programs larger than RAM (via swapping), and simplifies memory allocation.