Fundamentals

Fundamentals Interview Guide

IP vs URL, what happens when you type a URL, and core concepts.

2Topics
Diagram: IP Address vs URL β€” how addresses and domain names relate to networking and the web.
IP Address vs URL β€” core concepts for interviews
Beginner

IP Address Vs URL

Bad Answer

URL is a link assigned to an IP address.

Correct Answer

An IP address is a unique number identifying a device on a network. A URL (Uniform Resource Locator) is a human-friendly address that gets resolved to an IP via DNS. Critically, in production architectures, one URL does NOT map to one IP β€” it maps to a Load Balancer that distributes traffic across multiple servers with different IPs.

IP Address Types (Know These for Interviews)

Type Scope AWS Example Notes
Private IP Internal to VPC only 10.0.1.23 (assigned to EC2 in VPC) Non-routable on internet. Free. Used for internal communication.
Public IP Internet-reachable 54.123.45.67 (auto-assigned) Changes on instance stop/start. Don't rely on it.
Elastic IP Static public IP you own Attached to EC2 or NAT Gateway $0.005/hr when NOT attached. Free when in use. Max 5 per region by default.
IPv6 128-bit address Dual-stack VPCs, ALB, CloudFront No NAT needed β€” every IPv6 is globally unique. AWS VPCs support dual-stack.

DNS Record Types (Quick Reference)

Record Maps AWS Use Case
A Domain β†’ IPv4 address EC2 instance, NLB
AAAA Domain β†’ IPv6 address Dual-stack ALB
CNAME Domain β†’ another domain Cannot be used at zone apex (e.g., example.com)
Alias (AWS) Domain β†’ AWS resource CloudFront, ALB, S3, API Gateway. Free, works at zone apex.
MX Domain β†’ mail server Amazon SES, WorkMail

🎯 Key Takeaway

Interview tip: Show AWS awareness: "In AWS, I'd use Route 53 Alias records (free, zone-apex compatible) pointing to an ALB, not individual EC2 IPs. The ALB handles health checks and distributes traffic across targets in multiple AZs. For static IPs (needed by firewalls), I'd use a Network Load Balancer or Global Accelerator."

Beginner

What Happens When You Type an URL

The complete end-to-end flow when you type www.example.com in your browser β€” mapped to AWS services:

Step What Happens AWS Service Latency
1. DNS Resolution Browser checks cache β†’ OS cache β†’ DNS resolver queries root β†’ TLD β†’ authoritative nameserver Route 53 (authoritative DNS) ~1-50ms (cached) to ~100ms (cold)
2. TCP Handshake Three-way handshake: SYN β†’ SYN-ACK β†’ ACK establishes reliable connection ALB / CloudFront edge ~1 RTT (round-trip time)
3. TLS Handshake Client & server agree on encryption, exchange certificates, establish shared secret ACM (free TLS certs), CloudFront terminates TLS at edge ~1-2 RTTs
4. HTTP Request Browser sends GET request with headers (User-Agent, cookies, Accept) CloudFront checks cache β†’ ALB β†’ Target Group ~0ms if CDN cache hit
5. Server Processing LB routes to app server, which queries DB and generates response EC2/Lambda/ECS + RDS/DynamoDB ~5-500ms (varies)
6. HTTP Response Server returns status code (200), headers, HTML body Response cached at CloudFront edge for future requests β€”
7. Browser Rendering Parse HTML β†’ build DOM β†’ fetch CSS/JS/images β†’ render tree β†’ paint Additional assets may come from S3/CloudFront ~100-2000ms

Performance Optimization at Each Layer

  • DNS: Route 53 latency-based routing routes users to the nearest region
  • TLS: CloudFront terminates TLS at the edge (450+ PoPs) β€” users connect to nearby edge, not distant origin
  • HTTP: CloudFront caches static assets. Set proper Cache-Control headers. Use HTTP/2 and HTTP/3.
  • Server: Use ElastiCache/DAX to cache DB queries. Use read replicas for read-heavy workloads.
  • Rendering: Serve pre-compressed assets (gzip/Brotli from CloudFront). Lazy-load images.

🎯 Key Takeaway

Interview tip: Map each step to AWS services to show cloud awareness: "Route 53 resolves DNS with latency-based routing, CloudFront terminates TLS at the edge and serves cached content, ALB distributes to healthy targets across AZs, the app queries DynamoDB/RDS with ElastiCache in front for hot data. Total time: sub-100ms for cached content, 200-500ms for dynamic."

Intermediate

Interview Questions β€” Cloud Fundamentals

Fundamental questions often warm up an interview. Getting these wrong early can set a negative tone. These cover networking basics, protocols, and cloud concepts.

  1. Answer Guide
    ALB = Layer 7 (HTTP/HTTPS) β€” can route based on URL path, host header, HTTP methods. NLB = Layer 4 (TCP/UDP) β€” routes based on IP/port, ultra-low latency. This matters because: ALB can do content-based routing to microservices, NLB is needed for non-HTTP protocols (gRPC, WebSocket passthrough, gaming).
  2. Answer Guide
    TCP β€” reliable, ordered, connection-oriented (HTTP, database connections). UDP β€” unreliable but fast, connectionless (video streaming, DNS, IoT telemetry, gaming). AWS use case: NLB with UDP listeners for real-time gaming servers, or Route 53 DNS queries (UDP by default, TCP for large responses).
  3. Answer Guide
    /16 = 65,536 IPs. /24 = 256 IPs. So /16 contains 256 possible /24 subnets. AWS reserves 5 IPs per subnet (network, VPC router, DNS, future, broadcast), so a /24 has 251 usable IPs. Know this math β€” interviewers will ask you to design VPC CIDR allocation on the spot.
  4. Answer Guide
    Latency = time for a packet to travel (ms). Bandwidth = max capacity of the pipe (Gbps). Throughput = actual data transferred (affected by both). Diagnosis: high latency + normal throughput = distance/routing issue. Normal latency + low throughput = bandwidth saturation. Use CloudWatch, VPC Flow Logs, and traceroute.
  5. Answer Guide
    Customer's fault. AWS is responsible for security OF the cloud (hardware, network, hypervisor). Customer is responsible for security IN the cloud (IAM, SG rules, passwords, encryption, patching OS on EC2). RDS: AWS patches the engine, customer manages access credentials, SGs, and encryption settings.
  6. Answer Guide
    Key codes: 200 (OK), 301/302 (redirect), 400 (bad request), 401 (unauthenticated), 403 (forbidden), 404 (not found), 429 (throttled), 500 (server error), 502 (bad gateway), 503 (service unavailable), 504 (timeout). 502 from ALB = backend target returned invalid response or connection refused. Check target health, security groups, and application logs.
  7. Answer Guide
    GraphQL β€” client requests exactly the fields it needs (no over-fetching/under-fetching). REST β€” fixed response shapes, over-fetching common. gRPC β€” binary protocol (Protobuf), most efficient but complex on mobile. For mobile: GraphQL for flexible queries, or REST with field selection. gRPC for backend-to-backend microservice communication.
  8. Answer Guide
    Stateful: session data on the server. If user hits a different instance, session is lost. Solutions: sticky sessions (ALB, but reduces load balancing effectiveness), externalize state to ElastiCache Redis or DynamoDB (best practice). Statelessness enables horizontal scaling, auto-scaling, and graceful instance replacement.
  9. Answer Guide
    At rest β€” data stored on disk is encrypted. S3: SSE-S3/SSE-KMS. RDS: encrypted volumes (enable at creation). EBS: encrypted snapshots/volumes. In transit β€” data moving over the network. TLS 1.2+ (ALB terminates TLS), ACM for certificates. End-to-end: TLS from client β†’ ALB β†’ re-encrypt to backend.
  10. Answer Guide
    IaaS = EC2 (you manage OS up). PaaS = Elastic Beanstalk, App Runner (you manage code, platform handles infra). SaaS = S3, DynamoDB (fully managed, just use the API). ECS on Fargate = between PaaS and IaaS (you manage containers, not servers). EKS = closer to IaaS (you manage K8s workloads, potentially nodes too).

Preparation Strategy

Fundamentals seem "easy" but wrong answers here create doubt early in the interview. Practice explaining basic concepts clearly and concisely β€” if you can't explain CIDR notation or the OSI model in 30 seconds, the interviewer will question your depth on harder topics.