Question library
Explained questions for the decisions developers make.
What LangGraph is and why it exists
LangGraph represents execution as a graph of steps sharing explicit state. Nodes do work and edges select the next step; the graph can contain both ordinary code and model decisions. It supports applications that need branching, repeated tool use, and…
Deterministic workflows
A deterministic workflow follows explicitly coded transitions for given inputs and recorded external outcomes. It can call nondeterministic services, but its orchestration rules remain controlled. It is the natural extension of validation, transactions, and…
Policy-code search fails despite good semantic search. What do you do?
I add exact identifier fields and lexical/hybrid retrieval. Embeddings may not preserve rare codes or precise numbers well. I test actual identifiers and keep them intact during query rewriting and text preprocessing.
The decision mindset
A decision framework is a repeatable sequence of questions that turns a requirement into justified architecture. Each added capability should solve a concrete gap. It prevents treating every client request as an opportunity to deploy every AI framework.
Do I need AI? Can deterministic code solve it?
Ask what the user actually needs and what the existing system already knows. Exact lookups, arithmetic, validation, and known transitions usually belong in normal code. AI is useful when language/media variation or learned pattern recognition provides value…
What is the difference between var, let and const?
var, let and const declare variables, but they have different scope and initialization rules. let and const are block-scoped, making it easier to keep a variable inside the code that needs it. const prevents reassignment of the binding; it does not make an object immutable.
How does async JavaScript run?
Asynchronous JavaScript lets a program start work that may finish later without waiting synchronously for the result. A promise represents eventual completion, and async/await provides a readable way to work with promises. The runtime queues continuations and runs them when the current synchronous work has finished and the relevant checkpoints are reached.
CommonJS vs ES Modules: what is the difference?
CommonJS and ES Modules are two systems for dividing JavaScript code into reusable modules. CommonJS uses runtime require calls, while ES Modules provide standard import and export declarations with a statically described dependency structure. Their loading and interoperability rules depend on the runtime and file configuration.
How do garbage collection and memory leaks work?
Garbage collection automatically reclaims memory that can no longer be reached by running code. A memory leak happens when the program keeps a reference to data it no longer needs, so the collector must treat that data as still usable. Increasing the heap limit may delay failure but does not remove the unwanted references.
How do narrowing and type guards work?
Narrowing is TypeScript's process of reducing a broad type to a more specific type based on control flow and checks. A type guard is a check that gives the compiler evidence about a value, such as typeof, in or a custom predicate. Correct guards help application code safely use data that starts out uncertain.
What are mapped types, conditional types and decorators?
Mapped types build a new type by visiting the keys of another type, and conditional types choose a type based on a type relationship. Decorators are different: they run as part of JavaScript class definition and can add metadata or change behavior. Type transformations disappear during compilation, while decorator code can affect runtime behavior.
What is the output here?
Output prediction requires following the order in which synchronous code and queued callbacks can execute. This example combines the current script, a promise microtask and a timer callback. A zero-delay timer becomes eligible later; it does not interrupt the running script.
How should Express handle errors?
Error handling turns application failures into predictable responses and useful internal logs. Express uses error middleware with four arguments to handle errors passed into its request pipeline. Synchronous throws are handled by Express, while promise forwarding differs between Express 4 and 5.
OAuth vs OIDC: what is the difference?
OAuth is a framework for delegated access, allowing a client to act with limited permission on protected resources. OpenID Connect (OIDC) adds a standard identity layer for user login on top of OAuth. The authorization code flow separates browser redirects from the token exchange and commonly uses PKCE to protect that exchange.
How do I prevent injection, XSS, CSRF and SSRF?
Injection, XSS, CSRF and SSRF attack different trust boundaries. Injection changes a database command, XSS runs unwanted browser code, CSRF abuses automatically attached credentials, and SSRF makes a server contact an unintended destination. Input validation helps, but each attack also needs controls at the point where the dangerous action happens.
What are modules, controllers and services?
Nest modules define feature boundaries and register the controllers and providers that belong to a feature. Controllers handle transport concerns, while services usually contain business rules. This separation makes code easier to reuse and test without tying every decision to HTTP.
Why does Nest say it cannot resolve a dependency?
A dependency-resolution error means Nest cannot find or create a required provider in the current module context. The class may exist in source code but still be invisible to the consumer's module. Troubleshooting should follow the token, registration, export and import path.
What is the Nest request lifecycle?
The request lifecycle is the order in which Nest processes an incoming request and produces a response. Different extension points handle different concerns, such as access checks, input conversion and response wrapping. Knowing the order helps explain why code in one stage cannot rely on work that happens later.
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.