What happens, step by step, when a user types your app URL into the browser and presses Enter?
What the interviewer wants to hear
- DNS lookup turns the domain into an IP address
- TCP and TLS handshake set up a secure connection
- Browser sends an HTTP request and the server or CDN returns HTML
- Browser parses HTML, loads CSS and JavaScript, and renders the page
- JavaScript may hydrate the page and call APIs for more data
Model answer
First the browser finds the IP address for the domain using DNS, checking its own cache, the OS cache and then DNS resolvers. It opens a TCP connection, or QUIC for HTTP/3, and does a TLS handshake so the connection is encrypted. Then it sends an HTTP GET request. The request may be answered by a CDN edge cache, or reach my server, which might run middleware, check the session cookie, query the database and render HTML. The browser parses the HTML, builds the DOM, downloads CSS, JavaScript, fonts and images, and paints the page. In a React or Next.js app, JavaScript then hydrates the HTML so buttons become interactive, and the app may call APIs for more data. Each step is a place where performance can be improved, for example with caching, compression and smaller bundles.
Can you answer it under time pressure?
Take a timed easy round and get scored on every answer.
More easy Full Stack Developer questions
- Design the REST API endpoints for a simple blog with posts and comments. What URLs, methods and status codes would you use?
- What is the difference between authentication and authorization? Give an example from a web app.
- You are starting a new e-commerce app. Would you choose a SQL or a NoSQL database, and why?
- Explain client-side rendering, server-side rendering and static site generation. When would you use each?
- In a web app with a React frontend and an API, where should input validation happen, and why?
- A page loads data from your API. How do you handle loading, empty and error states so users are never left confused?
- How do you manage configuration and secrets across development, staging and production for a full-stack app?
- How would you explain a database index to a junior developer, and how do you decide which columns to index?
- Describe the Git and code review workflow you follow when building a feature on a team.