Practice with interview-ready answers and know what interviewers expect.
24 results
The server keeps no memory between requests; apps add state with cookies, tokens, or server-side sessions.
Request: request line, headers, blank line, optional body. Response: status line, headers, blank line, body.
Safe means read-only with no state change (GET, HEAD, OPTIONS); idempotent means repeating the request yields the same state (GET, HEAD, OPTIONS, PUT, DELETE). POST is neither.
POST to create a new user, PUT to replace the whole user record, PATCH to change only some fields.
401 means the caller is not authenticated (unknown identity); 403 means they are authenticated but lack permission.
201 Created on success, 409 Conflict for a duplicate email, 422 Unprocessable Entity for invalid values, and 500 Internal Server Error for a crash.
It honors REST’s constraints — especially the uniform interface and statelessness — modeling data as resources with URIs, manipulated via standard HTTP methods and status codes.
Plural noun collections and members (/articles, /articles/42), shallow nesting for ownership (/articles/42/comments), with HTTP methods as the verbs.
PUT replaces the whole resource with a full body and is idempotent; PATCH applies a partial update via a patch document and is not guaranteed idempotent.
Authentication verifies who you are; authorization decides what you may do. Authentication always happens first.
Return 401 when authentication is missing or invalid; return 403 when the identity is known but not permitted.
A compact, signed token of three Base64URL parts — header, payload (claims), and signature — used for stateless authentication.
No — JWTs are signed, not encrypted. The payload is Base64URL-encoded and readable by anyone, so secrets must never go in it.
Access tokens are short-lived and sent on every resource request; refresh tokens are long-lived and sent only to the token endpoint to get new access tokens.
A 24-hour access token stays dangerous for a full day if it leaks and usually cannot be revoked. Keep access tokens short and use a refresh token for continuity.
createState → initState → didChangeDependencies → build → didUpdateWidget → (setState → build) → deactivate → dispose. Set up in initState, release in dispose.
It is a handle to a widget’s position in the tree — its Element — used to look up ancestors and inherited widgets like Theme, MediaQuery, and Navigator.
A sorted auxiliary structure (usually a B-tree) that lets the engine find matching rows in O(log n) instead of an O(n) full table scan.
Skip indexes on tiny tables, low-cardinality columns, and write-heavy paths where the maintenance cost outweighs read gains. In a composite index, lead with the equality/most-selective column, then range and sort columns.