Google interview question

A magic square algorithm.