Goldman Sachs Interview Question

Write code to print top view of a binary tree.