Technical Senior Level

How would you build a REST API with Symfony? Compare using API Platform versus building with custom controllers and serialisation.

Quick Tip

Match the tool to the need: "For a data-driven API with standard CRUD, API Platform saves weeks of work. For an API with complex business workflows that do not map to entities, custom controllers with the Serializer give me full control."

What good answers include

API Platform: automatic CRUD endpoints from Doctrine entities via PHP attributes, built-in pagination, filtering, validation, OpenAPI documentation, and content negotiation. Extremely fast for standard REST APIs. Custom controllers with Symfony Serializer: more control, better for non-CRUD operations, complex business logic, or APIs that do not map to entities. Trade-offs: API Platform adds magic and a learning curve but saves enormous time for data-driven APIs. Custom approach is more verbose but explicit. Strong candidates discuss: when to use API Platform state processors for custom logic, DTO input/output for decoupling API shape from entities, and when the framework overhead is not worth it for simple endpoints.

What interviewers are looking for

Tests API architecture in Symfony. Candidates who always build everything from scratch may not know API Platform. Those who force API Platform on non-CRUD APIs are fighting the framework. Look for pragmatic tool selection.

← All Symfony questions