DevAtlas

Learn

  • Dashboard
  • Learning Paths
  • All Categories
  • Topics

Practice

  • Interview Questions
  • Flashcards
  • Quizzes
  • Study Plans

Personal

  • Bookmarks
  • Notes
  • Progress
  • PDF Library
  • Settings
  • About
  1. Interview Questions
0%

Interview Questions

Practice with interview-ready answers and know what interviewers expect.

24 results

DefinitionBeginner

What does it mean that HTTP is stateless, and how do applications maintain state?

The server keeps no memory between requests; apps add state with cookies, tokens, or server-side sessions.

HTTP and Web Fundamentals
DefinitionBeginner

Walk me through the parts of an HTTP request and response.

Request: request line, headers, blank line, optional body. Response: status line, headers, blank line, body.

HTTP and Web Fundamentals
ComparisonBeginner

What is the difference between a safe method and an idempotent method? Give examples.

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.

HTTP and Web Fundamentals
ScenarioBeginner

You are designing endpoints to create and update a user resource. When would you choose POST, PUT, and PATCH?

POST to create a new user, PUT to replace the whole user record, PATCH to change only some fields.

HTTP and Web Fundamentals
ComparisonBeginner

What is the difference between HTTP 401 and 403, and when would you return each?

401 means the caller is not authenticated (unknown identity); 403 means they are authenticated but lack permission.

HTTP and Web Fundamentals
ScenarioBeginner

You are designing a POST /users endpoint. Which status codes would you return for success, a duplicate email, invalid field values, and an unexpected crash?

201 Created on success, 409 Conflict for a duplicate email, 422 Unprocessable Entity for invalid values, and 500 Internal Server Error for a crash.

HTTP and Web Fundamentals
DefinitionIntermediate

What makes an API RESTful? Walk me through the key constraints.

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.

REST APIs
ScenarioIntermediate

How would you design the resource URIs for a blog with articles and comments, and why?

Plural noun collections and members (/articles, /articles/42), shallow nesting for ownership (/articles/42/comments), with HTTP methods as the verbs.

REST APIs
ComparisonIntermediate

What is the difference between PUT and PATCH, and when would you use each?

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.

REST APIs
ScenarioIntermediate

Is PATCH idempotent? Give an example where a retried PATCH corrupts data and explain how to prevent it.

Not guaranteed. A PATCH that appends to an array is non-idempotent, so a retry duplicates the entry; prevent it with idempotent patch design or an idempotency key.

REST APIs
ComparisonBeginner

What is the difference between authentication and authorization, and which one happens first?

Authentication verifies who you are; authorization decides what you may do. Authentication always happens first.

Authentication and Authorization
ScenarioBeginner

When should an API return 401 Unauthorized versus 403 Forbidden?

Return 401 when authentication is missing or invalid; return 403 when the identity is known but not permitted.

Authentication and Authorization
DefinitionIntermediate

What is a JWT, and what are its parts?

A compact, signed token of three Base64URL parts — header, payload (claims), and signature — used for stateless authentication.

Authentication and Authorization
ScenarioIntermediate

Are JWTs encrypted? A teammate wants to store the user’s password in the payload "because it is a token" — how do you respond?

No — JWTs are signed, not encrypted. The payload is Base64URL-encoded and readable by anyone, so secrets must never go in it.

Authentication and Authorization
ComparisonIntermediate

Compare access tokens and refresh tokens. How do they differ in lifetime, usage, and storage?

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.

Authentication and Authorization
ScenarioIntermediate

A teammate proposes making access tokens valid for 24 hours so users rarely need to refresh. What are the risks, and what would you recommend?

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.

Authentication and Authorization
DefinitionIntermediate

Walk me through the lifecycle of a StatefulWidget’s State object.

createState → initState → didChangeDependencies → build → didUpdateWidget → (setState → build) → deactivate → dispose. Set up in initState, release in dispose.

Flutter
ComparisonIntermediate

What is the difference between initState and didChangeDependencies, and when do you use each?

initState runs once and cannot safely use inherited widgets; didChangeDependencies runs after it and again when an InheritedWidget dependency changes, so it is where context-dependent setup goes.

Flutter
ComparisonBeginner

What is the difference between StatelessWidget and StatefulWidget, and why does Flutter separate the widget from its State?

StatelessWidget is immutable and rebuilds only when inputs change. StatefulWidget has a persistent State object holding mutable data updated via setState(). Widgets are cheap immutable configs; State persists so data survives rebuilds.

Flutter
ScenarioBeginner

How do you decide whether a piece of UI should be a StatelessWidget or a StatefulWidget?

If the widget has no data that changes on its own, use StatelessWidget. If it must remember something that changes over time — input, animation, timer, subscription — use StatefulWidget.

Flutter
DefinitionIntermediate

What is BuildContext in Flutter, and what is it used for?

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.

Flutter
DebuggingIntermediate

What are the most common BuildContext errors and how do you fix them?

Using a context above the target widget (fix with a Builder or descendant context), using context after unmount (guard with mounted), and doing inherited lookups in initState (move to didChangeDependencies).

Flutter
DefinitionIntermediate

What is a database index, and how does it make queries faster?

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.

Databases and SQL
ScenarioIntermediate

When would you decide NOT to add an index, and how do you decide column order in a composite index?

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.

Databases and SQL