Rippling interview question

Algo problem & design problem