curl to an internal service on an EC2 instance hangs (timeout, not refused). Debug it.

AdvancedHands-onLive debugging tasks
Answer
curl -v --connect-timeout 5 http://10.0.2.15:8080/health
nc -vz -w 3 10.0.2.15 8080
# on the target:
sudo ss -ltnp | grep 8080          # listening, and on 0.0.0.0?
sudo iptables -L -n | head; sudo ufw status
# in AWS: security group inbound 8080 from the source SG/CIDR, NACL both directions, route tables

Key trick → "Refused" means the packet arrived and nothing was listening (or a host firewall sent a reject). A timeout means packets were dropped silently, which in AWS is almost always a security group or NACL. Remember NACLs are stateless and need the ephemeral return ports allowed.

All Real-World Interview questions Roadmap: Interview readiness

More on Live debugging tasks