Check, then use: two system calls, and an attacker in between. The answer interviewers want replaces names with handles and checks with atomic operations, and can show it in code.
What would you say before reading the answer?
- 01 State the assumptions your answer depends on.
- 02 Explain the mechanism and choose a control.
- 03 Name a condition that would change your decision.
The worked answer includes an approach, scoring criteria and follow-up questions. Compare the reasoning with your own.