Users say the orders page is slow. How do you find and fix the problem across frontend, API and database?
What the interviewer wants to hear
- Measure first: browser DevTools, Core Web Vitals, network waterfall
- Check API timing with logs, tracing or APM
- Inspect slow queries with EXPLAIN ANALYZE and add indexes
- Look for N+1 queries, large payloads and missing pagination
- Fix, then measure again and add monitoring
Model answer
I start by measuring, not guessing. In Chrome DevTools I look at the network waterfall and performance panel: is the time spent waiting for the API, downloading a large JavaScript bundle, or rendering a huge list? If the API is slow, I check server logs or tracing with something like OpenTelemetry to see which part of the request takes time. Often it is the database, so I run EXPLAIN ANALYZE on the slow query, look for sequential scans and add a suitable index, or fix an N+1 pattern by using a join. I also check if the API returns too much data, and add pagination or select only needed columns. On the frontend I might virtualize a long list, split a heavy bundle or cache data with a library like TanStack Query. After each fix I measure again and add an alert so we notice if it gets slow later.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Full Stack Developer questions
- How would you implement login for a web app? Compare server sessions with JWT access tokens and explain what you would choose.
- How would you build a feature that lets users upload profile photos and PDF documents up to 100 MB?
- Your API is used by a web app and an older mobile app that users do not update quickly. How do you make a breaking change safely?
- Describe a good CI/CD pipeline for a full stack app. What runs on each pull request and how do you deploy safely?
- You need to build a product search page with text search, filters and sorting. Walk through the design from the UI to the database.
- How would you add role-based access control (admin, editor, viewer) to an existing full-stack app?
- What is your testing strategy for a full-stack feature such as "invite a teammate by email"?
- Describe the different layers where you can cache in a typical full-stack web app, and how you keep cached data correct.
- You need to show in-app notifications in real time. How do you choose between polling, server-sent events and WebSockets, and how would you build it?