xAI technical phone screen interview

Round 3 of 7 · 15 questions reported

See the whole loop
Length
45 min
Format
Live applied coding on a shared platform such as CoderPad
They grade
Complete, bug-free working code; class and object design
AI use
No AI
Heads-up
Typical tasks: caches, key-value stores with TTL, rate limiters, iterators, flattening nested objects. Follow-up extensions are where it gets hard; complexity analysis matters less. Some tracks run three of these in one week, mixing coding, ML coding and a project deep dive.

Questions xAI asks in this round 15

  • Find and fix the races in a bank account classCodingYou are shown a small bank account class used from several threads, with a deposit method that loses updates. Find every concurrency bug, fix it, and explain why your fix is…
    Last asked Sep 2026
  • Greedy longest-match tokenizerCodingImplement a greedy longest-match tokenizer. You are given a string text and a list dictionary. Each entry has the form "<key:<id". key is a non-empty token string and id is its…
    Possibly retired
  • Insert, delete and get random in O(1)CodingDesign a set with insert(val), remove(val) and getrandom(), each in average O(1) time. getrandom returns each current element with equal probability.
    Possibly retired
  • Find bad GPU nodes with group testsCodingA cluster has n GPU nodes with ids 0 to n - 1. Each node is either good or bad, and you do not know which in advance. The only way to learn anything is a test service: A failing…
    Last asked Sep 2026
  • Inference loop with continuous batching over a mock modelCodingYou get a model function that takes a batch of sequences and returns one next token for each. Write the serving loop: keep a fixed number of batch slots full, retire a sequence…
    Last asked Sep 2026
  • Courier pay from order eventsCodingA delivery courier is paid for active time. You receive the events of their orders (for example accepted and delivered, with timestamps) as if from an upstream service. Compute…
    Last asked Mar 2026
  • Flatten and rebuild nested Python containersCodingGiven an arbitrarily nested mix of lists, tuples and dicts with integer leaves, produce a flat list of the integers in order. Then, given the original structure and a new flat…
    Last asked Mar 2026
  • Pluggable hierarchical rate limiterCodingDesign a rate limiter with hierarchical limits (user, team, global) whose limit rules are pluggable without changing the core. Reported on 1point3acres' Cursor bank; reconstructed…
    Last asked Feb 2026
  • Implement an LRU cacheCodingImplement a least-recently-used cache with get(key) and put(key, value), both in O(1) time, with a fixed capacity.
    Last asked Feb 2026
  • House price predictionML designHow would you build a model that predicts house prices? Cover the features, handling missing values and outliers, model choice (from linear regression to gradient-boosted trees)…
    Possibly retired
  • Valid palindrome and its variantsCodingDecide whether a string is a palindrome after ignoring case and anything that is not a letter or digit. Then solve variants: allow deleting at most one character, or check without…
    Possibly retired