Discord bot developer interview questions and how to answer them
Discord bot developer interview questions check whether you can build a bot that stays fast, safe and online as it grows: when to use the gateway and when HTTP interactions, how slash commands and the interaction response deadline work, which intents and permissions to request, how to respect rate limits, when sharding becomes necessary, and how to store data and handle tokens. Clients and studios often ask to see a bot you run and may set a small build task. Strong candidates explain failure cases, not only features.
By Evin JohnPublished 8 min read
Who hires Discord bot developers
Bot work comes from several places: gaming communities that want moderation, roles and event tools; game studios that connect accounts, stats and announcements to their servers; creators running membership and ticket systems; companies building community or support tools; and developers selling bots to many servers. Some roles are freelance builds with a short spec, others are full-time positions on a team that owns a bot used in many servers. Interviews range from a portfolio chat to a technical loop, but the core questions repeat because the platform's rules shape every design.
- A language and library you know well, commonly JavaScript or TypeScript with discord.js, or Python with discord.py or a similar library.
- Platform fluency: gateway events, interactions, components, permissions and limits.
- Backend basics: a database, background jobs, logging and deployment.
- Security habits: token handling, input validation and permission checks.
- Community sense: features that moderators and members actually use, and clear error messages.
How the hiring process usually runs
- Portfolio checkA bot you built that they can invite or watch, plus code on a public repository if you can share it.
- Technical conversationThe platform questions on this page, and how you would design the feature they need.
- Build taskSometimes a small slash command or moderation feature, built in a few hours or days.
- ReviewYou walk through your code: structure, error handling, permission checks and how you would deploy it.
Platform fundamentals questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What is the gateway, and when do you need it? | Connection model | A WebSocket connection that streams events such as messages and member joins; needed for event-driven features, not for slash commands alone |
| How do HTTP interactions differ from gateway interactions? | Architecture choice | Discord can send interactions to a web endpoint you host, which suits serverless setups, but you must verify each request's signature |
| What is the deadline for answering an interaction? | Platform limits | An initial response within 3 seconds, or a deferred response, then follow-ups with the interaction token, which stays valid for 15 minutes |
| What are intents, and which are privileged? | Least privilege | Opt-in event groups; message content, server members and presence are privileged and need approval for larger bots |
| Global or guild commands? | Command registration | Guild commands update quickly and suit testing; global commands reach every server the app is in |
| What are components and modals? | Interaction design | Buttons, select menus and pop-up forms that send interactions back to your bot, each with a custom ID you route on |
const { Client, Events, GatewayIntentBits } = require("discord.js");
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName !== "stats") return;
await interaction.deferReply(); // acknowledge inside 3 seconds
try {
const stats = await loadStats(interaction.user.id); // slow work after deferring
await interaction.editReply(`Games played: ${stats.games}`);
} catch (err) {
console.error(err);
await interaction.editReply("Could not load your stats. Try again later.");
}
});
client.login(process.env.DISCORD_TOKEN);Permissions and security questions
- How are permissions represented? As a bitfield: each permission is one bit, and a member's effective permissions come from roles and channel overwrites, so checks use bitwise operations.
- Why check the user's permissions in your code when Discord already has command permissions? Server admins can change command settings, and some actions depend on the target, such as role hierarchy, so the bot should verify before acting.
- Where do you keep the bot token? In environment variables or a secret manager, never in the repository; rotate it at once if it leaks.
- How do you stop a moderation command from being abused? Check the caller's permissions and role position against the target's, log every action to a moderator channel, and confirm destructive actions.
- How do you handle user input safely? Validate options, limit lengths, escape or disable mentions in echoed text, and never build database queries from raw strings.
- What scopes does a bot invite link need? Typically the bot scope and the scope for application commands, with only the permissions the features require.
const PERMS = {
KICK_MEMBERS: 1n << 1n,
BAN_MEMBERS: 1n << 2n,
ADMINISTRATOR: 1n << 3n,
MANAGE_MESSAGES: 1n << 13n,
};
function has(memberBits, perm) {
const bits = BigInt(memberBits);
if ((bits & PERMS.ADMINISTRATOR) === PERMS.ADMINISTRATOR) return true;
return (bits & perm) === perm;
}
console.log(has("8196", PERMS.MANAGE_MESSAGES)); // true (8192 + 4)
console.log(has("8196", PERMS.KICK_MEMBERS)); // false
console.log(has("8", PERMS.BAN_MEMBERS)); // true (administrator)Scale, rate limits and reliability questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| How do you handle rate limits? | API etiquette | Respect the rate limit headers and the retry information on a 429 response, queue requests per route, and avoid bursts such as mass DMs |
| When do you need sharding? | Scaling | Each shard can hold a limited number of servers, and Discord requires sharding once an app is in 2,500 of them; libraries can manage shards for you |
| How do you survive a restart without losing state? | Persistence | Keep durable data in a database, rebuild caches on start, and make scheduled jobs resume from stored times |
| The gateway connection drops. What happens? | Resilience | The library resumes or reconnects; your code should tolerate missed or repeated events and not assume order |
| How do you deploy a bot with no downtime? | Operations | Run on a host that restarts on failure, deploy new versions behind health checks, and register command changes separately from code deploys |
| How do you monitor a bot? | Observability | Structured logs, error tracking, command latency and failure counts, and alerts when the bot goes offline |
Design and feature questions
- Design a ticket system for a support server. A button opens a private channel or thread with the user and staff roles, a modal collects the issue, and closing archives a transcript and logs it.
- Design a reminder command that survives restarts. Store reminders with due times in a database, poll or schedule from storage, and handle deleted channels.
- How would you build a leveling system without spamming the database? Batch updates, cooldowns per user, and cache hot data with periodic writes.
- How would you link Discord accounts to accounts in your game? OAuth2 with the identify scope, a state value to prevent forgery, and storing the mapping securely.
- How do you design commands people understand? Clear names and descriptions, options with choices or autocomplete, and helpful private error replies.
- What would you do differently for a bot in one server versus thousands? Per-server settings, sharding, stricter rate limit handling, verification and privileged intent approval, and support processes.
Fictional example
- I run a bot for an esports league's server that posts match results from our tournament site. After a big final, the results command started failing for many users with an interaction failed message. Logs showed the command fetched the bracket from our site, which was slow under load, and we only replied after the fetch, so we missed the 3-second window. I changed the command to defer first and edit the reply after the fetch, added a short cache for the bracket so repeated calls did not hit the site, and set a timeout with a clear error message. I also added a metric for command latency so we would see it before users did. During the next event the command kept working even when the site slowed down.
Questions about you and your work
- What is the most complex bot you have built? Number of servers or users, features, the hardest problem and how you solved it.
- How do you test a bot? Unit tests for logic separated from the library, a private test server, and staging commands registered to it.
- How do you keep up with platform changes? The developer changelog and library release notes, and reading deprecation notices before they bite.
- What would you refuse to build? Self-bots, spam tools or anything that breaks the platform's terms or harms users.
Many bot backends use the same stack as web services, so the Node.js guide and the Python developer guide are useful next reads, and the backend developer guide covers databases and deployment. If the client also runs a community website on a CMS, see the Drupal developer guide.
More Discord questions to practice
- How do you store per-server settings? A table keyed by server ID with defaults, loaded on demand and cached, and cleaned up when the bot leaves a server.
- How do you build autocomplete for a command option? Respond to the autocomplete interaction quickly with a small list of matching choices, usually from a cache rather than a slow query.
- What happens when the bot loses a permission it needs? Catch the error, tell the user or server admin what permission is missing, and avoid retrying in a loop.
- How do you send a message to many users without being rate limited or flagged? Avoid mass DMs, use announcement channels or opt-in notifications, and queue any sends with backoff.
- How do you handle buttons on old messages after a restart? Route on custom IDs stored in the message, not on in-memory state, and reply clearly if the action has expired.
- What would you log, and what would you never log? Command names, timing and errors, but never tokens, and avoid storing message content or personal data you do not need.
- How do you verify requests if you use an HTTP interactions endpoint? Check the signature headers on every request with the app's public key and reject anything that fails.
A one-week preparation plan
- Days 1 and 2: clean up one bot you can demo: a readme, an invite link with minimal permissions and error handling on every command.
- Day 3: add one command that defers, one button flow and one modal, and test them in a private server.
- Day 4: add rate limit handling and logging, and write down how the bot behaves after a restart.
- Day 5: design the ticket system and the reminder system on paper and explain them out loud in five minutes each.
- Days 6 and 7: read the current developer docs on intents, sharding and verification, and prepare questions about the employer's community and scale.
Natively is an AI interview assistant for Mac and Windows that suits technical practice like this: in a mock round it can read a coding question from a screenshot on your screen and suggest an approach, and it transcribes your spoken explanation of a design so you can check whether you mentioned the 3-second deadline and the permission checks. The transcript and notes are saved for your next practice session.
Questions people ask
What questions are asked in a Discord bot developer interview?
Questions about the gateway and HTTP interactions, slash commands and the response deadline, intents and privileged intents, permissions, rate limits, sharding, persistence, hosting, token security and designing features such as tickets or reminders.
How long does a bot have to respond to an interaction?
Discord's docs say the initial response must come within 3 seconds; you can defer and then send follow-ups with the interaction token, which stays valid for 15 minutes.
When does a Discord bot need sharding?
Each shard handles a limited number of servers, and Discord's docs require sharding once an app is in 2,500 servers. Most libraries can manage shards for you.
Which language should I use for Discord bot interviews?
Use the one you know best. JavaScript or TypeScript with discord.js and Python with discord.py are common, and interviewers care more about platform knowledge and clean code.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
