Affirm interview question

A hard OOD problem which can be found on leetcode