KLA interview question

Moderately difficult.