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.
Mapping Entities and Relationships A JPA entity is a POJO annotated `@Entity` with an `@Id` field, mapped to a database table. Relationships between entities are declared with annotations rather than manual join SQL. Why @Transactional Matt
Software
Software · L2 · Spring Boot: Data Access & Transactions
What does the Hoare triple {P} C {Q} assert about a program C that never terminates from some P-satisfying state?
AThe triple is falseBThe triple is vacuously true, since partial correctness only constrains terminating executionsCThe triple is undefinedDQ must be false
Software
Software · L5 · Hoare Logic & Program Verification
Why must the server hash the incoming password before comparing it, rather than storing and comparing plaintext?
AHashing makes login fasterBIf the database leaks, hashed passwords can't be immediately used, unlike plaintextCHashing is required by HTTPSDIt lets users log in without a password
Why Creational Patterns Exist Creational patterns all deal with the same underlying question — how should an object come into existence? — but they answer it differently depending on what makes construction hard: uniqueness, complexity, var
Software
Software · L1 · Design Patterns: Choosing a Creational Pattern
An async function marked with 'use server' that runs on the server but can be invoked directly from client components (e.g. in a form action or event handler). It eliminates manually writing API routes for mutations — Next handles the RPC.
Wraps an incompatible interface so it can be used where a different interface is expected — a translator between two APIs. Lets you integrate legacy or third-party code without changing it.
What is a Web Worker and what can it NOT do?1 / 10
A Web Worker runs JS in a background thread, keeping the main thread free. It CANNOT access the DOM, window, or main-thread variables directly. Communication is via `postMessage`/`onmessage` with structured-clone data copying.
AA class can be subclassed only onceBA class has at most one instance and provides a global access pointCAn object can only be created by a factoryDAll methods are static
How does Anycast route a client to the nearest CDN edge?1 / 10
Anycast advertises the same IP prefix via BGP from many locations. The internet's routing fabric naturally delivers each client's packets to the topologically nearest advertising node, providing built-in proximity routing and DDoS dispersion.
What is prop drilling and how do you solve it?1 / 10
Passing props through many intermediate components that don't use them — just to reach a deeply nested child. Solve with React Context, a state management library (Zustand, Redux), or component composition.
How are optional named parameters declared in a Dart function?1 / 9
They are wrapped in `{ }` in the signature, e.g. `void f({int x = 0})`. Callers pass them by name, and each may have a default or be marked `required`.
What is the difference between REST and GraphQL?1 / 9
REST uses multiple fixed endpoints (one per resource); GraphQL uses a single endpoint where clients specify exactly the data they need. GraphQL avoids over-fetching and under-fetching but adds complexity. REST is simpler and has better HTTP caching.
What is the difference between a process and a thread?1 / 9
A process is an independent program with its own memory address space. A thread is a unit of execution within a process; threads of the same process share memory and resources. Threads are cheaper to create and switch between, but share state (needing synchronization).
What are the building blocks of a NestJS application?1 / 8
Modules (organize related code), Controllers (handle incoming requests and routing), and Providers/Services (business logic, injectable). Nest wires them via a built-in dependency injection container — a structured, Angular-inspired architecture.