I think it's similar to,
https://leetcode.com/problems/binary-tree-right-side-view/

output: 5 9 3 2 6 1 7 4 8 0
It was for Machine Learning Engineer role and I failed. Would love to see the solutions.
UPDATE: it's more like https://leetcode.com/articles/vertical-order-traversal-of-a-binary-tree/