Samsara interview question

Making a messaging system with array