Pergunta de entrevista da empresa ByteDance

I was asked few algorythmic questions, the code was not important, only the idea. For example to use stack or priority queue and say something about complexity of proposed solutions.