Axial interview question

How would you design an algorithm that determines