Module 7 · Functions, Scope and Storage Classes
The Interview Angle: Side Effects, Pure Functions and Testability
ProReading
Zara is in her first technical interview. She has just written is_leap, and it looks right. Then the interviewer asks: "How would you test it?"
Checking what this lesson needs for you…
What is inside The Interview Angle: Side Effects, Pure Functions and Testability
- A side effect is anything besides the answer
- Pure functions: same input, same answer, nothing else
- One function, one job
- Your first test table: assert
- What makes a function hard to test
- The questions interviewers ask