Dunkin' Interview Question

Some basic question on counting and managing