Design Patterns (GoF) (50 Qs)•Part 1: Creational & Structural Patterns (1 - 10)
What is the Proxy Pattern and what are its common types (Virtual, Protection, Remote)?
junior Leveldesign-patternsCreational
In Simple Words: Provides a surrogate or placeholder object that controls access to the real object:
- Virtual Proxy (Lazy Loading): Defers the creation of an expensive object (e.g. a 50 MB high-resolution image) until it is actually requested.
- Protection Proxy (Security & RBAC): Verifies caller permissions before forwarding requests to sensitive services.
- Remote Proxy: Represents an object located on a remote server (e.g. gRPC stub).
- Caching Proxy: Intercepts requests and returns cached results if available.