Beyond Page Object, frameworks apply classic design patterns: Factory (create drivers/pages), Singleton (single ConfigReader), Builder/Fluent (construct test data/requests), Strategy (swap wait/browser behavior), and Facade (simplify complex flows).
FACTORY centralizes object creation — a DriverFactory returns the right WebDriver by config, a PageFactory-style creator returns page objects. SINGLETON ensures one instance of shared resources (ConfigReader, ReportManager) — used carefully, as singletons can hinder parallelism if they hold mutable state. BUILDER/FLUENT constructs complex objects readably (new UserBuilder().withRole('admin').build()) and enables fluent page chaining (loginPage.enterUser(x).enterPass(y).submit()). STRATEGY lets you swap algorithms (different wait or locator strategies). Applying patterns appropriately makes the framework extensible and readable; knowing which pattern solves which problem is a senior interview differentiator.
new UserBuilder().withEmail(unique()).withRole('admin').build() (Builder) creates test users readably with defaults, while a DriverFactory (Factory) returns Chrome/Firefox/Edge based on config — patterns making the framework clean and extensible.
Which design pattern would you use to create the right WebDriver based on a config value, and which for building complex test-data objects?