Symfony

Symfony Basics

Installation, project structure, bundles, environments, configuration, routing, controllers

25 interview questionsยท
Junior
1

Which command creates a new Symfony project with all dependencies for a web application?

Answer

The symfony new --webapp command creates a complete Symfony project with all dependencies needed for a web application (Twig, Doctrine, Security, etc.). The symfony new variant without --webapp creates a minimal project. Composer create-project is a valid alternative but symfony new is recommended as it automatically configures optimal settings.

2

Which folder contains controllers in a Symfony 7 project?

Answer

Controllers are placed in the src/Controller/ folder according to Symfony's standard structure. The corresponding namespace is App\Controller. This convention enables automatic autowiring and facilitates code organization. The other mentioned folders do not exist in the standard Symfony structure.

3

What is a Bundle in Symfony?

Answer

A Bundle is a reusable package that groups code and resources (controllers, templates, configuration) around a specific feature. It can be shared across multiple Symfony projects. Third-party bundles are installed via Composer and registered in config/bundles.php. In modern Symfony, bundles are primarily used for third-party libraries.

4

Which file contains the list of active bundles in a Symfony project?

5

What are the three default environments in Symfony?

+22 interview questions

Master Symfony for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free