A virtual machine is the closest thing to your own server in the cloud, with the OS, disk and network fully in your hands. Use EC2 when you need custom software, long-running processes, or a quick lift-and-shift of an existing server. If you only want to run code without patching anything, a PaaS or serverless option is less work. Interviews often ask about instance types, stop vs terminate, and why a public IP changed after a restart.