Google Interview Question

Difference between router and switch

Interview Answer

Anonymous

Jun 17, 2026

A switch connects devices within the same LAN and forwards Ethernet frames using MAC addresses. It operates mainly at Layer 2 of the OSI model. A router connects different networks or subnets and forwards packets using IP addresses, operating at Layer 3. For example, communication between servers on the same VLAN is handled by a switch, while communication between different subnets requires a router or Layer 3 switch to route the traffic.