What are generators in Python, and how are they different from regular functions? In which cases would you use them?
~4 min by voice
How to approach it
The interviewer checks whether the candidate understands how generators work: lazily producing values with yield, pausing and resuming execution, and whether they can apply this in practice to save memory and work with data streams.
The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.