What is a firewall?

Why Interviewers Ask This

Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for Networking development. It reveals whether you understand the building blocks that more complex concepts rely on.

Answer

A firewall is a network security device (hardware or software) that monitors and controls incoming and outgoing network traffic based on predefined security rules. It acts as a barrier between a trusted internal network and untrusted external networks (like the Internet). Types: Packet filtering firewalls inspect individual packets based on IP, port, and protocol rules — fast but limited visibility. Stateful inspection firewalls track the state of active connections and only allow packets that belong to an established connection — more secure. Application layer (proxy) firewalls understand application protocols (HTTP, FTP) and can filter based on content. Next-Generation Firewalls (NGFW) combine all the above with deep packet inspection, intrusion prevention, SSL decryption, and application awareness. Firewalls are a fundamental component of network security architecture.

Common Mistake

A common mistake is memorizing definitions without understanding implications. When asked this question, go one level deeper — explain what happens when this concept is misused or ignored.