On this page
article
Interview Q&A #105
Web & Backend interview question #15.
Category: Web & Backend
Question
[Web & Backend] Question #15: What is a generator?
Answer
A function with yield that produces values lazily, saving memory for large sequences.
Expand your answer with examples from your projects and link to Interview Prep.
Follow-Up Questions
- Can you explain a trade-off involved?
- How would you test this in production?
- What could go wrong at scale?