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.
Software: explore STEM content (page 19 of 25) · openstem
Flashcards10 cards
What is the MongoDB aggregation pipeline?1 / 10
A sequence of stages that transform documents, where each stage's output feeds the next. Common stages include `$match`, `$group`, `$project`, and `$sort`.
One Loop, Five Phases Node's event loop cycles through a fixed sequence of phases every tick. Libuv drives this loop, dispatching queued callbacks in each phase before moving to the next. `process.nextTick()` callbacks and resolved Promise
Why Two Concurrent Applies Are Dangerous State is Terraform's single source of truth for what it manages. If two applies write to it at once, the file can end up corrupted or missing resources — a remote backend with locking exists specific
Software
Software · L2 · Terraform: Safe Applies with Remote State & Locking
When should you use threading vs multiprocessing vs asyncio in Python?1 / 9
Threading: I/O-bound concurrent tasks (GIL released on I/O). Multiprocessing: CPU-bound tasks (each process has its own GIL and memory). asyncio: high-concurrency I/O with a single thread via cooperative coroutines — best for network servers handling thousands of connections.
When Something Goes Wrong Prevention fails sometimes, no matter how strong your defenses. Incident response is the practiced sequence a team follows once an attack or breach is confirmed, so the reaction is fast and consistent rather than i
What is the essential difference between LL(1) and LR(1) parsing?1 / 8
LL(1) builds a parse tree top-down, predicting which production to expand next using one lookahead token — it requires a grammar with no left recursion and disjoint FIRST sets per alternative. LR(1) builds the tree bottom-up, shifting tokens onto a stack and reducing by a production once a right-hand side is fully recognized on top of it; LR(1) accepts a strictly larger class of grammars, including left-recursive ones, at the cost of a more complex, table-driven parser generator.
Which of the following correctly characterises the class NP?
AProblems solvable in non-deterministic polynomial time, equivalently with polynomial-time verifiable certificatesBProblems solvable in polynomial time by a deterministic Turing machineCProblems whose complements are in PDProblems requiring exponential time in the worst case
Define a one-way function (OWF), and explain its role in modern cryptography.1 / 7
A function f: {0,1}* → {0,1}* is one-way if it is efficiently computable (in polynomial time) but hard to invert: for every probabilistic polynomial-time (PPT) adversary A, the probability that A(f(x)) outputs some x′ with f(x′) = f(x), over a uniformly random x, is negligible. OWFs are the minimal cryptographic primitive — Impagliazzo and Luby (1989) showed that essentially all of private-key cryptography (pseudorandom generators, pseudorandom functions, digital signatures, commitment schemes) can be built from OWFs, and conversely most of these primitives imply the existence of an OWF, making OWF existence the foundational assumption of the field.
Which files does Spring Boot read external configuration from by default?1 / 9
application.properties or application.yml on the classpath (and config locations). Spring Boot binds these values into beans and supports profile-specific variants like application-dev.yml.
What is the difference between a taint (on a node) and a toleration (on a Pod)?1 / 10
A taint repels Pods from a node unless the Pod has a matching toleration. Taints/tolerations work together to keep Pods OFF nodes (e.g. dedicated GPU nodes); they do not, by themselves, attract Pods — that's node affinity's job.
One Thread, Two Queues JavaScript runs on a single thread: only one piece of code executes at a time, tracked on the call stack. Asynchronous work — timers, promises, I/O — doesn't run inline; it gets scheduled onto one of two queues that t
What is the difference between `rem` and `em` units?1 / 10
`em` is relative to the font-size of the current element (compounds with nesting). `rem` is relative to the root (<html>) font-size — predictable and not affected by parent sizes. Prefer `rem` for consistent, scalable typography and spacing.
Recite the exact order of the request pipeline, including where exception filters sit.1 / 10
Middleware → guards → interceptors (before `next.handle()`) → pipes → route handler → interceptors (after, operating on the returned stream) → response. Exception filters wrap the whole flow: any error thrown in a guard, pipe, handler, or interceptor is routed to the matching filter. Pipes run after guards because authorization should fail fast, before spending work parsing/validating input.
How does a replica set election decide which member becomes primary?1 / 11
Members run a Raft-like protocol: a candidate requests votes and needs a strict majority of voting members to win. Only members whose oplog is current enough are eligible, and `priority`/`votes` settings influence eligibility — so a member with stale data cannot be elected.
What is the difference between `&&` and `&` for booleans?1 / 10
`&&` is short-circuiting: it stops evaluating once the result is known (right side skipped if left is false). `&` always evaluates both operands. Use `&&` to guard against side effects like null checks.
What transport-layer problem does HTTP/3 solve that HTTP/2 still has?1 / 10
HTTP/2 multiplexes streams over one TCP connection, so a single lost packet stalls ALL streams (TCP head-of-line blocking). HTTP/3 runs over QUIC (on UDP), where streams are independent, so loss on one stream doesn't block the others.