Question
When should a Python developer choose Lambda, map, and filter deliberately?
- Choose Lambda, map, and filter mainly when you want to postpone validation and fix issues manually later.
- Choose Lambda, map, and filter whenever you want the code to look more advanced, even if the design gets less clear.
- Use lambda sparingly for small local behavior when a named function would add more noise than clarity.
- Choose Lambda, map, and filter only to avoid modeling the real data shape or domain contract explicitly.
Hint
Think about the production scenario where the choice genuinely improves the code.
Answer and rationale
Correct answer: C. Use lambda sparingly for small local behavior when a named function would add more noise than clarity.
Use lambda sparingly for small local behavior when a named function would add more noise than clarity. Interviewers often ask this to see whether you can connect the concept to real design decisions.
Track: Python