Meta interview question

solve some weird question about heap stack