Goldman Sachs interview question

Write code to print top view of a binary tree.