Took the xAI online assessment last month while still employed. Here's the breakdown since I couldn't find much info when I was prepping.
The OA was two coding problems, 90 minutes total. Platform was CoderPad. No custom platform or proctoring software, just CoderPad with a shared link.
Problem types: One was a graph problem (shortest path variant, BFS/Dijkstra territory). The second was a string manipulation problem that had an interesting twist, not just a direct LeetCode medium copy. They'd added a constraint that required you to think about the problem differently than the obvious O(n^2) approach.
Difficulty: Honestly both were LeetCode medium to medium-hard. Not hard. The graph one was straightforward if you're comfortable with BFS. The string one tripped me up for about 20 minutes because I went down the wrong path first.
Language: I used Python. They seemed fine with any mainstream language.
Did it matter if I was perfect? I solved both but my second solution had a minor edge-case bug I caught and fixed with about 10 minutes left. I moved forward, so I think the bar is solving cleanly, not having the perfect time complexity discussion on every line.
After the OA there was a technical phone screen before the onsite. The phone screen had one coding problem (also medium difficulty) plus some general technical discussion about systems and tradeoffs. That was with an engineer, not a recruiter.
Total timeline from OA invite to onsite invite was about 3 weeks. They're not slow movers.
For prep: LC medium is probably the right target. I'd specifically focus on graphs, string problems, and dynamic programming. I didn't see any tree problems but I'd still keep those warm.