Level 5 exam — harder

Exam — fresh questions

5.1 · Recall

1. What does the PEP 8 convention define?

PEP 8 standardises style; black formats it, ruff/flake8 flags deviations.
5.1 · Application

2. Nabil's script piles up elif for each computation mode. First pro move?

Strategy: adding a mode becomes adding an entry, without touching the existing code.
5.1 · Arbitration

3. Nabil wants SOLID and patterns on a one-page throwaway script. Call?

Judgement: with no design problem, the pattern is dead weight.
5.2 · Application

4. Nabil hesitates between asyncio and multiprocessing for heavy pure number-crunching. What to pick?

Pure computation (CPU-bound) → multiprocessing; asyncio serves waiting (I/O-bound).
5.2 · Application

5. Nabil's collection awaits three sources one after another. What does he do?

Gather: waits overlap instead of adding up.
5.2 · Application

6. Nabil's gather stays slow: he uses requests in his coroutines. Diagnosis?

Blocking code paralyses async: async end to end or not at all.
5.3 · Recall

7. What does a Docker container hold?

The container ships its environment: identical from PC to server.
5.3 · Application

8. Nabil's app works in Algiers but not on his colleague's machine (missing dependencies). What does he do?

Dockerfile + build + run: same image, same behaviour everywhere.
5.3 · Arbitration

9. Nabil listens on localhost in the container: unreachable. Call?

In a container: mandatory 0.0.0.0, systematic non-root, lean context.
5.4 · Recall

10. What does a CI/CD pipeline (GitHub Actions) do?

CI (ruff + pytest on every push) then versioned delivery if green.
5.4 · Application

11. Nabil deploys: where do the API key and database password go?

Secrets out of YAML, out of code, out of the repo — prod is configured.
5.4 · Arbitration

12. Before exposing real data, what must Nabil do?

Sensitive data: IT validation, backups, checked offers, monitoring in place.
What's next?
Back to the guideGuide contents