๐Ÿ’ปCommon Interview Question: What Happens When You Type An URL?


Hello Reader,

One of the most popular interview question is what happens when you type an URL? Let's find out. So obviously when you type in URL like www.amazon.com, you see the website in your computer or your mobile phone. The interviewer wants to know what happens under the hood so that you can see this website.

Core Concept

At the end of the day, everything is a computer to computer interaction. So in a very rudimentary level, amazon.com is running on bunch of Amazon EC2s. Those EC2s are exposed by Elastic Load Balancer service, and the DNS name amazon.com is hosted in Amazon Route 53. And there is an alias record where amazon.com is pointing to an Elastic Load Balancer.

For your computer to interact with this load balancer. You need the IP address of the load balancer. So the core of this question is how does when you type amazon.com, your computer gets the IP address of this load balancer. With this knowledge in mind, let's go through the steps:

Step 1 : You type amazon.com in the browser

Step 2 : First, your computer check the cache if you have the IP address already saved. First, it checks in your browser cache. If it is not found there, it checks the operating system cache. If it is not found there, it checks the router in your home and if it is not found there, it goes to your internet service provider cache.

Let's say the IP address is not found for amazon.com in any of those cache. Then it goes to DNS resolver. This DNS resolver is typically managed by your internet service provider, such as a cable internet provider, DSL broadband provider, or a corporate network. If you are typing this on your office laptop, this DNS resolver does a recursive DNS lookup and asks multiple DNS servers around the internet, which in turn asks more DNS servers for the DNS record until it is found. This part is confusing, so let's take a deeper look.

Step 3 : Your DNS resolver checks with the DNS root name server by asking "hey, do you have the IP address for amazon.com?". This DNS root name server says "I do not have the IP address for amazon.com, but I am going to give you the name server which has the IP address for all the .com domains".

So once DNS resolver gets the name server for .com, it goes to that nameserver for .com TLD or top level domain. This name server tracks what DNS provider has amazon.com. So it says "I don't have the IP address for amazon.com, but I have the Amazon Route 53 Nameserver that is hosting this amazon.com". So DNS resolver, after getting the address of this Amazon Route 53 goes and asks Amazon Route 53 "Hey, do you have the IP address for Amazon.com?".

And since amazon.com is hosted on Route 53, it sends the IP address of the load balancer. And at this point, DNS resolver sends IP address to your computer. Also, it caches this IP address in the DNS resolver. So next time someone comes for amazon.com, it doesn't have to go through all these recursive DNS queries and can directly return to the user.

Now, in this case, we assume that amazon.com is hosted on Amazon Route 53. But even if that's not the case, let's say your URL is hosted on GoDaddy or another DNS hosting server. This DNS recursive lookup by DNS resolver will finally go to that DNS hosting server and get the IP address for the server or the URL you are looking for.

All right. Going back to the flow now!

Step 4 : Your computer now knows the IP address to which it needs to go. So your computer invokes that IP address which ends up in the elastic load balancer that's distributing traffic to the Amazon EC2 servers.

Step 5 and 6 : And in return it sends the HTML, CSS, and JS content to your laptop and your laptop renders the web page for Amazon.com. If you open up developer settings on the browser, you will see when you type amazon.com; it returns a bunch of HTML, CSS, JavaScript, etc. All these are coming from the web servers (EC2s) running amazon.com.

Now you know how the websites are displayed when you type in a URL. All right guys and gals, this is a very, very important interview question. Please understand the flow! And then you are all set to go for the interview ๐Ÿ™Œ๐Ÿš€.

If you have found this newsletter helpful, and want to support me ๐Ÿ™:

Checkout my bestselling courses on AWS, System Design, Kubernetes, DevOps, and more: Max discounted linksโ€‹

AWS SA Bootcamp with Live Classes, Mock Interviews, Hands-On, Resume Improvement and more: https://www.sabootcamp.com/โ€‹

Keep learning and keep rocking ๐Ÿš€,

Raj

Fast Track To Cloud

Free Cloud Interview Guide to crush your next interview. Plus, real-world answers for cloud interviews, and system design from a top AWS Solutions Architect.

Read more from Fast Track To Cloud

Hello Reader, I have been a Cloud Solutions Architect for 10 years - 4 years at Verizon, 6.5 years at AWS. I was an Application Cloud Architect at Verizon, and then I joined AWS, where I had two different SA roles - first a General SA (Enterprise Architect) and then a Specialist SA. In this post, I will review my responsibilities as an SA in all these companies, including the hardest parts of the job (in my humble opinion). Let's get started: Solutions Architect at Verizon I became a SA at...

Hello Reader, As a small early Christmas gift ๐ŸŽ„, Iโ€™m sharing an updated Cloud Interview Guide, refreshed with important AWS re:Invent 2025 insights and patterns Iโ€™ve seen show up repeatedly in real interviews. Whatโ€™s inside: 90+ cloud interview questions & answers Examples of average / bad answers vs delightful answers New questions including Canary Vs Blue Green Vs Rolling Deployment, Lambda Managed Instances, Agentic AI, Agentcore gateway, and other topics from Re:Invent 2025 ๐Ÿ‘‰ Download the...

Hello Reader, Happy Holidays! In today's newsletter, I am going to share three tips that helped me and many of my students switch careers to the cloud and get high-paying jobs. I will also share an update about the upcoming January cohort of the AWS SA Bootcamp. Tip 1: Leverage your IT experience Your existing IT experience is NOT throwaway. Don't think you can't reuse components of your existing knowledge in your cloud journey. For example, my student Abhisekh has deep knowledge of the...