Waystar interview question

Normal data structure and algo