Level 4 exam — harder

Exam — fresh questions

4.1 · Recall

1. In the MVC pattern, who does what?

Data to the model, display to the view, coordination to the controller.
4.2 · Recall

2. What do Blade and Eloquent do in Laravel?

Safe templates + database as objects with automatic prepared statements.
4.3 · Recall

3. What is Symfony's major characteristic?

Components: modularity, reuse even outside Symfony.
4.1 · Application

4. Riad finds an SQL query in a view. What should he do?

Dumb views: display; rich models: data and rules.
4.2 · Application

5. Riad's product list runs one query per row (N+1). Reflex?

Understand Eloquent's SQL; one query instead of one per row.
4.4 · Application

6. Riad's mobile app creates a product (POST /api/produits). Expected codes?

201 after creation, 400 if invalid, 401 if unauthenticated.
4.4 · Application

7. A request arrives with no token on Riad's protected /api/produits. Response?

401 = unauthenticated; secret in .env, never hardcoded.
4.5 · Application

8. Riad wants to lock his prixTTC calculation. First test?

Input → expected in an assertion, edge cases included.
4.3 · Application

9. Riad's client requires Symfony while the team knows Laravel. Arbitration?

Transferable concepts: MVC, ORM, templates, routing.
4.2 · Arbitration

10. Riad finds the JWT secret hardcoded in a pushed commit. First reflex?

Secret out of the code and out of Git; immediate rotation after exposure.
4.5 · Arbitration

11. On the eve of the sales, Riad hesitates to test ("it already works"). Decision?

Non-regression: the green suite before each delivery.
4.4 · Arbitration

12. Riad must serve the same catalogue to the site and the mobile app. Architecture?

One decoupled back end, several clients, versioned contract.
What's next?
Back to the guideGuide contents