How does the Facade pattern differ from the Adapter pattern?

Facade and Adapter are both structural patterns that wrap other code, but they solve different problems: Facade simplifies a complex subsystem's interface, while Adapter makes two incompatible interfaces work together.

Key Points: • Facade's goal is simplification: it hides the complexity of multiple subsystem classes behind one high-level interface. • Adapter's goal is compatibility: it translates one interface into another that the client already expects. • A facade typically wraps many classes; an adapter typically wraps a single class or interface to fit an existing contract. • Facade is used when a subsystem is complex but the interfaces are already compatible with each other internally. • Adapter is used when integrating third-party or legacy code whose interface doesn't match what your code needs.

Interview Tip: A concise interview answer is:

"Facade simplifies access to a complex subsystem by giving it one clean interface, while Adapter is about compatibility — it converts one interface into another the client already expects. If I'm hiding complexity, that's a facade; if I'm bridging two mismatched interfaces, that's an adapter."