The Reddit technical screen centered on implementing a small in-memory chat-message service and then progressively extending it. The base functionality involved loading ordered messages and retrieving a local window around a requested message. Follow-ups added multi-message queries, read optimization, editing, and eventually preserving historical versions of edited messages.
Interview Details
Coding — Implement a Chatter Message Store: The interviewer provided a Chatter abstraction and asked me to implement several methods. Message IDs were unique, and newly loaded messages could be assumed to arrive in sorted order. The initial API included:
load(messages)
save()
get_messages(id)
load(messages)
save()
get_messages(id)
load() could be called multiple times to append additional messages. save() returned all currently stored messages. For get_messages(id), the required result was a window containing:
up to two messages before the requested message
the requested message itself
up to two messages after it
If the target was close to the beginning or end of the stored history, the result should simply stop at that boundary rather than requiring five messages. For example, consider this rewritten first batch:
messages_1 = [
{"msg_id": 210.10, "text": "Morning everyone"},
{"msg_id": 210.20, "text": "Did anyone see the release notes?"},
{"msg_id": 210.30, "text": "I just opened them"},
{"msg_id": 210.40, "text": "The search changes look useful"},
{"msg_id": 211.10, "text": "Agreed"},
{"msg_id": 211.20, "text": "Especially the filtering update"},
{"msg_id": 212.10, "text": "We should test it later"},
{"msg_id":
messages_1 = [
{"msg_id": 210.10, "text": "Morning everyone"},
{"msg_id": 210.20, "text": "Did anyone see the release notes?"},
{"msg_id": 210.30, "text": "I just opened them"},
{"msg_id": 210.40, "text": "The search changes look useful"},
{"msg_id": 211.10, "text": "Agreed"},
{"msg_id": 211.20, "text": "Especially the filtering update"},
{"msg_id": 212.10, "text": "We should test it later"},
{"msg_id":
Unlock Full Details
Create a free account to unlock this interview experience report.