← Back to videos

Junior Python interview: branching, if/else, dictionaries and an unexpected catch

Egor is taking a trial interview for the role of Junior Python Developer. In this episode, we discuss branching in Python, the if/else construct, the ternary operator, match/case, lazy evaluation and alternatives using dictionaries.

In the practical section, we analyse a tricky piece of code involving a dictionary, Boolean keys and value overwriting.

Timestamps:

00:00 — Start
00:27 — Introductions and the interview format
05:27 — What is branching in Python
07:31 — Spaghetti code and nested conditions
10:43 — What to do if there are too many conditions
14:17 — The ternary operator
17:33 — switch/case and whether it exists in Python
20:29 — Lazy evaluation in conditions
31:03 — Branching using a dictionary
33:07 — How to choose between if/else and a dictionary
39:06 — Which is faster: if/else or a dictionary
43:02 — Practical exercise with code
57:01 — Candidate’s self-assessment
01:00:51 — Feedback on the interview