ByteDance interview question

coding: Binary tree preorder traversal