Axial Interview Question

How would you design an algorithm that determines