Learn C Programming

Lesson 6 of 8 · Functions, Scope and Storage Classes

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?"

Pro lesson

This one goes deeper

It is included with this track and with Learn Pro. Every question on the Skill Test can be answered from the free lessons, so this is depth and never a gate on the certificate.

What is inside The Interview Angle: Side Effects, Pure Functions and Testability

  1. A side effect is anything besides the answer
  2. Pure functions: same input, same answer, nothing else
  3. One function, one job
  4. Your first test table: assert
  5. What makes a function hard to test
  6. The questions interviewers ask