Xsight Labs interview question

about a queue how to sync it efficiently for both reader and writer