OS
OpenStem
@openstem · Joined Jul 2026
7420 public items8 groups
Flashcards10 cards
What does calling `setState` do in a StatefulWidget?1 / 10
It notifies the framework that internal state has changed, scheduling a rebuild of the widget's `build` method. Mutations should happen inside the setState callback.
State Management
@openstem
State ManagementFlashcards10 cards
What is a Server Action in Next.js?1 / 10
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.
Data & Optimization
@openstem
Data & OptimizationFlashcards10 cards
Are components in the Next.js App Router server or client by default?1 / 10
They are Server Components by default; you opt into client behavior by adding the "use client" directive at the top of the file.
App Router & Server Components
@openstem
App Router & Server ComponentsFlashcards10 cards
What is the role of a Nest module?1 / 10
A class annotated with `@Module` that groups related providers, controllers, imports, and exports into a cohesive feature boundary.
Modules & Providers
@openstem
Modules & ProvidersFlashcards10 cards
What does a @Controller decorator define?1 / 10
A class whose methods handle incoming requests for a route prefix, mapping HTTP verbs to handler methods via decorators like `@Get` and `@Post`.
Controllers, Pipes & Guards
@openstem
Controllers, Pipes & GuardsFlashcards10 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`.
Aggregation Framework
@openstem
Aggregation FrameworkFlashcards10 cards
What is the default index type in PostgreSQL?1 / 10
A B-tree index, which supports equality and range queries on ordered data and is the default for `CREATE INDEX`.
Indexes & Query Planning
@openstem
Indexes & Query PlanningFlashcards10 cards
What does a LEFT JOIN return for unmatched right-side rows?1 / 10
All rows from the left table, with NULLs in the right-table columns where no match exists.
Joins & Subqueries
@openstem
Joins & SubqueriesFlashcards10 cards
What is the difference between `json` and `jsonb` in PostgreSQL?1 / 10
`json` stores the exact text and reparses on access; `jsonb` stores a decomposed binary form that is faster to query and indexable.
Data Types & JSONB
@openstem
Data Types & JSONBFlashcards10 cards
What is the primary purpose of a VPC?1 / 10
A VPC is a logically isolated virtual network within an AWS region where you launch resources, controlling IP addressing, subnets, routing, and gateways.
Networking & VPC
@openstem
Networking & VPCFlashcards10 cards
What kind of database is Amazon RDS?1 / 10
RDS is a managed relational database service supporting engines like PostgreSQL, MySQL, MariaDB, Oracle, and SQL Server, handling patching, backups, and failover.
Databases (RDS & DynamoDB)
@openstem
Databases (RDS & DynamoDB)Flashcards10 cards
What is an IAM policy?1 / 10
An IAM policy is a JSON document that defines permissions by allowing or denying actions on specified resources under given conditions.
Security & IAM
@openstem
Security & IAMFlashcards10 cards
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.
Compute & Networking
@openstem
Compute & NetworkingFlashcards10 cards
Which Cloud Storage class is cheapest for rarely accessed, long-term backups?1 / 10
Archive storage has the lowest storage price but the highest retrieval cost and a 365-day minimum storage duration, ideal for cold, long-term data.
Storage & Databases
@openstem
Storage & DatabasesFlashcards10 cards
What three parts make up an IAM policy binding in GCP?1 / 10
A binding ties a role (a set of permissions) to one or more members (principals) on a resource; the policy is the collection of bindings.
IAM & Security
@openstem
IAM & SecurityFlashcards10 cards
What is a Terraform module?1 / 10
A module is a reusable container of .tf files in a directory. The root module calls child modules via a module block, passing inputs and reading outputs.
Modules & Variables
@openstem
Modules & VariablesFlashcards10 cards
Why does Terraform need a state file?1 / 10
State maps configuration resources to real-world infrastructure IDs, tracks metadata and dependencies, and lets Terraform compute diffs for plans.
State Management
@openstem
State ManagementFlashcards10 cards
What is a Terraform provider?1 / 10
A provider is a plugin that implements resource and data source types for a platform (AWS, GCP, Kubernetes), translating Terraform config into API calls.
Providers & Resources
@openstem
Providers & ResourcesFlashcards10 cards
What is the event loop?1 / 10
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.
Async & Promises
@openstem
Async & PromisesFlashcards10 cards
How does JavaScript's garbage collector know when to free memory?1 / 10
Modern engines use mark-and-sweep: the GC marks all objects reachable from GC roots (globals, call stack), then sweeps (frees) everything unreachable. Objects not reachable from any live reference are eligible for collection.
Performance & Memory
@openstem
Performance & MemoryFlashcards10 cards
What does a conditional type `T extends U ? X : Y` evaluate to?1 / 10
It picks X when T is assignable to U and Y otherwise; it becomes a powerful tool when combined with generics and inference.
Advanced Types (Conditional & Template Literal)
@openstem
Advanced Types (Conditional & Template Literal)Flashcards10 cards
What is a recursive type and when is it needed?1 / 10
A type that references itself in its definition, used to model recursive data structures like JSON, trees, or linked lists. e.g. `type JSONValue = string | number | boolean | null | JSONValue[] | { [k: string]: JSONValue }`
Type-Level Programming
@openstem
Type-Level ProgrammingFlashcards9 cards
What does this print and why is it surprising?1 / 9
Prints `[1]` then `[1, 2]`. Default mutable arguments are evaluated ONCE at function definition, not per call — the same list persists across calls. Fix: use `def add(x, lst=None): if lst is None: lst = []`.
Gotchas & Edge Cases
@openstem
Gotchas & Edge CasesFlashcards9 cards
What is the GIL and what does it mean for CPU-bound vs I/O-bound Python code?1 / 9
The Global Interpreter Lock (GIL) in CPython allows only one thread to execute Python bytecode at a time. CPU-bound threads do NOT run in parallel — use multiprocessing or C extensions. I/O-bound threads DO get effective concurrency because the GIL is released during I/O waits.
Performance & Internals
@openstem
Performance & InternalsFlashcards10 cards
What does React.memo do?1 / 10
Wraps a component to skip re-renders when props haven't changed (shallow equality). Useful for expensive components receiving stable props. Avoid over-using it — the memoization overhead can cost more than the re-render.
Performance
@openstem
PerformanceFlashcards9 cards
What is the key constraint of a React Server Component?1 / 9
It runs only on the server, never ships its code to the client, and cannot use state or effects like useState/useEffect or browser-only APIs. Server Components were stabilized in React 19.
Server Components & Suspense
@openstem
Server Components & SuspenseFlashcards8 cards
What is dynamic programming?1 / 8
An optimization technique that solves problems by breaking them into overlapping subproblems and storing results to avoid redundant computation. Requires optimal substructure (optimal solution contains optimal subproblem solutions) and overlapping subproblems.
Dynamic Programming
@openstem
Dynamic ProgrammingFlashcards8 cards
What is the difference between BFS and DFS?1 / 8
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.
Graphs & Traversals
@openstem
Graphs & TraversalsFlashcards10 cards
What core benefit does a message queue provide between services?1 / 10
Asynchronous decoupling: producers and consumers operate independently, buffering load spikes and improving resilience.
Message Queues & Streaming
@openstem
Message Queues & StreamingFlashcards10 cards
What is the difference between L4 and L7 load balancing?1 / 10
L4 (transport layer) load balancing routes based on IP and TCP/UDP port — fast, simple, no protocol awareness. L7 (application layer) routes based on HTTP headers, URLs, cookies, or content — enables sticky sessions, path-based routing, and more sophisticated traffic management.
Scalability & Reliability
@openstem
Scalability & Reliability