Technical Mid Level

Describe the Symfony form system. How do form types, data transformers, and validation constraints work together?

Quick Tip

Show the flow: "The form maps request data to the entity, transformers handle type conversion, then validation constraints fire. If valid, the controller gets a hydrated entity ready to persist."

What good answers include

Form types define the structure and mapping between form fields and entity properties. Data transformers convert between the form representation and the model representation — for example, transforming an entity ID to an entity object. Validation constraints (annotations/attributes on entities or inline in form types) run after the form is submitted and before the data reaches the controller. Strong candidates discuss: compound forms (embedding form types), custom form types, the form events system, and the difference between model and view transformers.

What interviewers are looking for

Tests practical Symfony experience. Candidates who bypass the form system for manual request handling lose validation, CSRF protection, and type safety. Those who understand data transformers can handle complex form scenarios.

← All Symfony questions