HireHireInterview Quizzes › Full Stack Developer

Full Stack Developer Interview Questions

Think you're ready? These are the questions that actually decide Full Stack Developer interviews. Warm up on Easy — then face the Hard round, where 95% of candidates crumble. 80 questions across 3 levels, instant score, completely free.

80Questions
3Difficulty levels
95%Fail the hard round
FreeInstant score
Easy
Warm-up · 20 Qs
Medium
Practical · 30 Qs
Hard
Brutal · 30 Qs
⚡ Take the Full Stack Developer quiz — get your score →

The Full Stack Developer interview questions

Below are the real questions, grouped by difficulty. Expand any one to reveal the correct answer and why — or take the timed quiz for a score you can share. Can you clear the Hard round?

Easy round 20 questions

Your API endpoint successfully creates a new user record from a POST request. Which status code best signals this to the client?
  • A. 200 OK
  • B. 201 Created ✓
  • C. 204 No Content
  • D. 302 Found
Correct answer: B. 201 Created is the correct code when a request results in a new resource being created.
What does JavaScript log for `console.log(typeof null)`?
  • A. "null"
  • B. "object" ✓
  • C. "undefined"
  • D. "number"
Correct answer: B. Due to a long-standing quirk, typeof null returns the string "object".
A page served from http://localhost:3000 calls an API at http://localhost:5000 and the browser blocks the response. What is the most likely fix on the server?
  • A. Change the request from GET to POST
  • B. Send an Access-Control-Allow-Origin header ✓
  • C. Increase the request timeout
  • D. Disable HTTPS on the client
Correct answer: B. Cross-origin requests are blocked unless the server responds with an appropriate Access-Control-Allow-Origin header.
You want a query that returns only the rows that have a match in BOTH the orders and customers tables. Which join do you use?
  • A. LEFT JOIN
  • B. INNER JOIN ✓
  • C. FULL OUTER JOIN
  • D. CROSS JOIN
Correct answer: B. INNER JOIN returns only rows with matching keys in both tables.
What does `0 == '0'` evaluate to in JavaScript?
  • A. true ✓
  • B. false
  • C. throws a TypeError
  • D. undefined
Correct answer: A. Loose equality (==) coerces the string '0' to the number 0, so the comparison is true.
You need an endpoint that fully replaces a resource and produces the same server state whether called once or five times. Which method fits best?
  • A. POST
  • B. PUT ✓
  • C. PATCH
  • D. GET
Correct answer: B. PUT is idempotent and replaces the target resource, so repeated identical calls leave the same state.
Given `console.log('A'); setTimeout(() => console.log('B'), 0); console.log('C');`, what is printed?
  • A. A B C
  • B. A C B ✓
  • C. B A C
  • D. C A B
Correct answer: B. setTimeout defers 'B' to a later task, so synchronous 'A' and 'C' print first.
An element is styled by an inline style, an ID selector, and a class selector for the same property. Which one wins?
  • A. The class selector
  • B. The ID selector
  • C. The inline style ✓
  • D. Whichever appears last in the CSS file
Correct answer: C. Inline styles have higher specificity than ID or class selectors.
You add a database index on a column frequently used in WHERE clauses. What is the main trade-off?
  • A. Faster reads but slower writes ✓
  • B. Faster writes but slower reads
  • C. Less disk usage overall
  • D. The database automatically indexes related columns too
Correct answer: A. Indexes speed up lookups but add overhead to inserts and updates that must maintain them.
You set the HttpOnly flag on a session cookie. What does this prevent?
  • A. The cookie being sent over HTTP
  • B. JavaScript from reading the cookie via document.cookie ✓
  • C. The cookie from expiring
  • D. The cookie being sent cross-site
Correct answer: B. HttpOnly stops client-side JavaScript from accessing the cookie, mitigating theft via XSS.
A user closes their browser tab and reopens the page. Which storage is now empty?
  • A. localStorage
  • B. sessionStorage ✓
  • C. IndexedDB
  • D. A cookie with a 1-day expiry
Correct answer: B. sessionStorage is scoped to the tab session and is cleared when the tab is closed.
In a Node.js server, a request handler runs a heavy synchronous for-loop for 3 seconds. What happens to other incoming requests during that time?
  • A. They run in parallel unaffected
  • B. They are queued and blocked until the loop finishes ✓
  • C. They automatically spawn new threads
  • D. They return 500 errors immediately
Correct answer: B. Node's single-threaded event loop is blocked by synchronous work, delaying all other requests.
To defend a login query against SQL injection, what is the correct approach?
  • A. Escape spaces in the input
  • B. Use parameterized/prepared statements ✓
  • C. Convert the query to uppercase
  • D. Limit the password length to 8 characters
Correct answer: B. Parameterized queries separate SQL code from user data, preventing injected input from altering the query.
An unhandled exception is thrown inside your server-side request handler. What status code does the client typically receive?
  • A. 400 Bad Request
  • B. 404 Not Found
  • C. 500 Internal Server Error ✓
  • D. 403 Forbidden
Correct answer: C. An unhandled server-side error results in a 500 Internal Server Error.
A colleague stores JWTs and asks how the server trusts one on each request. What does the server do?
  • A. Looks the token up in a database session table
  • B. Verifies the token's signature using its secret/key ✓
  • C. Decodes the token and trusts whatever is inside
  • D. Sends the token back to the client to re-sign
Correct answer: B. A JWT is validated by verifying its signature against the server's secret or public key, without a DB lookup.
A package is only needed to run tests and lint code, never in production. Where should it go in package.json?
  • A. dependencies
  • B. devDependencies ✓
  • C. peerDependencies
  • D. scripts
Correct answer: B. Tooling used only during development belongs in devDependencies so it is excluded from production installs.
You want to create a new branch named 'feature' and switch to it in one command. Which works?
  • A. git branch feature
  • B. git checkout -b feature ✓
  • C. git switch feature
  • D. git merge feature
Correct answer: B. git checkout -b creates the branch and checks it out in a single step.
An HTML form has no method attribute and is submitted. How is the data sent?
  • A. As a POST request with a JSON body
  • B. As a GET request with data in the URL query string ✓
  • C. As a PUT request
  • D. It is not sent at all
Correct answer: B. The default form method is GET, which appends field data to the URL as query parameters.
You call `.then()` on a Promise. What does that call return?
  • A. The resolved value directly
  • B. A new Promise ✓
  • C. undefined
  • D. The original Promise unchanged
Correct answer: B. then() always returns a new Promise, which is what enables chaining.
Before hashing user passwords you add a unique random 'salt' per user. What problem does the salt primarily solve?
  • A. It makes hashing faster
  • B. It stops identical passwords from producing identical hashes ✓
  • C. It encrypts the password reversibly
  • D. It makes every stored hash the same fixed length
Correct answer: B. A per-user salt ensures equal passwords hash differently, defeating precomputed rainbow-table attacks.

Medium round 30 questions

In a REST API, which HTTP status code is most appropriate to return when a client submits a request to create a resource but omits a required field?
  • A. 200 OK
  • B. 400 Bad Request ✓
  • C. 404 Not Found
  • D. 500 Internal Server Error
Correct answer: B. A missing required field is a client-side input error, so 400 Bad Request is the correct response.
You have a JavaScript array of user objects and need a new array containing only the users where isActive is true. Which method is the idiomatic choice?
  • A. Array.prototype.map()
  • B. Array.prototype.filter() ✓
  • C. Array.prototype.forEach()
  • D. Array.prototype.reduce()
Correct answer: B. filter() returns a new array containing only elements that satisfy the predicate, which matches selecting active users.
In Git, you committed to your local branch but want to combine the last 3 commits into one before pushing. Which command is designed for this?
  • A. git merge --squash HEAD~3
  • B. git rebase -i HEAD~3 ✓
  • C. git reset --hard HEAD~3
  • D. git cherry-pick HEAD~3
Correct answer: B. An interactive rebase (git rebase -i) lets you squash multiple commits into one before pushing.
A SQL query joining orders and customers is slow because it filters on orders.customer_id. What is the most common first optimization?
  • A. Add an index on orders.customer_id ✓
  • B. Replace the INNER JOIN with a LEFT JOIN
  • C. Add DISTINCT to the SELECT clause
  • D. Increase the database connection pool size
Correct answer: A. Indexing the column used in the join/filter condition is the standard first step to speed up such queries.
In React, you get the warning "Each child in a list should have a unique key prop." What is the best value to use for the key?
  • A. The array index of each item
  • B. A stable unique ID from the data (e.g. item.id) ✓
  • C. Math.random() generated per render
  • D. The item's display text
Correct answer: B. A stable unique ID lets React correctly track items across renders, avoiding the reconciliation bugs that index or random keys cause.
Your frontend at https://app.example.com calls an API at https://api.example.com and the browser blocks it with a CORS error. Where must this be fixed?
  • A. In the frontend by disabling the browser's same-origin policy
  • B. On the API server by sending appropriate Access-Control-Allow-Origin headers ✓
  • C. By moving the fetch call into a try/catch block
  • D. By changing the request from GET to POST
Correct answer: B. CORS is enforced by the browser but controlled by the server's response headers, so the API must send the correct Access-Control-Allow-Origin header.
In an Express.js app, which is the correct signature for an error-handling middleware function?
  • A. (req, res) => {}
  • B. (req, res, next) => {}
  • C. (err, req, res, next) => {} ✓
  • D. (next, err, req, res) => {}
Correct answer: C. Express identifies error-handling middleware specifically by its four arguments (err, req, res, next).
You need to store a user's password in the database. What is the correct approach?
  • A. Encrypt it with AES so it can be decrypted at login
  • B. Store it in plain text but restrict database access
  • C. Hash it with a slow algorithm like bcrypt plus a salt ✓
  • D. Base64-encode it before storing
Correct answer: C. Passwords should be one-way hashed with a slow, salted algorithm like bcrypt so they can never be recovered even if the database leaks.
Given `console.log(typeof null)` in JavaScript, what is printed?
  • A. "null"
  • B. "object" ✓
  • C. "undefined"
  • D. "boolean"
Correct answer: B. Due to a long-standing quirk in JavaScript, typeof null returns the string "object".
In an async JavaScript function, you await a fetch call that may reject. What is the standard way to handle the potential failure?
  • A. Wrap the await in a try/catch block ✓
  • B. Add .then() after the await keyword
  • C. Use a for loop to retry until it succeeds
  • D. Check if the returned value is undefined
Correct answer: A. In async/await code, a rejected promise throws, so a try/catch block is the idiomatic way to handle the error.
In JavaScript, what will 'console.log(typeof null)' output?
  • A. "null"
  • B. "object" ✓
  • C. "undefined"
  • D. "boolean"
Correct answer: B. typeof null returns "object", a long-standing quirk in JavaScript.
Which SQL join returns all rows from the left table and matched rows from the right, with NULLs where there is no match?
  • A. INNER JOIN
  • B. LEFT OUTER JOIN ✓
  • C. RIGHT OUTER JOIN
  • D. CROSS JOIN
Correct answer: B. A LEFT OUTER JOIN keeps every left-table row and fills unmatched right-table columns with NULL.
What problem does CORS (Cross-Origin Resource Sharing) primarily address?
  • A. Encrypting data in transit
  • B. Controlling which origins can access a resource via the browser ✓
  • C. Compressing HTTP responses
  • D. Load balancing backend servers
Correct answer: B. CORS is a browser mechanism that lets a server declare which foreign origins may read its responses.
In React, why should you provide a stable 'key' prop when rendering a list?
  • A. To style each list item
  • B. To help React efficiently identify which items changed ✓
  • C. To sort the list automatically
  • D. To prevent XSS attacks
Correct answer: B. Keys give elements stable identity so React's reconciliation can minimize DOM operations.
What is the purpose of a database transaction's ACID 'Isolation' property?
  • A. Ensures committed data survives crashes
  • B. Ensures concurrent transactions don't interfere with each other's intermediate state ✓
  • C. Ensures each transaction is all-or-nothing
  • D. Ensures data stays valid against constraints
Correct answer: B. Isolation guarantees that concurrent transactions appear to execute without seeing each other's uncommitted changes.
In Node.js, which statement about the event loop is correct?
  • A. It runs JavaScript on multiple threads simultaneously
  • B. It enables non-blocking I/O by offloading operations and processing callbacks ✓
  • C. It blocks until each I/O operation completes
  • D. It is only used for CPU-bound tasks
Correct answer: B. The event loop lets a single JS thread handle many operations by deferring I/O and running their callbacks when ready.
What does an HTTP 'Cache-Control: no-store' directive instruct a client to do?
  • A. Cache but revalidate every time
  • B. Never store any part of the response ✓
  • C. Store only for the session
  • D. Store indefinitely
Correct answer: B. no-store forbids caches from storing any version of the request or response.
In CSS, which selector has the highest specificity?
  • A. A class selector .btn
  • B. An element selector div
  • C. An id selector #main ✓
  • D. A universal selector *
Correct answer: C. ID selectors carry higher specificity than class, element, or universal selectors.
What is the main benefit of using a prepared statement in SQL?
  • A. It automatically indexes queries
  • B. It prevents SQL injection by separating code from data ✓
  • C. It compresses query results
  • D. It caches the entire result set
Correct answer: B. Prepared statements bind parameters separately from the query text, preventing injection.
In JavaScript promises, what does 'Promise.all([p1, p2])' resolve to when all inputs resolve?
  • A. The first resolved value
  • B. An array of all resolved values in input order ✓
  • C. The last resolved value
  • D. A single merged object
Correct answer: B. Promise.all resolves to an array of results in the same order as the input promises.
You have a slow query filtering on a non-indexed `email` column in a large users table. What is the most effective fix?
  • A. Add a LIMIT clause
  • B. Create an index on the email column ✓
  • C. Switch SELECT * to SELECT email
  • D. Run VACUUM more often
Correct answer: B. Indexing the filtered column lets the DB avoid a full table scan, dramatically speeding equality lookups.
In React, why can calling `setState` (or a state setter) inside render cause problems?
  • A. It is syntactically illegal
  • B. It triggers an infinite re-render loop ✓
  • C. It bypasses the virtual DOM
  • D. It only updates on the server
Correct answer: B. State updates during render schedule another render, producing an infinite loop.
A JWT is stored in localStorage and your app is hit by an XSS attack. What is the main risk?
  • A. The token cannot be read by scripts
  • B. Malicious scripts can steal the token from localStorage ✓
  • C. The token auto-expires instantly
  • D. CORS blocks the theft
Correct answer: B. localStorage is accessible to any JavaScript, so XSS can exfiltrate the JWT, unlike an HttpOnly cookie.
In a Node.js Express app, why should CPU-heavy synchronous work be avoided in a request handler?
  • A. It uses too much RAM
  • B. It blocks the single-threaded event loop, stalling all requests ✓
  • C. It disables middleware
  • D. It breaks JSON parsing
Correct answer: B. Node's event loop is single-threaded, so blocking synchronous work delays every concurrent request.
What problem does database connection pooling primarily solve in a web backend?
  • A. It encrypts queries
  • B. It reuses connections to avoid costly per-request connection setup ✓
  • C. It caches query results
  • D. It shards tables automatically
Correct answer: B. Pooling reuses a fixed set of open connections, avoiding the overhead of opening one per request.
In an ORM, what is the classic 'N+1 query' problem?
  • A. Running one query that returns too many rows
  • B. Executing one query per related record instead of a single join ✓
  • C. Missing a WHERE clause
  • D. Deadlocking on writes
Correct answer: B. N+1 occurs when fetching a list then lazily querying each item's relation separately instead of eager loading.
Which approach best prevents SQL injection in a parameterized user-search endpoint?
  • A. Escaping quotes manually
  • B. Using prepared statements / bound parameters ✓
  • C. URL-encoding the input
  • D. Lowercasing the input
Correct answer: B. Prepared statements separate SQL code from data so user input can never be executed as SQL.
In CSS, an element has `position: absolute`. Relative to what is it positioned?
  • A. The viewport always
  • B. Its nearest positioned ancestor ✓
  • C. Its direct parent always
  • D. The document body always
Correct answer: B. An absolutely positioned element is offset from its nearest ancestor with a non-static position.
You need to invalidate a cached API response when the underlying data changes. Which HTTP mechanism supports conditional revalidation?
  • A. Content-Length
  • B. ETag with If-None-Match ✓
  • C. Accept-Language
  • D. X-Powered-By
Correct answer: B. ETags let clients revalidate with If-None-Match, receiving 304 when the cached copy is still fresh.
In a microservices setup, why is a message queue often preferred over direct synchronous HTTP calls between services?
  • A. It is always faster
  • B. It decouples services and buffers load, improving resilience ✓
  • C. It removes the need for a database
  • D. It guarantees strong consistency
Correct answer: B. Queues decouple producers and consumers, absorbing spikes and tolerating temporary downstream failures.

Hard round 30 questions

A Node.js HTTP service degrades over hours: heap grows steadily, RSS climbs, and GC pauses lengthen until it OOMs. You take two `--inspect` heap snapshots 10 minutes apart under load and diff them. The 'Comparison' view shows a large positive delta on `(closure)` and `Array` retained by a single `Map` in a module-level variable used for request de-duplication keyed by request id. What is the correct root-cause conclusion and fix?
  • A. The V8 old-space is simply too small; raise `--max-old-space-size` and the leak resolves itself
  • B. Entries are inserted into the Map but never deleted, so it grows unbounded; bound it with a TTL/LRU eviction (or WeakMap keyed by an object) so entries are reclaimable ✓
  • C. GC is failing because closures cannot be collected in V8; rewrite the code to avoid all closures
  • D. The snapshots are misleading because heap snapshots include unreachable objects; ignore them and profile CPU instead
Correct answer: B. A module-scoped Map holding entries that are never evicted is a classic unbounded-cache leak, and bounding it with TTL/LRU (or a WeakMap) restores reclaimability.
You run this in Node.js: ```js setTimeout(() => console.log('A'), 0); setImmediate(() => console.log('B')); Promise.resolve().then(() => console.log('C')); process.nextTick(() => console.log('D')); ``` Assuming this is the top-level script (not inside an I/O callback), which single output ordering is guaranteed?
  • A. A B C D
  • B. D C A B ✓
  • C. D C B A
  • D. C D A B
Correct answer: B. After the sync script, microtasks drain first with nextTick (D) before promises (C), then the timers vs immediate order from the main module is deterministic here with the timer (A) firing before immediate (B).
A read-heavy product page reads from Redis with cache-aside. A popular key expires and thousands of concurrent requests miss simultaneously, all hammering the database and causing a latency spike. Which combination most directly prevents this specific thundering-herd/stampede without serving arbitrarily stale data forever?
  • A. Increase the TTL to 24 hours so the key rarely expires
  • B. Use a per-key mutex/lock (single-flight) so only one request recomputes while others wait, plus early/probabilistic recomputation before expiry ✓
  • C. Switch from cache-aside to write-back caching so writes populate the cache
  • D. Disable Redis eviction and add more read replicas to the database
Correct answer: B. Single-flight locking collapses concurrent misses into one recompute, and probabilistic early recomputation refreshes hot keys before they expire, together eliminating the stampede.
During a cross-region network partition, an e-commerce cart service must never lose items a user already added, yet remain usable (accept new adds) in each region even though regions cannot sync. Which data model choice best satisfies both goals, and what is the accepted trade-off?
  • A. Strong single-leader consistency: reject writes in the non-leader region during the partition to guarantee correctness
  • B. Model the cart as a state-based CRDT (e.g., OR-Set) so both regions accept writes and merge conflict-free on heal, accepting temporary divergence ✓
  • C. Use a distributed lock per cart across regions so only one region can mutate it at a time
  • D. Store the cart only client-side until the partition heals, then upload
Correct answer: B. An OR-Set CRDT lets both regions accept adds during the partition and merge without losing items on heal, trading away immediate cross-region consistency (temporary divergence) for availability and no-loss.
A mobile client that updates slowly hits your GraphQL API. You must rename the field `User.fullName` to `User.displayName` and change its formatting, without breaking old app versions still requesting `fullName`. What is the safest evolution strategy?
  • A. Bump the schema to v2 at a new endpoint `/graphql/v2` and force clients to migrate immediately
  • B. Add `displayName` as a new field, keep `fullName` resolving the old value, mark `fullName` with `@deprecated(reason: ...)`, and remove it only after telemetry shows old clients are gone ✓
  • C. Change `fullName`'s resolver to return the new format, since GraphQL fields are not version-locked
  • D. Make `fullName` non-nullable and add `displayName`, so clients are forced to adopt the new field
Correct answer: B. GraphQL evolves additively: add the new field, keep the old one working, deprecate it, and remove only after telemetry confirms no clients depend on it.
This React component re-renders and the expensive child re-renders on every keystroke even though its props look stable: ```jsx function Parent(){ const [q,setQ]=useState(''); const onSelect = () => doThing(); return <><input value={q} onChange={e=>setQ(e.target.value)} /> <ExpensiveChild onSelect={onSelect} /></>; } const ExpensiveChild = React.memo(function C({onSelect}){ /*...*/ }); ``` Why does `React.memo` fail to prevent the child's re-render, and what is the correct fix?
  • A. `React.memo` only works on class components; convert ExpensiveChild to a class
  • B. `onSelect` is a new function identity on every Parent render, breaking memo's shallow prop equality; wrap it in `useCallback` with a stable dependency list ✓
  • C. State updates always bypass memoization; move `q` into a ref instead of state
  • D. memo needs a custom comparator for all props; the default never compares functions
Correct answer: B. A fresh `onSelect` closure is created each render so memo's shallow compare sees a changed prop; `useCallback` stabilizes its identity.
An event-driven pipeline uses at-least-once delivery from a queue: a consumer charges a payment then publishes a 'charged' event. On redelivery (e.g., after a consumer crash before ack), you must avoid double-charging. Which design gives you effective exactly-once *processing* semantics?
  • A. Switch the broker to exactly-once delivery mode, which guarantees the handler runs once
  • B. Make the charge operation idempotent using a unique idempotency key persisted transactionally (dedup table) so redeliveries are no-ops ✓
  • C. Acknowledge the message before processing so it is never redelivered
  • D. Increase the visibility timeout so the message is never redelivered during processing
Correct answer: B. At-least-once delivery is unavoidable across crashes, so idempotency via a transactionally-persisted idempotency key makes redeliveries safe no-ops, yielding effective exactly-once processing.
A Postgres query `SELECT * FROM orders WHERE customer_id = $1 AND status = 'shipped' ORDER BY created_at DESC LIMIT 20;` is slow. `EXPLAIN ANALYZE` shows a Seq Scan + Sort. Which index best serves this query, letting Postgres avoid the sort and satisfy the filter efficiently?
  • A. `CREATE INDEX ON orders (created_at);`
  • B. `CREATE INDEX ON orders (customer_id, status, created_at DESC);` ✓
  • C. `CREATE INDEX ON orders (status);` plus `CREATE INDEX ON orders (customer_id);`
  • D. `CREATE INDEX ON orders (created_at, status, customer_id);`
Correct answer: B. A composite index with the equality columns first (customer_id, status) then created_at DESC matches the filter and provides pre-sorted rows so Postgres can skip the sort and stop at LIMIT.
You are decomposing a monolith and split 'Orders' and 'Inventory' into separate services with their own databases. A place-order operation must reserve inventory and create an order atomically, but you can no longer use a single ACID transaction across both DBs. Which pattern correctly handles this with well-defined failure semantics?
  • A. Two-phase commit (2PC) coordinated by the API gateway across both service databases
  • B. A saga: a sequence of local transactions with compensating actions (e.g., release reservation) triggered when a later step fails ✓
  • C. Wrap both service calls in a distributed database transaction using `SERIALIZABLE` isolation
  • D. Have Orders synchronously call Inventory and roll back Orders' DB if Inventory throws
Correct answer: B. Across independent service databases you use a saga of local transactions with compensating actions, which provides eventual consistency and defined rollback semantics without a cross-service ACID transaction.
You must build a JWT-based auth system where access tokens are stateless but you also need the ability to revoke a compromised session before its expiry. What is the standard architecture that preserves statelessness for the common path while enabling revocation?
  • A. Make access tokens long-lived and delete them from the client on logout
  • B. Use short-lived access tokens (stateless, checked by signature) plus long-lived refresh tokens tracked server-side, so revoking the refresh token/session stops renewal ✓
  • C. Store every access token in the database and query it on each request
  • D. Encrypt the JWT payload so it cannot be reused after logout
Correct answer: B. Short-lived stateless access tokens keep the hot path stateless, while server-side-tracked refresh tokens provide a revocation point that cuts off renewal for a compromised session.
In JavaScript, what does the following log: 'for (var i=0;i<3;i++){setTimeout(()=>console.log(i),0)}'?
  • A. 0 1 2
  • B. 3 3 3 ✓
  • C. 0 0 0
  • D. undefined three times
Correct answer: B. var is function-scoped, so all callbacks share one i whose value is 3 after the loop ends.
By the SQL standard, which isolation level prevents non-repeatable reads but still permits phantom reads?
  • A. Serializable
  • B. Repeatable Read ✓
  • C. Read Committed
  • D. Read Uncommitted
Correct answer: B. By the SQL standard, Repeatable Read prevents non-repeatable reads but still permits phantom reads.
In a Node.js cluster with multiple workers, why can in-memory session storage cause bugs?
  • A. It doubles memory usage globally
  • B. A user's requests may hit a different worker that lacks their session ✓
  • C. It corrupts the event loop
  • D. It forces synchronous I/O
Correct answer: B. Each worker has separate memory, so a session stored on one worker is missing when a request is routed to another.
What is the N+1 query problem in ORMs?
  • A. Running one query that returns N+1 rows
  • B. Executing one query for a list then one additional query per item to load a relation ✓
  • C. A query that fails after N retries plus one
  • D. Indexing N+1 columns unnecessarily
Correct answer: B. The N+1 problem is issuing one query for the parent list then N extra queries to lazily load each item's relation.
When implementing optimistic concurrency control, which mechanism detects a conflicting concurrent update?
  • A. Row-level exclusive locks held for the transaction
  • B. A version or timestamp column compared during the UPDATE ✓
  • C. A global mutex across the table
  • D. Serializable isolation only
Correct answer: B. Optimistic concurrency compares a version/timestamp column at write time and rejects the update if it changed.
In HTTP/2, which feature primarily eliminates the application-layer head-of-line blocking of HTTP/1.1 pipelining?
  • A. Server push
  • B. Header compression with HPACK
  • C. Multiplexing multiple streams over one connection ✓
  • D. Binary framing of cookies
Correct answer: C. HTTP/2 multiplexes independent streams over a single connection so one slow response no longer blocks others.
Why can OFFSET-based pagination degrade badly on large offsets?
  • A. OFFSET forces a full table lock
  • B. The database must scan and discard all rows before the offset ✓
  • C. OFFSET disables indexes entirely
  • D. It returns duplicate rows
Correct answer: B. OFFSET N still reads and skips N rows, so deep pages get progressively slower; keyset pagination avoids this.
In React, what bug arises from a useEffect that reads state but has an empty dependency array?
  • A. The effect runs on every render
  • B. The effect captures the initial state value and never sees updates ✓
  • C. The component never mounts
  • D. State updates throw an error
Correct answer: B. An empty dependency array captures the state from the first render, so the effect keeps using the stale value.
In JavaScript, what is the result of '0.1 + 0.2 === 0.3'?
  • A. true
  • B. false ✓
  • C. throws a RangeError
  • D. NaN
Correct answer: B. IEEE-754 floating point cannot represent 0.1 and 0.2 exactly, so the sum is slightly off and the comparison is false.
In a microservices setup, what is the main trade-off introduced by the Saga pattern for distributed transactions?
  • A. It requires a two-phase commit coordinator
  • B. It replaces atomicity with eventual consistency via compensating actions ✓
  • C. It forces all services to share one database
  • D. It eliminates the need for retries
Correct answer: B. Sagas break a distributed transaction into local steps with compensations, trading strict atomicity for eventual consistency.
At the READ COMMITTED isolation level, which anomaly is still possible?
  • A. Dirty reads
  • B. Non-repeatable reads ✓
  • C. Nothing, it is fully serializable
  • D. Lost updates are impossible
Correct answer: B. READ COMMITTED prevents dirty reads but still allows non-repeatable reads (and phantoms).
In the CAP theorem, a network partition occurs. A system that keeps accepting writes on both sides is prioritizing which properties?
  • A. Consistency and Partition tolerance
  • B. Availability and Partition tolerance ✓
  • C. Consistency and Availability
  • D. Only Consistency
Correct answer: B. Serving writes on both partitions sacrifices consistency, choosing Availability and Partition tolerance (AP).
Your React app re-renders an expensive child even though its props are unchanged objects created inline. What is the correct combined fix?
  • A. Wrap child in React.memo only
  • B. Memoize props with useMemo/useCallback AND wrap child in React.memo ✓
  • C. Use useEffect on the child
  • D. Move the child to a portal
Correct answer: B. React.memo only helps if referentially stable props are passed, so inline objects must be memoized too.
Two concurrent transactions read a counter, increment it, and write it back, losing one update. Which technique avoids this without long locks?
  • A. SELECT with no locking
  • B. Optimistic concurrency with a version column ✓
  • C. Increasing connection pool size
  • D. Using READ UNCOMMITTED
Correct answer: B. A version column lets the write fail if the row changed since read, catching the lost-update conflict.
In HTTP/2, what feature primarily eliminates the head-of-line blocking that HTTP/1.1 had at the application layer?
  • A. Larger headers
  • B. Stream multiplexing over a single connection ✓
  • C. Mandatory TLS
  • D. Chunked transfer encoding
Correct answer: B. HTTP/2 multiplexes independent streams on one connection so one slow response doesn't block others (though TCP-level HOL remains).
You must serve a stale-tolerant, personalized dashboard fast. Which caching strategy fits best?
  • A. Public CDN caching keyed by URL only
  • B. Per-user cache with stale-while-revalidate ✓
  • C. No-store on everything
  • D. Caching by IP address
Correct answer: B. Per-user keys keep personalization correct while stale-while-revalidate serves fast and refreshes in background.
A Node.js event loop shows growing 'lag'. Which is the LEAST likely root cause?
  • A. A large synchronous JSON.parse
  • B. A tight synchronous loop
  • C. Awaiting a fast async DB call ✓
  • D. Heavy synchronous crypto hashing
Correct answer: C. Awaited async I/O yields to the loop, so it doesn't cause lag; synchronous CPU work does.
In a distributed system, you need idempotent payment processing over an at-least-once delivery queue. What is the standard mechanism?
  • A. Retry with exponential backoff only
  • B. An idempotency key stored to dedupe repeated requests ✓
  • C. Increasing message TTL
  • D. Disabling retries
Correct answer: B. Persisting an idempotency key lets the server detect and ignore duplicate deliveries of the same operation.
When would a database composite index on (a, b) NOT be usable for a query?
  • A. Query filters on a only
  • B. Query filters on b only ✓
  • C. Query filters on a and b
  • D. Query orders by a then b
Correct answer: B. A composite index follows a left-most prefix rule, so filtering on b alone cannot use it efficiently.
You deploy a new API version but must keep old mobile clients working. Which strategy avoids breaking them while evolving the schema?
  • A. Rename fields in place
  • B. Additive, backward-compatible changes with versioned endpoints ✓
  • C. Delete deprecated fields immediately
  • D. Change field types silently
Correct answer: B. Additive changes and explicit versioning let old clients keep working while new ones adopt new fields.

Prep for another role

Questions are original, written and independently verified for HireHire's role interview quizzes. They reflect the kind of knowledge Full Stack Developer interviews test, not any specific company's questions. HireHire maps live tech & IT jobs across India, updated regularly. Last updated: August 2026.