🧑‍💻 Full-stack · Node.js + React · Free

Service company interview questions: quick revision

The questions that service companies ask full-stack developers again and again, with short answers in simple English. Made for a Node.js and React stack, 3 to 10 years. Read the question, answer it out loud, then open it to check.

This is a fast revision sheet: short answers you can say in an interview, then explain further. For the full version of each topic, with playable diagrams and tested code, use the Frontend and Backend interview series and the System Design course.

How the interview usually goes

  • Recruiter call: role, notice period, current and expected salary, location. Keep exact numbers ready.
  • Online test (sometimes): a few easy or medium coding problems (strings, arrays, a map) plus MCQs.
  • Technical round 1: depth in your stack and a small live task, like "build a toggle button" or "pull data from an API into a table".
  • Technical round 2 / client round: your project's design, trade-offs, and "how did you do X". This matters most at 6+ years.
  • Managerial and HR: incidents, estimates, team conflicts, then salary and documents.

At 3–10 years, companies care more about strong basics and how you solved real problems than about hard algorithm puzzles. After each answer, add one line: "In my project, we used this to…". That is what makes an answer sound experienced.

What each company tends to focus on

CompanyWhat they often askTip
TCSFundamentals: state vs props, React lifecycle and hooks, promises, Node basics, SQL. Plus HR.Be clear and simple. They like candidates who explain basics well.
WiproReact and JavaScript basics, REST, SQL queries, and project questions.Revise core concepts; expect a managerial and HR round.
AccentureHooks, memoization, Virtual DOM, JavaScript core, plus an online test and HR.Know when to use useMemo, useCallback and React.memo.
CognizantBasic DSA (strings), then advanced JavaScript and React in a client round (API into a table).Practice one small live coding task on screen share.
InfosysReact, TypeScript and Node; some rounds are AI-led or online. State management and routing.Expect useState vs useReducer, Context vs Redux, and performance.
CapgeminiDeep JavaScript: closures, deep vs shallow copy, Promise.all vs race, cancelling an API. A live task like a toggle.Be ready to write small JavaScript logic live.

These are common patterns, not fixed rules. The exact questions change by team, project and location. Treat this as a checklist, not a guarantee.

JavaScript and TypeScript

The core every company checks.

What is a closure?

A function that remembers the variables from where it was created, even after that outer function has finished. It is used for private data and for hooks like useState.

var vs let vs const?

var is function-scoped and can be used before its line (as undefined). let and const are block-scoped. const cannot be reassigned, but an object it points to can still change inside.

Deep copy vs shallow copy?

A shallow copy (like {...obj}) copies only the top level; nested objects are still shared. A deep copy (structuredClone(obj)) copies everything, so changes do not affect the original.

Promise.all vs allSettled vs race?

all waits for every promise but fails if one fails. allSettled waits for all and tells you each result, success or failure. race returns as soon as the first one finishes, success or failure.

How do you cancel an API call?

Create an AbortController, pass its signal to fetch, and call abort() to stop it. Useful in React cleanup so an old request does not overwrite new data.

Microtask vs macrotask (event loop)?

When the call stack is empty, the engine first runs all microtasks (promise .then), then one macrotask (setTimeout). That is why a resolved promise runs before setTimeout(…, 0).

Debounce vs throttle?

Debounce waits until the user stops for N milliseconds, then runs once (good for a search box). Throttle runs at most once every N milliseconds (good for scroll).

interface vs type in TypeScript?

Both describe object shapes. interface can be extended and merged. type can also do unions, intersections and tuples. Use interface for object contracts and type for unions.

unknown vs any?

any turns off type checking. unknown is safe: you must check or narrow the value before you use it.

React

useMemo vs useCallback vs React.memo?

useMemo remembers a value, useCallback remembers a function, and React.memo skips re-rendering a component when its props are the same. Use them only where there is a real cost, not everywhere.

What does the useEffect dependency array do?

It decides when the effect runs: empty [] means once on mount; with values, it runs when they change. Return a cleanup function to remove timers or subscriptions. A missing dependency causes stale data; a wrong one causes an infinite loop.

What is the Virtual DOM / reconciliation?

React builds a copy of the UI in memory, compares the new one with the old, and updates only the parts that changed. The key prop helps it track list items (do not use the array index as key when the list can reorder).

useState vs useReducer vs Context vs Redux?

Simple local state: useState. Complex state with many related changes: useReducer. Share data without prop-drilling (theme, user): Context. Large shared app state with tools and middleware: Redux.

How do you improve React performance?

Split code and lazy-load, memoize where needed, virtualize long lists, use correct keys, and move state down so fewer components re-render.

Controlled vs uncontrolled input?

Controlled: the value lives in React state (value + onChange). Uncontrolled: the value lives in the DOM and you read it with a ref. Forms usually use controlled inputs.

What is a custom hook?

A reusable function whose name starts with use and that uses other hooks inside, like useFetch or useDebounce. It lets you share logic between components.

Next.js

Strong points for senior full-stack roles.

Server Components vs Client Components?

In the App Router everything is a Server Component by default (runs on the server, no JavaScript sent, can read the database). Add "use client" when you need hooks, events or browser APIs. A Server Component can be passed into a Client Component as a child, but not imported into it.

SSR vs SSG vs ISR vs CSR?

SSG builds pages at build time. SSR renders on every request. ISR is SSG that refreshes in the background after a set time. CSR fetches in the browser after load. Choose by how often the data changes and how personal it is.

How does data fetching and caching work?

You can await fetch() inside a server component. Next can cache the result; control it with revalidate or cache: 'no-store', and refresh on demand with revalidatePath or revalidateTag.

What are Server Actions?

Functions marked "use server" that run on the server for form submits and updates, without writing a separate API route.

Any recent Next.js change to know?

In Next.js 15, cookies(), headers(), params and searchParams are now async, so you must await them.

Node.js

What is the event loop?

Node runs JavaScript on one thread and uses the event loop to handle many tasks without blocking: it runs your code, hands slow work (files, network) to the system, and runs the callbacks when they are ready.

process.nextTick vs setImmediate?

nextTick runs right after the current operation, before other I/O (and can starve it if overused). setImmediate runs on the next loop cycle.

What are streams and backpressure?

Streams process large data in small chunks instead of loading it all into memory. Backpressure means pausing the source when the destination is slow; pipe() handles this for you.

cluster vs worker threads?

Use cluster to run several processes and use all CPU cores for I/O-heavy apps. Use worker threads for CPU-heavy work so it does not block the main thread.

How do you find a memory leak?

Take heap snapshots and watch memory grow over time. Common causes: data added to a global array, listeners or timers never removed, and closures holding references.

What is graceful shutdown?

On a stop signal, stop taking new requests, let the current ones finish, close database and other connections, then exit. This gives zero-downtime deploys.

NestJS

How does dependency injection work?

You mark a class with @Injectable() and Nest creates it and passes it into the constructors that need it. This keeps code loosely coupled and easy to test with mocks.

Guard vs Interceptor vs Pipe vs Filter?

A Pipe validates or transforms input (DTOs). A Guard allows or blocks a request (auth, roles). An Interceptor wraps the request and response (logging, shaping the reply). An Exception Filter catches errors and formats them.

What is the execution order?

Middleware → Guards → Interceptors (before) → Pipes → your handler → Interceptors (after) → Exception filter.

forRoot vs forRootAsync vs forFeature?

forRoot configures a module once at the root. forRootAsync does the same but reads config asynchronously (from env or a service). forFeature registers per-module pieces, like TypeORM entities.

How do you fix a circular dependency?

When two services need each other, wrap them with forwardRef(() => OtherService) on both sides.

How do you validate request bodies?

Add class-validator decorators to a DTO and enable a global ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, transform: true }) to strip extra fields and convert types.

Databases: SQL, TypeORM and Redis

What is an index and its trade-off?

An index makes reads (WHERE, JOIN, ORDER BY) faster by keeping a sorted structure. The trade-off is slower writes and more storage, so add them only where needed.

What is the N+1 query problem?

Running one extra query for each row in a list. Fix it by joining the related data in one query (in TypeORM, leftJoinAndSelect or relations).

Offset pagination vs keyset pagination?

OFFSET/LIMIT is simple but slow on large offsets. Keyset (WHERE id > lastId ORDER BY id LIMIT n) stays fast and stable as data changes.

What is a transaction?

A group of database changes that all succeed or all roll back together, so data stays correct. In TypeORM you use a query runner or dataSource.transaction().

How do you use Redis?

As a cache (check Redis first, then the database, and save the result with a time-to-live), and for sessions, rate limiting and pub/sub.

What is BullMQ used for?

A job queue on top of Redis for background work like sending emails or building reports, with automatic retries and limits on how many run at once.

System design and scenarios

Common in the client and senior rounds.

An API suddenly got slow. How do you fix it?

First measure with logs or an APM tool. Then look for slow database queries (add an index), the N+1 problem, missing pagination, serial awaits that could run in parallel, and add caching or move heavy work to a background queue.

How do you design authentication?

Use a short-lived access token and a long-lived refresh token (kept in an httpOnly cookie). When the access token expires, get a new one with the refresh token; on logout, revoke the refresh token. Mention any single sign-on (OIDC) work you have done.

What is idempotency and why does it matter?

The same request sent twice should not cause a second change. The client sends an idempotency key, the server stores it, and a retry returns the same result instead of charging or creating twice.

How do you rate-limit an API?

Count requests per user or IP in Redis using a token bucket or sliding window, and return 429 Too Many Requests with a Retry-After header when the limit is crossed.

How do you handle large file uploads?

Let the browser upload straight to storage (like S3) using a pre-signed URL, so large files do not pass through your server, and save only the file details in the database.

Managerial and HR

Prepare two or three real stories using the STAR method: Situation, Task, Action, Result. Use numbers, and do not name your employer or client.

Tell me about a tough bug you fixed.

Pick one real story: what was failing, what you were asked to do, how you found the root cause and fixed it safely, and the result (for example, errors or response time went down). Say it in under two minutes.

Tell me about a disagreement in your team.

Show that you discussed trade-offs with data, perhaps built a small proof of concept, and then aligned on the team's decision. Focus on the outcome, not on being right.

Why are you switching? / What is your strength?

Keep it positive: you want more growth and impact. For strength, mention ownership and that you can handle both building and debugging across the stack.

How do you give an estimate and handle deadlines?

Break work into small pieces, add buffer for testing and unknowns, communicate risks early, and cut scope rather than quality when time is short.

A simple 7-day revision plan

DaysRevisePractice
Day 1–2JavaScript and TypeScript core, plus ReactWrite a debounce, a closure example, and a small toggle component
Day 3Next.js rendering and data fetchingExplain Server vs Client Components out loud
Day 4–5Node.js and NestJS, then SQL, TypeORM and RedisWrite two SQL queries and one NestJS DTO with validation
Day 6System design and scenariosAnswer the "slow API" and "design auth" questions in two minutes each
Day 7Your own projects and HR storiesPrepare three STAR stories with numbers

Do a mock interview before the real one. Saying answers out loud is very different from reading them.

Want a mock interview or a resume review? 🎯

Get honest feedback from a senior engineer from the Kodivo team (8+ years of experience).