ByteDance interview question

Write the code of a synchronous FIFO,