What is the Proxy Pattern?

Updated Apr 28, 2026

Short answer

A structural pattern that lets you provide a substitute or placeholder for another object.

Deep explanation

A proxy controls access to the original object, allowing you to perform something either before or after the request gets through to the original object. Types of proxies include virtual (lazy initialization), protection (access control), and remote proxies.

Real-world example

A credit card acts as a proxy for a bank account. In code, loading heavy images lazily only when they scroll into the viewport.

Common mistakes

  • Confusing Proxy with Decorator. Proxy controls access/lifecycle, while Decorator adds behavior.

Follow-up questions

  • What is a caching proxy?

More Design Patterns interview questions

View all →