Company interview guide

xAI Machine Learning Interview Guide (2026)

A fast loop run by engineers: a short screen, production-style coding, design, and a deep dive on your own work.

xAI's machine learning interview loop has 7 reported stages, from online assessment (some tracks) to final conversation; typical length: 1-4 weeks.

Roles covered: ML Engineer, Research Scientist and AI Engineer. The question bank holds 23 questions reported from xAI interviews, 4 of them free to solve in your browser.

Try a free question

Merged into SpaceX. xAI merged into SpaceX in February 2026, after taking in X (formerly Twitter) in March 2025. Reports from before the merger may not reflect later changes to hiring.

Interview process length
1-4 weeks
Stages
7
Reports linked to bank questions
30
Bank report dates
May 2025–Sep 2026
Questions in bank
23 (4 free)
Last reviewed
October 2026

How the xAI interview loop works

An application with a CV and a written statement of exceptional work, a 15-30 minute screen with an engineer, researcher or hiring manager, then two to four technical rounds of about 45-60 minutes that are often booked within days of each other. Rounds mix practical coding, an ML or research round for ML roles, and system design, and most loops include a deep dive or short talk on your own work. Some tracks start with a timed online test, and some teams finish in person. Few reports exist, teams differ, and round content is often not announced ahead of time.

The xAI interview process, stage by stage

01Online assessment (some tracks)

Timed online test, about 60 minutes in one report; not part of most ML-engineer loops

Some candidates start with a test instead of, or before, a call. Reported versions include three algorithm tasks in 60 minutes for an AI engineer role, a coding test for data roles, a coding assessment before the phone screen for a London engineering role, and a prompt-judgement test where you pick the better prompt for a query.

What it tests

  • Fast, correct algorithmic code under a tight clock
  • Code clarity and efficiency, usually in Python or C++
  • For prompt-focused roles, judging which prompt better fits a task

How to prepare

  • Ask whether your track has a test; ML-engineer reports mostly go straight to a call.
  • Practise finishing several medium problems in an hour; one candidate ran out of time.

Four reports, mostly AI-engineer, data and one London engineering role, describe a timed test before any call; no ML-engineer report since 2025 does.

02Engineer screen

15-30 min call with an engineer, researcher or hiring manager

A short, dense conversation. You introduce yourself, walk through one project end to end, often with a focus on its data, and then field a quick fundamentals question. Interviewers may steer you to a different team. Several candidates heard they had passed within the hour.

What it tests

  • A crisp account of one project and your exact contribution
  • How the data behind that project was collected and processed, and how it shaped results
  • Quick fundamentals, for example processes versus threads
  • Whether your interests fit the team

How to prepare

  • Prepare a 30-second and a 5-minute version of your strongest project; the call moves fast.
  • Be ready to explain the data side of your work: sources, cleaning, labelling and their effect on downstream metrics.
  • Expect the screener to have read your statement of exceptional work and to probe its claims.
  • Brush up on concurrency and language basics in your main language.

Free reported questions for this stage

Six candidate reports from 2025-2026 describe a short screening call, usually 15-30 minutes on one project plus fundamentals; xAI's careers page and its own job postings describe a 15-minute first interview.

03Technical rounds: practical coding

Usually 1-2 x 45-60 min live coding, often within days of the screen; some engineering tracks run a timed build or codebase-reading round instead

Problems come from real LLM and infrastructure work more than from puzzle books: drive a mock model with dynamic batching, find bad GPU nodes with group tests, write a trie-based tokenizer, build a randomized pool. Classic stateful designs such as a transactional key-value store, an LRU cache or a stateful iterator also come up, usually with extensions added mid-round. Some loops hand you a partial class from an inference engine and ask you to fill in a missing method.

What it tests

  • Turning a loosely specified production task into clean, working code
  • Managing state carefully: request slots, queues, caches, transactions
  • Algorithmic reasoning under constraints, such as node-disjoint parallel tests
  • Reading and completing unfamiliar code with no spec
  • Extending your own design when new requirements arrive

How to prepare

  • Practise a batched decode loop end to end: fill slots, step the model, retire finished sequences, refill, and keep results mapped to the right request.
  • Restate the problem and confirm edge cases first; round content is often not announced and prompts are loose.
  • Get a correct version working before optimizing, then extend it cleanly when asked.
  • Expect some maths questions alongside the code in research-leaning loops.

Free reported questions for this stage

Eight ML, research and technical-staff reports describe live coding rounds, often practical and sometimes with maths; xAI's own postings list a coding interview in a language of your choice.

04Technical rounds: ML and research

About 45-60 min; PyTorch coding or discussion, depending on the team

ML roles add a round on how large models work in practice. One reported prompt was multi-head attention from scratch in PyTorch with its cost analysis and what FlashAttention saves; another loop labelled the round research without saying what it would cover. Job postings for post-training roles describe two sessions on concrete post-training problems, research or engineering depending on your background. Compiled question lists add KV-cache sizing, continuous batching and debugging a pretraining loss spike.

What it tests

  • Implementing attention and reasoning about its time and memory cost
  • KV-cache size estimates and ways to shrink it
  • Why continuous batching beats static batching for serving
  • Diagnosing training instability at scale
  • Formulating and solving a concrete problem in your own area

How to prepare

  • Be able to write multi-head attention without notes and explain what FlashAttention changes about memory.
  • Do the KV-cache arithmetic for a real model shape on paper until it takes under two minutes.
  • Have a checklist for loss spikes: data batch, learning rate, precision, logit and gradient norms, checkpoint rollback.

Free reported questions for this stage

Three reports mention an ML or research round, one with attention from scratch in PyTorch; xAI's own postings for model roles describe two technical sessions on concrete LLM problems.

05System design

About 45-60 min, open discussion; some loops pair it with coding back to back or ask you to implement part of it

Reported prompts lean toward real-time and infrastructure systems: a websocket chat service, a training job queue with priorities and preemption, a rate limiter with compound rules. Compiled lists add serving a chat assistant to a huge user base, a chatbot over a live post stream and pretraining pipelines that survive constant hardware failure. One candidate was rejected on this round alone.

What it tests

  • Scoping a deliberately vague prompt
  • Back-of-envelope sizing for requests, tokens, GPUs and memory
  • Real-time delivery, queueing and fault tolerance
  • Serving trade-offs: batching, latency, model tiers
  • Turning part of the design into working code

How to prepare

  • Clarify assumptions in the first few minutes; prompts are often intentionally open.
  • Lead with numbers: requests per second, tokens per reply, memory per user, and the fleet they imply.
  • Prepare one serving design and one training-infrastructure design you can adapt quickly.

Four technical-staff and AI-engineer reports from 2025-2026 include a design or distributed-systems round; ML-specific prompts come from compiled lists.

06Project deep dive or research talk

Short presentation, about 15-20 min in reports, or a deep-dive interview on your own work; position in the loop varies

Most loops spend real time on work you did. Some run it as a separate talk after the technical rounds, some as a project showcase before an onsite, and some as the technical screen itself. PhD candidates report research discussions about their thesis. Interviewers probe what you personally did, the hardest problems you hit and what did not work.

What it tests

  • Clear problem statement and why it matters
  • Your specific contribution versus the team's
  • The hardest technical challenge and how you solved it
  • Honest discussion of what did not work

How to prepare

  • Build the talk from your statement of exceptional work; every claim in it can be probed.
  • Fit the talk into 15 minutes with room for questions and practise it out loud.
  • Bring one slide of results and one of failures or open questions; both get asked about.

Three reports describe a talk or project deep dive and two more PhD research discussions; xAI's own postings list presenting your past work to a small audience.

07Final conversation

Hiring-manager or senior-leader interview; some teams hold an in-person onsite with collaborative work

The last step varies by team: a conversation about the role, an in-person executive interview, or an onsite day working on a problem with the team. Motivation, pace and ownership come up here and in the screen; only one report mentions a separate behavioral interview.

What it tests

  • Why xAI specifically, and what you want to build
  • Ownership and speed of shipping
  • How you work in an intense, fast-moving, in-office team

How to prepare

  • Have a specific answer to why xAI that links your past work to what the team ships.
  • Recent postings ask whether you can work on site five days a week; settle that before the final round.

Three reports describe a closing step: a role chat plus behavioral, an in-person executive interview, an in-person onsite; one xAI posting lists a meet and greet with the wider team, other postings say all rounds are online.

Questions and themes reported most often

  • Deep dive or short talk on your own project, PhD or research (7 reports, project deep dive or research talk)
  • Dynamic batching or request queueing around an LLM inference loop (2 reports, technical rounds: practical coding)
  • In-memory key-value database with nested transactions (2 reports, technical rounds: practical coding)
  • Rate limiter from a vague prompt, then compound or token-aware rules (2 reports, system design)
  • Stateful or nested-list iterator with explicit state (2 reports, technical rounds: practical coding)
  • Chat service at scale: websocket delivery, live search, huge user base (2 reports, system design)
  • LRU or LFU cache with O(1) operations (2 reports, technical rounds: practical coding)
  • Find bad GPU nodes with node-disjoint group tests in parallel rounds (1 reports, technical rounds: practical coding)

What xAI asks about

  • Practical coding40%
  • LLM inference & training infra20%
  • Project deep dive & research talk15%
  • ML / LLM system design15%
  • ML & LLM concepts10%

xAI interview prep checklist

  • Wrote a dynamic-batching decode loop that refills slots and keeps outputs matched to requests
  • Solved the GPU group-testing problem and can explain its round complexity
  • Built a trie tokenizer and a transactional key-value store from scratch under time pressure
  • Can write multi-head attention and size a KV cache without notes
  • Designed a real-time chat or job-queue system with numbers and failure handling
  • Have a 15-minute talk on one project, with your own contribution and failures made clear
  • Have a specific, honest answer to why xAI and how you handle a demanding, on-site pace

Tips

  • Write the statement of exceptional work as if it will be cross-examined: one hard project, your own decisions, and measured results.
  • Prioritize LLM-infrastructure coding: batched decoding with slot refill, tokenizers and cluster health checks are the most distinctive reported problems.
  • Drill classic stateful designs (transactional key-value store, LRU cache, iterator, rate limiter) until you can extend them on request.
  • Practise reading an unfamiliar 100-line class quickly and filling in a missing method without tests.
  • Prepare one project story at three lengths: 30 seconds, 5 minutes and a 15-minute talk.
  • Expect little warning about round content; prepare broadly rather than guessing from the round title.
  • Know the numbers behind large-model serving and training: KV-cache size, tokens per second, failure rates and checkpoint cost.
  • Plan for a fast schedule; technical rounds can follow the screen within a day or two.

See the rest of the xAI loop

The later stages, the questions reported for them and how to prepare are in Pro.

Unlock with Pro

Practice the xAI loop

Work the stages in order: every reported question for this company, grouped by round, with solutions in the app.

xAI interview FAQ

How many interview rounds does xAI have for ML roles?

Candidates report 7 stages: Online assessment (some tracks), Engineer screen, Technical rounds: practical coding, Technical rounds: ML and research, System design, Project deep dive or research talk and Final conversation. An application with a CV and a written statement of exceptional work, a 15-30 minute screen with an engineer, researcher or hiring manager, then two to four technical rounds of about 45-60 minutes that are often booked within days of each other. Rounds mix practical coding, an ML or research round for ML roles, and system design, and most loops include a deep dive or short talk on your own work. Some tracks start with a timed online test, and some teams finish in person. Few reports exist, teams differ, and round content is often not announced ahead of time.

How long does the xAI ML interview process take?

Reported timelines run 1-4 weeks.

What does xAI ask in ML interviews?

By reported question mix: Practical coding 40%; LLM inference & training infra 20%; Project deep dive & research talk 15%; ML / LLM system design 15%; ML & LLM concepts 10%. The most repeated themes: Deep dive or short talk on your own project, PhD or research; Dynamic batching or request queueing around an LLM inference loop; In-memory key-value database with nested transactions.

How should I prepare for the xAI ML interview?

Write the statement of exceptional work as if it will be cross-examined: one hard project, your own decisions, and measured results. Prioritize LLM-infrastructure coding: batched decoding with slot refill, tokenizers and cluster health checks are the most distinctive reported problems. Drill classic stateful designs (transactional key-value store, LRU cache, iterator, rate limiter) until you can extend them on request.

Are there free xAI interview questions?

Yes. LeetML has 23 questions reported from xAI interviews, and 4 of them are free to solve in the browser; they are listed by stage above.

Related interview guides

Official sources