FreeExam

Web applications

A full stack engineer interview on carrying a web feature from the browser through the server to the database and finding which layer failed.

These prompts are original practice. They are not questions from a named employer or a live hiring loop.

  1. 1.Which HTTP method is defined as idempotent but not safe?

  2. 2.A bike-share app sends POST /rentals when a rider unlocks a bike. On a flaky cell connection the client times out and retries, and some riders get billed for two rentals. What is the best fix?

  3. 3.A clinic scheduler API receives a request whose access token expired an hour ago. Which status code fits best?

  4. 4.A grain co-op API needs an endpoint that lists the deliveries made by one member. Which design follows common REST conventions?

  5. 5.A JSON API for ferry ticketing creates a new booking from a POST. What response is most conventional on success?

  6. 6.A tenant maintenance portal sends PUT /tenants/7 with only a new phone number in the body. Afterward the tenant's email is null. What is the most likely explanation?

  7. 7.What does the Content-Type header on an HTTP request tell the server?

  8. 8.Which statement about 4xx and 5xx status codes is correct?

  9. 9.A recipe site had a Delete link on its admin page that sent GET /recipes/88/delete. A link-prefetching browser extension wiped out many recipes. What is the root problem?

  10. 10.A user submits a form on a county library site for the first time. Which order best describes the request's path?

  11. 11.After a deploy, a payroll service's load balancer returns 502 Bad Gateway on every request, and the app logs show no new entries at all. What is the most likely cause?

  12. 12.A grant report export in a nonprofit's admin tool fails with 504 Gateway Timeout after 60 seconds. The app logs show the same request finishing successfully at 75 seconds. What should you do?

  13. 13.The front end of a plant nursery shop shows 'Unexpected token < in JSON at position 0' when loading the cart. What is the most likely cause?

  14. 14.On a gym class booking app, the network tab shows the PATCH to update a booking returns 200 with the new time, but the screen still shows the old time. Where should you look first?

  15. 15.You need to trace one failed checkout for a coffee roaster's subscription service across the proxy, the app, and a background worker. What helps most?

  16. 16.Under load, a parking permit portal's requests hang and then fail. Database CPU is low, and the app logs say 'timed out waiting for a connection from the pool'. What is the most likely cause?

  17. 17.A single user of a music lesson scheduler reports that the Save button does nothing. Other users are fine. What do you do first?

  18. 18.Photo uploads to a print shop work on a developer's laptop but fail in production with 413 Payload Too Large. The app sets a 50 MB limit. What is the most likely cause?

  19. 19.A school lunch ordering page shows a spinner forever. The network tab shows the API request still pending after two minutes, with no status code. Which layer should you suspect first?

  20. 20.A hiking permit form checks the group size in the browser and blocks values over 12. Why must the server check it again?

  21. 21.What is the main benefit of client-side form validation?

  22. 22.Customers of a dog grooming booking site are sometimes charged twice after double-clicking Pay. What is the most robust fix?

  23. 23.After submitting a bakery preorder form, customers who refresh the confirmation page get a prompt to resubmit, and some create duplicate orders. Which pattern fixes this?

  24. 24.A wedding RSVP API returns 422 with a list of errors keyed by field name. How should the form handle this response?

  25. 25.A language exchange site checks whether a username is free with an API call, then submits the signup. Two people still ended up with the same username. What is the right fix?

  26. 26.A newsletter platform has subscribers '[email protected] ' and '[email protected]' as separate rows, despite a unique index on email. What should change?

  27. 27.A volunteer enters the name '<script>alert(1)</script>' on a food bank portal, and the script runs when staff view the volunteer list. What is the right fix?

  28. 28.What does the HttpOnly attribute on a session cookie do?

  29. 29.A museum membership site uses cookie sessions. How does setting SameSite=Lax on the session cookie help?

  30. 30.During a security review of a tutoring marketplace, you notice the session id stays the same before and after login. Why is that a problem?

  31. 31.A timesheet tool issues stateless JSON Web Tokens (JWTs) valid for 7 days. A manager disables a fired employee's account, but the employee can still use the API. Why?

  32. 32.A team wants to store the access token for its moving company quote app in localStorage. What is the main risk?

  33. 33.Why do single-page and mobile apps add PKCE (Proof Key for Code Exchange) to the OAuth authorization code flow?

  34. 34.How should a dental office's patient portal store user passwords?

  35. 35.A city council agenda site logs users in at auth.agendas.example and sets a session cookie with no Domain attribute. The editor at edit.agendas.example never sees the cookie. Why?

  36. 36.On an insurance claims portal, a logged-in customer changes /claims/1001 in the URL to /claims/1002 and sees another customer's claim. What is the fix?

  37. 37.A theater box office login form is being hit with thousands of password guesses per minute across many accounts. What is a sensible first defense?

  38. 38.What does CORS (cross-origin resource sharing) control?

  39. 39.A kayak rental's booking API works from curl and from a server script, but the React front end on a different origin gets a CORS error. What is the most likely cause?

  40. 40.A survey tool's front end sends a JSON POST to its API on another origin. The browser first sends OPTIONS, which returns 405, and the POST is never sent. What should you fix?

  41. 41.A chess club ratings site calls its API with fetch and credentials: 'include'. The API replies with Access-Control-Allow-Origin: *. The browser blocks the response. Why?

  42. 42.Which pair of URLs has the same origin?

  43. 43.To get past CORS errors quickly, a developer on a home inspection reports app makes the API echo back any Origin header and allow credentials. Why is this dangerous?

  44. 44.A vet clinic's single-page app and its API are run by the same team on different hosts. Which change removes the need for CORS?

  45. 45.What does Cache-Control: no-cache on a response mean?

  46. 46.After a deploy of a farm share box site, some users get a broken page: the new HTML loads, but app.js is the old version, cached for a week. What is the standard fix?

  47. 47.A flower delivery site put its account page behind a content delivery network (CDN). Users began seeing other people's names in the header. What is the most likely cause?

  48. 48.A browser holds a cached copy of a translation agency's rate sheet with an ETag. What happens when it revalidates and nothing has changed?

  49. 49.A hardware store caches product prices in Redis with a 10-minute time to live. When staff change a price, the site shows the old one for up to 10 minutes. What is the best fix?

  50. 50.A youth soccer league's schedule is cached for 5 minutes. Each time the entry expires, hundreds of requests miss at once and the database spikes. What helps most?

  51. 51.A tax prep site picks its page language from Accept-Language. After adding a content delivery network, some English speakers get Spanish pages. Which fix keeps the pages cacheable?

  52. 52.What does stale-while-revalidate=60 in a Cache-Control header allow?

  53. 53.Which response from a campground reservation site is the best candidate for caching at a shared content delivery network?

  54. 54.On an apartment listings site, users want to share a link to a search with filters applied and page 3 selected. Where should that state live?

  55. 55.A recycling pickup app marks a pickup as done in the UI before the server responds. The request then fails. What should the client do?

  56. 56.Two admins of a bowling league site edit the same team in different tabs. The second save silently overwrites the first admin's changes. What is a standard fix?

  57. 57.A conference talk search sends a request on each keystroke. Sometimes the results shown match an earlier, shorter query. What is the cause and fix?

  58. 58.A ski rental's checkout sends the cart total computed in the browser, and the server charges that amount. What is wrong with this design?

  59. 59.A coworking desk booking app caches API data on the client. After a user cancels a booking, the list still shows it until a manual reload. What is the usual fix?

  60. 60.Members of a makerspace check out tools through a web app. Where should the source of truth for which tools are available live?

  61. 61.What is a key benefit of server-side rendering for the public results page of a county election office?

  62. 62.A choir's sheet music library has pages that change only when an editor publishes new music, a few times a month. Which rendering approach fits best?

  63. 63.A React app for a laundromat shows hydration warnings, and the pickup time briefly flips to a different value. The server formats times in UTC. What is the likely cause?

  64. 64.What is a common drawback of rendering a public marketing page entirely on the client?

  65. 65.An art supply store's product pages get heavy traffic. Prices change a few times a day. Which approach balances speed and freshness?

  66. 66.Which rendering approach is a poor fit for a bus pass account dashboard that shows each rider's balance?

  67. 67.A developer on a pet adoption site reads a private API key inside a component, and the key now shows up in the browser's JavaScript bundle. What is the right fix?

  68. 68.You need to rename a column from fullname to display_name in a payroll database with no downtime during a rolling deploy. Which plan is safest?

  69. 69.A migration that adds an index to a large orders table blocks writes for 20 minutes during a deploy of a concert ticketing site. What would have avoided this?

  70. 70.A release for a blood drive signup site drops a column that the previous app version still reads. During the rolling deploy, errors spike. What is the right practice?

  71. 71.Why keep database migrations in the same repository as the app code?

  72. 72.In a bridal shop's order system, deleting a customer left order rows pointing to a customer id that no longer exists. What prevents this?

  73. 73.A clinic scheduler often runs: WHERE clinic_id = ? AND starts_at BETWEEN ? AND ? ORDER BY starts_at. Which index serves it best?

  74. 74.How should a municipal water billing app store amounts like 42.17 dollars?

  75. 75.A dental office stores appointment times as local time with no zone. After the clocks change for daylight saving, some reminders go out an hour off. What is the better design?

  76. 76.A deploy of a bike-share app ran a schema migration, then the new code had a bug and was rolled back. What practice makes this rollback safe?

  77. 77.A farmers market vendor page lists 50 vendors and their stall names. The logs show 51 SQL queries per page load. What is happening, and how do you fix it?

  78. 78.A GraphQL API for a used bookstore resolves each book's author separately, causing hundreds of queries per request. What is the standard fix?

  79. 79.A recipe site's listing uses LIMIT 20 OFFSET n. Page 1 is fast, but page 5,000 takes seconds. Why?

  80. 80.People scrolling a newest-first activity feed in a community garden app see the same post twice when new posts arrive. The feed uses offset pagination. What fixes this?

  81. 81.A keyset-paginated list of payments sorts by created_at and fetches the next page with WHERE created_at < last_seen. Some payments never appear. Why?

  82. 82.An admin list for a seed catalog shows 'Page 1 of 48,213'. The COUNT(*) behind it takes longer than the page query itself. What is a reasonable change?

  83. 83.A GET /members endpoint for a rowing club returns all 200,000 members when no page size is given. What should the endpoint do?

  84. 84.How can a team catch N+1 queries before they reach production?

  85. 85.A vet clinic list page loads 30 patient records, and each row includes a large scanned-document column the page never shows. What is the simplest improvement?

  86. 86.A real estate photo site lets agents upload 200 MB videos through the app server, which ties up its workers. What is a common better design?

  87. 87.A job board accepts resume uploads. How should it check that a file is really a PDF?

  88. 88.A community forum serves user-uploaded files from its main domain. Someone uploads an HTML file with a script that steals session data when opened. What is the right mitigation?

  89. 89.An upload handler for a translation agency saves files under the client-supplied filename. A file named '../../config/app.env' overwrote a config file. What is the fix?

  90. 90.A pet adoption site creates three thumbnail sizes inside the upload request, and large photos often time out. What is the better approach?

  91. 91.A rental listing form uploads photos as soon as they are picked, before the listing is saved. Storage costs keep rising. What is the likely cause?

  92. 92.A plain HTML form on a makerspace site posts a file input, but the server receives only the file's name. What is missing?

  93. 93.A survey tool sends a confirmation email inside the signup request, and the mail provider sometimes takes 8 seconds. What is the usual fix?

  94. 94.After a worker crashed and restarted, some parents in a youth soccer league got the same reminder email twice. The queue delivers at least once. What should the job do?

  95. 95.A coffee roaster's app enqueues a send-receipt job inside a database transaction. Sometimes the worker cannot find the order. Why?

  96. 96.A ferry ticketing job that calls a partner API fails now and then. One bad record makes its job fail every time. How should retries be set up?

  97. 97.A school district's report card export takes several minutes. How should the API respond to the request that starts it?

  98. 98.A nightly billing task for a municipal water app runs inside the web process. After scaling to three replicas, customers were billed three times. What is the fix?

  99. 99.A job for a moving company enqueues the full quote object. When the worker runs an hour later, it emails a price the customer already changed. What is a better practice?

  100. 100.The job queue for a print shop's order pipeline keeps growing all afternoon. What do you check first?

  101. 101.What do feature flags let a team do when shipping a new checkout flow?

  102. 102.A release adds a new endpoint and a front end that calls it. The front end deployed first, and users got 404s for ten minutes. What ordering avoids this?

  103. 103.What is the purpose of a canary release?

  104. 104.Right after a deploy, checkout errors on a ski rental site jump from 0.1 percent to 6 percent. What do you do first?

  105. 105.During a rolling deploy, new app instances get traffic before they can reach the database, and those requests fail. What should be fixed?

  106. 106.A change works in staging but crashes in production on the first request because an environment variable is missing. What practice catches this earlier?

  107. 107.A new mobile app version stops reading a field in an API response. When can the API safely stop sending that field?

  108. 108.A team ships a migration together with code. Which order is safest for an additive change, like a new nullable column that the new code writes to?

' on a food bank portal, and the script runs when staff view the volunteer list. What is the right fix?","acceptedAnswer":{"@type":"Answer","text":"Escape user content for the context where it is rendered, such as HTML"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"What does the HttpOnly attribute on a session cookie do?","acceptedAnswer":{"@type":"Answer","text":"It stops page JavaScript from reading the cookie"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A museum membership site uses cookie sessions. How does setting SameSite=Lax on the session cookie help?","acceptedAnswer":{"@type":"Answer","text":"The browser omits it on cross-site POSTs, which blocks most cross-site request forgery"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"During a security review of a tutoring marketplace, you notice the session id stays the same before and after login. Why is that a problem?","acceptedAnswer":{"@type":"Answer","text":"An attacker who planted a known session id can use it once the victim logs in"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A timesheet tool issues stateless JSON Web Tokens (JWTs) valid for 7 days. A manager disables a fired employee's account, but the employee can still use the API. Why?","acceptedAnswer":{"@type":"Answer","text":"The server trusts any validly signed token until it expires"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A team wants to store the access token for its moving company quote app in localStorage. What is the main risk?","acceptedAnswer":{"@type":"Answer","text":"Any script that runs on the page, including injected code, can read and send it"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"Why do single-page and mobile apps add PKCE (Proof Key for Code Exchange) to the OAuth authorization code flow?","acceptedAnswer":{"@type":"Answer","text":"So an intercepted authorization code is useless without a secret only the app holds"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"How should a dental office's patient portal store user passwords?","acceptedAnswer":{"@type":"Answer","text":"As a slow, salted hash from a password hashing function such as bcrypt or Argon2"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A city council agenda site logs users in at auth.agendas.example and sets a session cookie with no Domain attribute. The editor at edit.agendas.example never sees the cookie. Why?","acceptedAnswer":{"@type":"Answer","text":"A cookie without a Domain attribute is sent only to the exact host that set it"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"On an insurance claims portal, a logged-in customer changes /claims/1001 in the URL to /claims/1002 and sees another customer's claim. What is the fix?","acceptedAnswer":{"@type":"Answer","text":"Check on every request that the claim belongs to the logged-in customer"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A theater box office login form is being hit with thousands of password guesses per minute across many accounts. What is a sensible first defense?","acceptedAnswer":{"@type":"Answer","text":"Rate limit login attempts by account and by source, with growing delays"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"What does CORS (cross-origin resource sharing) control?","acceptedAnswer":{"@type":"Answer","text":"Whether a browser lets a page read a response from a different origin"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A kayak rental's booking API works from curl and from a server script, but the React front end on a different origin gets a CORS error. What is the most likely cause?","acceptedAnswer":{"@type":"Answer","text":"The API does not send an Access-Control-Allow-Origin header for that origin"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A survey tool's front end sends a JSON POST to its API on another origin. The browser first sends OPTIONS, which returns 405, and the POST is never sent. What should you fix?","acceptedAnswer":{"@type":"Answer","text":"Have the API answer the OPTIONS preflight with the right CORS headers"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A chess club ratings site calls its API with fetch and credentials: 'include'. The API replies with Access-Control-Allow-Origin: *. The browser blocks the response. Why?","acceptedAnswer":{"@type":"Answer","text":"Credentialed requests need an exact origin, not a wildcard, plus Allow-Credentials"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"Which pair of URLs has the same origin?","acceptedAnswer":{"@type":"Answer","text":"https://shop.example.com/a and https://shop.example.com:443/b"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"To get past CORS errors quickly, a developer on a home inspection reports app makes the API echo back any Origin header and allow credentials. Why is this dangerous?","acceptedAnswer":{"@type":"Answer","text":"Any website a logged-in user visits can read that user's data from the API"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A vet clinic's single-page app and its API are run by the same team on different hosts. Which change removes the need for CORS?","acceptedAnswer":{"@type":"Answer","text":"Serve the API from the same origin, for example under /api via a reverse proxy"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"What does Cache-Control: no-cache on a response mean?","acceptedAnswer":{"@type":"Answer","text":"Caches may store it but must revalidate with the server before reusing it"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"After a deploy of a farm share box site, some users get a broken page: the new HTML loads, but app.js is the old version, cached for a week. What is the standard fix?","acceptedAnswer":{"@type":"Answer","text":"Put a content hash in asset filenames; keep HTML on a short cache"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A flower delivery site put its account page behind a content delivery network (CDN). Users began seeing other people's names in the header. What is the most likely cause?","acceptedAnswer":{"@type":"Answer","text":"The CDN cached a personalized response and served it to other users"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A browser holds a cached copy of a translation agency's rate sheet with an ETag. What happens when it revalidates and nothing has changed?","acceptedAnswer":{"@type":"Answer","text":"It sends If-None-Match and gets 304 Not Modified, no body"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A hardware store caches product prices in Redis with a 10-minute time to live. When staff change a price, the site shows the old one for up to 10 minutes. What is the best fix?","acceptedAnswer":{"@type":"Answer","text":"Delete or update the cache entry in the same code path that writes the price"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A youth soccer league's schedule is cached for 5 minutes. Each time the entry expires, hundreds of requests miss at once and the database spikes. What helps most?","acceptedAnswer":{"@type":"Answer","text":"Let one request rebuild the entry while others wait or get the stale value"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A tax prep site picks its page language from Accept-Language. After adding a content delivery network, some English speakers get Spanish pages. Which fix keeps the pages cacheable?","acceptedAnswer":{"@type":"Answer","text":"Send Vary: Accept-Language or put the language in the URL"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"What does stale-while-revalidate=60 in a Cache-Control header allow?","acceptedAnswer":{"@type":"Answer","text":"Serving a stale copy for up to 60 seconds while a refresh runs in the background"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"Which response from a campground reservation site is the best candidate for caching at a shared content delivery network?","acceptedAnswer":{"@type":"Answer","text":"The public list of campgrounds and their amenities"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"On an apartment listings site, users want to share a link to a search with filters applied and page 3 selected. Where should that state live?","acceptedAnswer":{"@type":"Answer","text":"In the URL query string"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A recycling pickup app marks a pickup as done in the UI before the server responds. The request then fails. What should the client do?","acceptedAnswer":{"@type":"Answer","text":"Roll the item back to its earlier state and tell the user it did not save"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"Two admins of a bowling league site edit the same team in different tabs. The second save silently overwrites the first admin's changes. What is a standard fix?","acceptedAnswer":{"@type":"Answer","text":"Send the version or ETag read with the form, and reject the save if it changed"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A conference talk search sends a request on each keystroke. Sometimes the results shown match an earlier, shorter query. What is the cause and fix?","acceptedAnswer":{"@type":"Answer","text":"An older response arrived last; cancel or ignore responses for outdated queries"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A ski rental's checkout sends the cart total computed in the browser, and the server charges that amount. What is wrong with this design?","acceptedAnswer":{"@type":"Answer","text":"A user can change the total; the server must recompute it from its own prices"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A coworking desk booking app caches API data on the client. After a user cancels a booking, the list still shows it until a manual reload. What is the usual fix?","acceptedAnswer":{"@type":"Answer","text":"Invalidate or update the cached bookings query after the cancel succeeds"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"Members of a makerspace check out tools through a web app. Where should the source of truth for which tools are available live?","acceptedAnswer":{"@type":"Answer","text":"In the server database; the client's copy may be stale"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"What is a key benefit of server-side rendering for the public results page of a county election office?","acceptedAnswer":{"@type":"Answer","text":"The first response already contains the content, helping slow devices and crawlers"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A choir's sheet music library has pages that change only when an editor publishes new music, a few times a month. Which rendering approach fits best?","acceptedAnswer":{"@type":"Answer","text":"Static generation at publish time, served from a CDN"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A React app for a laundromat shows hydration warnings, and the pickup time briefly flips to a different value. The server formats times in UTC. What is the likely cause?","acceptedAnswer":{"@type":"Answer","text":"The browser formats the same time in local time, so the HTML does not match"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"What is a common drawback of rendering a public marketing page entirely on the client?","acceptedAnswer":{"@type":"Answer","text":"Users see an empty shell until the JavaScript bundle loads and runs"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"An art supply store's product pages get heavy traffic. Prices change a few times a day. Which approach balances speed and freshness?","acceptedAnswer":{"@type":"Answer","text":"Server render and cache each page for a few minutes"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"Which rendering approach is a poor fit for a bus pass account dashboard that shows each rider's balance?","acceptedAnswer":{"@type":"Answer","text":"Static generation of the full page at build time"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A developer on a pet adoption site reads a private API key inside a component, and the key now shows up in the browser's JavaScript bundle. What is the right fix?","acceptedAnswer":{"@type":"Answer","text":"Make the call from server code and keep the key out of client code"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"You need to rename a column from fullname to display_name in a payroll database with no downtime during a rolling deploy. Which plan is safest?","acceptedAnswer":{"@type":"Answer","text":"Add the new column, write both, backfill, switch reads, then drop the old one later"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A migration that adds an index to a large orders table blocks writes for 20 minutes during a deploy of a concert ticketing site. What would have avoided this?","acceptedAnswer":{"@type":"Answer","text":"Building it without blocking writes, as with Postgres CREATE INDEX CONCURRENTLY"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A release for a blood drive signup site drops a column that the previous app version still reads. During the rolling deploy, errors spike. What is the right practice?","acceptedAnswer":{"@type":"Answer","text":"Stop using the column in one release, then drop it in a later release"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"Why keep database migrations in the same repository as the app code?","acceptedAnswer":{"@type":"Answer","text":"Each code version ships with the exact schema changes it expects, in order"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"In a bridal shop's order system, deleting a customer left order rows pointing to a customer id that no longer exists. What prevents this?","acceptedAnswer":{"@type":"Answer","text":"A foreign key from orders to customers with a chosen ON DELETE rule"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A clinic scheduler often runs: WHERE clinic_id = ? AND starts_at BETWEEN ? AND ? ORDER BY starts_at. Which index serves it best?","acceptedAnswer":{"@type":"Answer","text":"A composite index on (clinic_id, starts_at)"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"How should a municipal water billing app store amounts like 42.17 dollars?","acceptedAnswer":{"@type":"Answer","text":"As an integer count of cents or an exact decimal type"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A dental office stores appointment times as local time with no zone. After the clocks change for daylight saving, some reminders go out an hour off. What is the better design?","acceptedAnswer":{"@type":"Answer","text":"Store instants in UTC, plus the office's time zone name for display"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A deploy of a bike-share app ran a schema migration, then the new code had a bug and was rolled back. What practice makes this rollback safe?","acceptedAnswer":{"@type":"Answer","text":"Keep each migration backward compatible so the old code still works on the new schema"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A farmers market vendor page lists 50 vendors and their stall names. The logs show 51 SQL queries per page load. What is happening, and how do you fix it?","acceptedAnswer":{"@type":"Answer","text":"One query per vendor's stall; load all stalls in one join or IN query"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A GraphQL API for a used bookstore resolves each book's author separately, causing hundreds of queries per request. What is the standard fix?","acceptedAnswer":{"@type":"Answer","text":"Batch author lookups per request with a loader that queries once for all ids"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A recipe site's listing uses LIMIT 20 OFFSET n. Page 1 is fast, but page 5,000 takes seconds. Why?","acceptedAnswer":{"@type":"Answer","text":"The database still reads and skips every row before the offset"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"People scrolling a newest-first activity feed in a community garden app see the same post twice when new posts arrive. The feed uses offset pagination. What fixes this?","acceptedAnswer":{"@type":"Answer","text":"Cursor pagination that asks for items older than the last seen"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A keyset-paginated list of payments sorts by created_at and fetches the next page with WHERE created_at < last_seen. Some payments never appear. Why?","acceptedAnswer":{"@type":"Answer","text":"Rows sharing a timestamp at a page edge get skipped; add id as a tiebreaker"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"An admin list for a seed catalog shows 'Page 1 of 48,213'. The COUNT(*) behind it takes longer than the page query itself. What is a reasonable change?","acceptedAnswer":{"@type":"Answer","text":"Show next and previous links, or an estimated total, instead of an exact count"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A GET /members endpoint for a rowing club returns all 200,000 members when no page size is given. What should the endpoint do?","acceptedAnswer":{"@type":"Answer","text":"Apply a default page size and enforce a maximum"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"How can a team catch N+1 queries before they reach production?","acceptedAnswer":{"@type":"Answer","text":"Log or assert the query count per request in development and tests"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A vet clinic list page loads 30 patient records, and each row includes a large scanned-document column the page never shows. What is the simplest improvement?","acceptedAnswer":{"@type":"Answer","text":"Select only the columns the list displays"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A real estate photo site lets agents upload 200 MB videos through the app server, which ties up its workers. What is a common better design?","acceptedAnswer":{"@type":"Answer","text":"Have the browser upload straight to object storage with a short-lived signed URL"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A job board accepts resume uploads. How should it check that a file is really a PDF?","acceptedAnswer":{"@type":"Answer","text":"Inspect the file's bytes on the server and enforce a size limit"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A community forum serves user-uploaded files from its main domain. Someone uploads an HTML file with a script that steals session data when opened. What is the right mitigation?","acceptedAnswer":{"@type":"Answer","text":"Serve uploads from a separate domain, with Content-Disposition: attachment"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"An upload handler for a translation agency saves files under the client-supplied filename. A file named '../../config/app.env' overwrote a config file. What is the fix?","acceptedAnswer":{"@type":"Answer","text":"Generate your own storage key and keep the original name only as metadata"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A pet adoption site creates three thumbnail sizes inside the upload request, and large photos often time out. What is the better approach?","acceptedAnswer":{"@type":"Answer","text":"Save the original, respond quickly, and make thumbnails in a background job"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A rental listing form uploads photos as soon as they are picked, before the listing is saved. Storage costs keep rising. What is the likely cause?","acceptedAnswer":{"@type":"Answer","text":"Uploads from abandoned forms are never linked to a listing or cleaned up"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A plain HTML form on a makerspace site posts a file input, but the server receives only the file's name. What is missing?","acceptedAnswer":{"@type":"Answer","text":"The form needs enctype=\"multipart/form-data\""}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A survey tool sends a confirmation email inside the signup request, and the mail provider sometimes takes 8 seconds. What is the usual fix?","acceptedAnswer":{"@type":"Answer","text":"Queue the email as a background job and respond to the user right away"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"After a worker crashed and restarted, some parents in a youth soccer league got the same reminder email twice. The queue delivers at least once. What should the job do?","acceptedAnswer":{"@type":"Answer","text":"Record that each reminder was sent and skip it if it already was"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A coffee roaster's app enqueues a send-receipt job inside a database transaction. Sometimes the worker cannot find the order. Why?","acceptedAnswer":{"@type":"Answer","text":"The job ran before the transaction committed, so the order was not visible yet"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A ferry ticketing job that calls a partner API fails now and then. One bad record makes its job fail every time. How should retries be set up?","acceptedAnswer":{"@type":"Answer","text":"Retry with exponential backoff, then move it to a dead-letter queue after a limit"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A school district's report card export takes several minutes. How should the API respond to the request that starts it?","acceptedAnswer":{"@type":"Answer","text":"Return 202 Accepted with a URL the client can poll for status and the file"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A nightly billing task for a municipal water app runs inside the web process. After scaling to three replicas, customers were billed three times. What is the fix?","acceptedAnswer":{"@type":"Answer","text":"Run scheduled tasks from one scheduler, or guard them with a distributed lock"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A job for a moving company enqueues the full quote object. When the worker runs an hour later, it emails a price the customer already changed. What is a better practice?","acceptedAnswer":{"@type":"Answer","text":"Enqueue the quote id and load the current record at run time"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"The job queue for a print shop's order pipeline keeps growing all afternoon. What do you check first?","acceptedAnswer":{"@type":"Answer","text":"Whether workers are failing or slow, by looking at error rates and job times"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"What do feature flags let a team do when shipping a new checkout flow?","acceptedAnswer":{"@type":"Answer","text":"Deploy the code dark and turn the feature on separately, for some or all users"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A release adds a new endpoint and a front end that calls it. The front end deployed first, and users got 404s for ten minutes. What ordering avoids this?","acceptedAnswer":{"@type":"Answer","text":"Ship the backend change first, then the front end that depends on it"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"What is the purpose of a canary release?","acceptedAnswer":{"@type":"Answer","text":"Send a small share of traffic to the new version and compare its errors"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"Right after a deploy, checkout errors on a ski rental site jump from 0.1 percent to 6 percent. What do you do first?","acceptedAnswer":{"@type":"Answer","text":"Roll back or turn off the flag, then investigate once errors are back down"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"During a rolling deploy, new app instances get traffic before they can reach the database, and those requests fail. What should be fixed?","acceptedAnswer":{"@type":"Answer","text":"Readiness checks, so instances get traffic only once dependencies are ready"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A change works in staging but crashes in production on the first request because an environment variable is missing. What practice catches this earlier?","acceptedAnswer":{"@type":"Answer","text":"Validate required config at startup so the process fails before taking traffic"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A new mobile app version stops reading a field in an API response. When can the API safely stop sending that field?","acceptedAnswer":{"@type":"Answer","text":"Once older app versions still in use no longer depend on it"}},{"@type":"Question","eduQuestionType":"Multiple choice","text":"A team ships a migration together with code. Which order is safest for an additive change, like a new nullable column that the new code writes to?","acceptedAnswer":{"@type":"Answer","text":"Run the migration first, then deploy the code that uses the column"}}]}