# Routing & Controllers (Symfony) > Anotaciones de rutas, parámetros, restricciones, redirecciones, Request/Response, respuestas JSON - 20 preguntas de entrevista - Junior - [Preguntas de entrevista: Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista.md) ## 1. ¿Qué atributo PHP se debe usar para definir una route en un controller de Symfony 7? **Respuesta** El atributo #[Route] del namespace Symfony\Component\Routing\Attribute es el método recomendado para definir routes en Symfony 7. Reemplaza las anotaciones de Doctrine que requerían comentarios especiales. Los atributos nativos de PHP ofrecen una mejor integración con el IDE y validación en tiempo de compilación. ## 2. ¿Cómo definir un parámetro de route dinámico en Symfony? **Respuesta** Los parámetros de route se definen usando llaves en el path de la route, por ejemplo {id}. Este parámetro luego se inyecta automáticamente como argumento del método del controller con el mismo nombre. Esta convención permite la vinculación automática entre la URL y los parámetros del controller. ## 3. ¿Qué objeto de Symfony representa la solicitud HTTP entrante? **Respuesta** La clase Request del namespace Symfony\Component\HttpFoundation encapsula todos los datos de la petición HTTP: parámetros GET/POST, cookies, headers, archivos subidos. Puede inyectarse automáticamente en los métodos de controller gracias al autowiring de Symfony. ## 17 preguntas más disponibles - ¿Cómo restringir una route a un método HTTP específico? - ¿Cómo retornar una respuesta JSON desde un controller de Symfony? Regístrate gratis: https://sharpskill.dev/es/login ## Otros temas de entrevista Symfony - [PHP Moderno (8.1+)](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/php-modern-features.md): 20 preguntas, Junior - [Fundamentos de Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/symfony-basics.md): 25 preguntas, Junior - [Twig & Templates](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/twig-templates.md): 20 preguntas, Junior - [Fundamentos de Doctrine ORM](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/doctrine-orm-basics.md): 25 preguntas, Junior - [Formularios Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/forms.md): 22 preguntas, Junior - [Validación de datos](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/validation.md): 18 preguntas, Junior - [Dependency Injection & Services](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/dependency-injection.md): 24 preguntas, Mid-Level - [Security & Authentication](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/security-authentication.md): 26 preguntas, Mid-Level - [Doctrine avanzado](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/doctrine-advanced.md): 24 preguntas, Mid-Level - [API Platform](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/api-platform.md): 22 preguntas, Mid-Level - [Serializer Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/serializer.md): 20 preguntas, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/events-subscribers.md): 20 preguntas, Mid-Level - [Console & Commands](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/console-commands.md): 18 preguntas, Mid-Level - [Messenger Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/messenger.md): 22 preguntas, Mid-Level - [HTTP Client](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/http-client.md): 18 preguntas, Mid-Level - [Cache y Rendimiento](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/cache.md): 20 preguntas, Mid-Level - [Workflow Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/workflow.md): 18 preguntas, Mid-Level - [Testing Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/testing.md): 22 preguntas, Mid-Level - [Mailer Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/mailer.md): 16 preguntas, Mid-Level - [Traducciones e i18n](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/translations.md): 16 preguntas, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/easyadmin.md): 18 preguntas, Mid-Level - [Arquitectura Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/architecture-patterns.md): 24 preguntas, Senior - [Rendimiento y optimización](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/performance-optimization.md): 22 preguntas, Senior - [Seguridad avanzada](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/security-advanced.md): 22 preguntas, Senior - [Bundles Personalizados](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/custom-bundles.md): 20 preguntas, Senior - [Microservices con Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/microservices.md): 22 preguntas, Senior - [Real-time & WebSockets](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/real-time.md): 18 preguntas, Senior - [Deployment & DevOps](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/deployment-devops.md): 20 preguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/routing-controllers