Klaviyo interview question

Programming of the dice question