Microsoft Interview Question

Design chat system assuming we have previous data.