ByteDance Interview Question

Write the code of a synchronous FIFO,