eCentric interview question

How you achieve magical squares problem?