Slack on mobile is harder than chat. Chat apps have one thread per conversation. Slack has channels with threads inside channels, with reactions on threads, with shared channels across workspaces, with files attached to messages. The interview tests whether you can handle hierarchical, partially-loaded data on a constrained device.
Functional requirements
- Multiple workspaces per user
- Channels (public, private, DM, group DM)
- Threads within channels
- Reactions, file attachments, link unfurls
- Presence indicators
- Search across all messages
- Unread badges per channel
Architecture
The client maintains a local datastore (SQLite) of channels, messages, threads, and users. A WebSocket connection (Slack uses Real-Time Messaging / Events API) streams events. A REST API handles initial loads, search, and bulk operations.
Channel model
Channel has a last_read timestamp per user. Unread count = messages where ts > last_read. The mobile client maintains this locally and syncs to server on read events.
Threading
A thread is a parent message + replies. Replies have thread_ts equal to the parent’s ts. Mobile UI shows the parent in the channel and a “N replies” indicator. Tap to open the thread; replies are fetched on demand.
Sync strategy
Three layers of sync:
- Workspace boot: initial REST call returns user, channel list, and recent activity.
- Channel open: fetch the last ~50 messages on demand. Pagination as the user scrolls up.
- Real-time: WebSocket pushes new messages, edits, deletions, and reactions.
Presence
Presence is volatile. Server tracks active sockets per user. Pushed via WebSocket. Mobile app shows green dot for active users in DMs and channel sidebar; updates batched to avoid UI thrash.
Push notifications
Server-side rules decide who gets a push (mentions, DMs, keyword matches). Push payload is opaque — content-available + a fetch trigger. App fetches the actual message and renders the notification with content. This protects user privacy but increases push latency.
Search
Server-side full-text search over all messages the user has access to. Results paginated, with snippets. Mobile UI is a thin client over the search API.
Storage budget
Local SQLite is bounded — keep recent messages per channel (last 7 days or 100 messages, whichever is more). Older messages are paged on demand. The user’s starred and threaded messages are kept indefinitely.
Frequently Asked Questions
Why is Slack mobile sometimes slow to show new messages?
Background WebSocket reconnect can take seconds. iOS background app refresh policies limit how aggressively the app can stay connected. Push notifications wake the app and trigger a fetch.
How are file attachments handled?
Files are uploaded separately to S3-backed storage; the message references the file ID. Mobile downloads thumbnails on demand and full files on tap. Encrypted at rest in some compliance tiers.
How does Slack handle very large channels?
Server-side pagination, virtualized scroll on the client, lazy-loaded user metadata, and aggressive culling of old messages from the local DB.