LinkedIn interview question

implement a concurrent read-write buffer.