Dunkin' interview question

Some basic question on counting and managing