Skip to content

Full Stack Developer interview questions

100 real questions with model answers and explanations for Junior candidates.

See a Full Stack Developer resume example

Practice with flashcards

Spaced repetition · Hunter Pass

Listen to the interview

Play it like a podcast: question and model answer, one after another.

Questions

scopejavascript

var is function-scoped and hoisted, while let and const are block-scoped.

  • var: hoisted to the top of its function and accessible before its declaration line
  • let and const: block-scoped and not accessible before declaration
  • let allows reassignment, const does not, though const objects can still be mutated
  • Default to const, use let only when reassignment is genuinely needed

Why interviewers ask this: Checks whether the candidate understands scoping rules, hoisting, and modern JavaScript conventions rather than relying on outdated var usage.

closuresjavascript

A closure is a function that keeps access to its outer scope variables after that function returns.

  • Retains outer lexical scope variables even after the outer function returns
  • Example: a counter factory returns an inner function that increments a private count
  • Each call to the factory creates an independent counter
  • Foundation of memoization, module patterns, and stateful event handlers

Why interviewers ask this: A strong answer demonstrates the candidate understands scope chains, not just that closures remember variables from the enclosing scope.

asyncevent-loop

Node.js runs JavaScript on a single thread but offloads I/O so it never blocks.

  • Delegates I/O like file reads and network requests to the OS or libuv's thread pool
  • A completed async operation puts its callback in the event loop queue
  • The event loop runs that callback once the call stack is empty
  • Lets Node.js handle thousands of concurrent connections without blocking

Why interviewers ask this: Tests the candidate's mental model of Node.js concurrency, which is critical for writing non-blocking server code.

javascript

== compares after type coercion, while === checks value and type without coercion.

  • == coerces types first, so 0 == false is true
  • === checks both value and type, so 0 === false is false
  • Prefer === in production to avoid bugs from implicit conversion

Why interviewers ask this: Candidates who rely on == without understanding coercion often introduce hard-to-find bugs in conditional logic.

asyncpromises

A Promise represents the eventual result of an asynchronous operation.

  • Has three states: pending, fulfilled, or rejected
  • You chain .then() and .catch() to handle the outcome
  • async/await is sugar over Promises that reads like synchronous code
  • Errors are handled with try/catch instead of chained handlers

Why interviewers ask this: Evaluates whether the candidate understands the Promise lifecycle and can connect async/await syntax to the underlying mechanism.

functions

A higher-order function takes a function as an argument, returns one, or both.

  • map, filter, and reduce are common examples
  • map takes a callback and applies it to every element, returning a new array of the same length
  • Enables composable, reusable logic
  • Central to functional programming patterns in JavaScript

Why interviewers ask this: Gauges understanding of first-class functions, which underpin much of modern JavaScript and React's design.

fundamentalsjavascript

undefined means a value was never set, while null is an intentional empty value.

  • undefined: default for a declared but unassigned variable or a missing function parameter
  • null: a deliberate assignment marking the absence of a value
  • Both are falsy
  • typeof undefined is 'undefined' but typeof null is 'object', a historical quirk

Why interviewers ask this: Distinguishing these two helps identify candidates who understand JavaScript's type system and avoid accidental bugs from uninitialized values.

destructuringjavascript

Destructuring extracts array values or object properties into separate variables concisely.

  • Works on both arrays and objects, pulling fields into distinct variables
  • Example: const { name, age } = user pulls fields directly without separate accesses
  • Reduces repetitive property access
  • Especially handy with function parameters, API responses, and React props

Why interviewers ask this: Checks familiarity with modern ES6+ syntax that appears throughout React and Node.js codebases daily.

typescripttypes

An interface describes an object's shape, while a type alias can describe any type.

  • Interfaces can be extended or implemented by classes, and same-name interfaces merge automatically
  • Type aliases cover unions, primitives, and tuples, not just objects, with no declaration merging
  • Prefer interfaces for extendable object shapes
  • Prefer type aliases for union and computed types

Why interviewers ask this: Tests practical TypeScript knowledge and whether the candidate understands when to use each construct rather than treating them as interchangeable.

typescript

TypeScript infers a variable's type from its initial value.

  • const count = 0 is typed number without an explicit annotation
  • Inference also covers function return types and generic parameters
  • It applies to destructured values too
  • Reduces annotation boilerplate while keeping full type safety

Why interviewers ask this: A candidate who understands inference writes cleaner TypeScript and avoids over-annotating every variable in the codebase.

restspread

Spread expands an iterable into individual elements, while rest collects arguments into an array.

  • Spread combines arrays with [...arr1, ...arr2] or clones objects with { ...original, key: newValue }
  • Rest uses the same syntax in function definitions, like function sum(...numbers)
  • Both appear constantly in React state updates and utility function signatures

Why interviewers ask this: Spread and rest are pervasive in modern JavaScript; this verifies practical syntax knowledge used in everyday full-stack work.

prototypesjavascript

Every JavaScript object links to a prototype object, forming a chain.

  • Accessing a property walks up the prototype chain until found or it reaches null
  • ES6 classes are syntactic sugar over this prototype chain
  • They do not add a traditional class-based model like Java or C#

Why interviewers ask this: Understanding the prototype chain helps candidates debug unexpected property lookups and understand why built-in methods like .toString() are available on every object.

async

Synchronous code blocks the thread until each operation finishes, asynchronous code does not.

  • Synchronous runs line by line, which can freeze the UI or server on long tasks
  • Asynchronous starts an operation and keeps running other code while waiting
  • Results arrive via a callback, Promise, or async/await
  • Nearly all I/O like database queries and HTTP calls must be async to avoid blocking

Why interviewers ask this: Misunderstanding sync vs async is a root cause of blocked UIs and unresponsive Node.js servers.

javascriptmodulessystem-design

CommonJS uses require and runs synchronously, while ES Modules use import and support tree shaking.

  • CommonJS: require() and module.exports, synchronous, the legacy Node.js default
  • ES Modules: import and export, static analysis and tree shaking, the current standard
  • The module format affects how imports resolve and how unused code is eliminated when bundling

Why interviewers ask this: Interviewers verify the candidate can navigate a codebase that mixes both formats and understands the practical trade-offs.

callbacks

A callback is a function passed to another function to run when an async operation finishes.

  • Passed as an argument and called once the operation completes
  • Nesting callbacks several levels deep creates callback hell that is hard to read and maintain
  • Promises and async/await flatten this nesting and restore a readable sequential flow

Why interviewers ask this: Asking about callbacks and their downsides checks whether the candidate understands the historical evolution of async JavaScript and can explain why modern patterns exist.

typescriptgenerics

Generics let you write reusable code that works with different types while keeping type safety.

  • Example: identity<T>(value: T): T accepts any type and returns the same type
  • No type information is lost in the process
  • Common in utility types, data fetching wrappers, and reusable React component APIs
  • Useful when the exact type is unknown at the time of writing

Why interviewers ask this: Generics are a step above basic TypeScript knowledge; a candidate who understands them can write truly reusable, type-safe abstractions.

arrays

map transforms, filter selects, and reduce accumulates.

  • map transforms every element and returns a new array of the same length
  • filter returns only elements that pass a predicate, possibly shorter than the original
  • reduce accumulates all elements into a single value like a sum, object, or array

Why interviewers ask this: These three methods are used constantly in both frontend data rendering and backend data processing, so fluency with them is a baseline expectation.

javascript

Optional chaining safely reads nested properties, and nullish coalescing supplies defaults only for null or undefined.

  • ?. returns undefined instead of throwing when an intermediate value is null or undefined, like user?.address?.city
  • ?? returns the right side only when the left is null or undefined, unlike || which also triggers on 0 or empty strings
  • Combined, user?.name ?? 'Anonymous' gives clean and safe default logic

Why interviewers ask this: Both operators are common in modern codebases and eliminate verbose null checks; comfort with them signals up-to-date JavaScript knowledge.

reactdomvirtual-dom

The virtual DOM is a lightweight JavaScript object tree mirroring the real DOM.

  • On state change, React builds a new virtual tree and diffs it against the previous snapshot
  • It then applies only the minimal set of real DOM mutations needed
  • Faster than touching the real DOM on every change, since DOM operations are costly
  • Frees developers from manually tracking which elements need updating

Why interviewers ask this: Understanding the virtual DOM explains why React components re-render and lays the groundwork for reasoning about rendering performance.

reactcomponentsforms

A controlled component keeps its value in React state, an uncontrolled one keeps it in the DOM.

  • Controlled: React is the single source of truth, every keystroke triggers a state update and re-render
  • Uncontrolled: the value lives in the DOM, read via a ref when needed, without React state
  • Controlled components give predictable behavior and easier validation
  • Uncontrolled components are simpler for cases like file inputs

Why interviewers ask this: This distinguishes candidates who understand React's data flow model from those who copy form patterns without understanding why they work.

Locked questions

  • 21

    What is useState and how does it differ from a regular variable in a component?

    componentshooks
  • 22

    How does useEffect work and what is the purpose of its dependency array?

    hooksdependencies
  • 23

    What is the React component lifecycle in functional components?

    reactcomponents
  • 24

    When would you use useCallback and useMemo?

  • 25

    What is prop drilling and how does the Context API help solve it?

    stateapi
  • 26

    How do you handle forms in React?

    soft-skillsreact
  • 27

    What is the difference between React.memo and useMemo?

    react
  • 28

    How does the key prop work in React lists and why is it important?

    react
  • 29

    What is Next.js and what problems does it solve over plain React?

    reactnextjs
  • 30

    What is the difference between getServerSideProps and getStaticProps in Next.js?

    nextjs
  • 31

    How does routing work in the Next.js App Router?

    nextjs
  • 32

    What is Tailwind CSS and how does it differ from traditional CSS frameworks like Bootstrap?

    csstailwind
  • 33

    How would you implement a responsive layout using Tailwind CSS?

    csstailwindresponsive
  • 34

    What is CSS specificity and how is it calculated?

    css
  • 35

    What is the difference between CSS Flexbox and CSS Grid?

    cssflexboxgrid
  • 36

    What is the purpose of semantic HTML and why does it matter?

    htmla11y
  • 37

    How do you handle client-side navigation in a Next.js application without triggering a full page reload?

    soft-skillsnextjs
  • 38

    What are the Rules of Hooks in React and why do they exist?

    reacthooks
  • 39

    What is Node.js and what makes it suitable for building web servers?

  • 40

    How does Express handle routing and middleware?

    middleware
  • 41

    What is the request-response cycle in an Express application?

  • 42

    How do you handle errors in an Express application?

    soft-skills
  • 43

    What is the difference between GET, POST, PUT, PATCH, and DELETE HTTP methods?

    http
  • 44

    What are HTTP status codes and what does each range mean?

    httpstatus-codes
  • 45

    How do you validate request data in a Node.js API?

    validationapi
  • 46

    What is CORS and how do you configure it in an Express application?

    configcors
  • 47

    How do you structure a REST API project for clarity and maintainability?

    rest
  • 48

    What is the purpose of environment variables and how do you manage them in Node.js?

    config
  • 49

    How do you implement pagination in a REST API?

    restpagination
  • 50

    What is rate limiting and why would you add it to your API?

    rate-limiting
  • 51

    How do you handle file uploads in a Node.js server?

    soft-skills
  • 52

    What is a JSON Web Token and how does it work for API authentication?

    authtokensapi
  • 53

    How does session-based authentication differ from token-based authentication?

    authtokenssessions
  • 54

    What is the difference between SQL and NoSQL databases?

    sqlnosqldatabase
  • 55

    When would you choose PostgreSQL over MongoDB for a project?

    postgresmongodb
  • 56

    What is a database index and why is it important for query performance?

    databaseindexesqueries
  • 57

    Explain the basic SQL JOIN types: INNER JOIN, LEFT JOIN, and RIGHT JOIN.

    sqljoins
  • 58

    What is database normalization and what problems does it solve?

    databasenormalization
  • 59

    How does Prisma ORM simplify database interactions in a Node.js TypeScript project?

    databaseormtypescript
  • 60

    What is a database transaction and when would you use one?

    databasetransactions
  • 61

    How do you prevent SQL injection in your application?

    sqlinjection
  • 62

    What is the N+1 query problem and how do you avoid it?

    queriesn+1
  • 63

    How would you design a simple users-and-posts schema in a relational database?

    databaseschemadesign
  • 64

    Describe the full request-response cycle when a browser fetches data from an API.

    api
  • 65

    What is the difference between server-side rendering, client-side rendering, and static site generation?

    ssr
  • 66

    What is HTTPS and why is it required for production web applications?

    https
  • 67

    What are cookies and local storage, and what are their key differences for storing authentication tokens?

    authtokenscookies
  • 68

    How does a REST API differ from a GraphQL API at a basic level?

    restgraphql
  • 69

    What is WebSocket and when would you use it instead of regular HTTP?

    httpwebsockets
  • 70

    What is CSRF and how do you protect against it?

    csrf
  • 71

    How does serving content through a CDN improve application performance?

    performance
  • 72

    What is the purpose of the HTTP Authorization header?

    authhttp
  • 73

    How do you structure a new end-to-end feature from a database table to a rendered React component?

    reactcomponentsdatabase
  • 74

    What is Git and what is the difference between merging and rebasing branches?

    git
  • 75

    What branching strategy would you use on a team project?

  • 76

    What is Docker and why should a junior developer understand it?

    docker
  • 77

    What is a CI/CD pipeline and what does it typically include?

    ci-cd
  • 78

    How does Vercel simplify deploying a Next.js application?

    nextjsdeployment
  • 79

    What is GitHub Actions and how would you use it for a basic Node.js workflow?

    ci-cd
  • 80

    How do you manage different environments such as development, staging, and production in a full-stack project?

  • 81

    What is a package.json file and what are its key fields?

    npm
  • 82

    How does pnpm differ from npm?

    pnpmnpm
  • 83

    What is ESLint and why is it valuable in a project?

    eslint
  • 84

    What is unit testing and how does it differ from integration testing?

    unitintegration
  • 85

    How do you write a basic test for a React component using React Testing Library?

    reactcomponentsrtl
  • 86

    What is mocking in tests and why is it useful?

    mocking
  • 87

    What does test coverage measure and what are its limitations?

    coverage
  • 88

    How would you test a REST API endpoint in Node.js?

    restendpoints
  • 89

    How do you approach learning a new technology or framework you have never used before?

  • 90

    Describe a project where you built something from the database to the UI. What was the hardest part?

    database
  • 91

    How do you handle feedback during a code review?

    soft-skillsfeedbackcode-review
  • 92

    What would you do if you were stuck on a bug for several hours?

    problem-solving
  • 93

    How do you prioritize tasks when you have multiple things to work on at the same time?

    prioritization
  • 94

    Describe a time when you improved an existing piece of code. What motivated the change?

  • 95

    How do you make sure your code is understandable to other developers?

  • 96

    How do you estimate how long a development task will take?

    estimation
  • 97

    What does done mean to you when you finish a feature?

  • 98

    How do you keep up with changes in the JavaScript and web development ecosystem?

    learningjavascript
  • 99

    Describe a mistake you made on a technical project and what you learned from it.

    ownership
  • 100

    Why do you want to work as a full-stack developer rather than specializing in only frontend or backend?

    motivation