Xai Coding & Algorithms Interview Questions
Practice the exact questions companies are asking right now.
Explain strings, moves, and concurrency
Question What is a string in programming languages? What fields are stored in a typical struct string and how would you implement one yourself? What i...
Explain and Implement Strings
Question What is a string in programming languages? Inside a struct string{} in Rust, what fields are stored and how would you design and implement on...
Identify all bad nodes with group tests
You have N nodes. Each node is either good or bad (unknown to you). You can call a function test(S) on a subset of nodes S: - test(S) = True iff all n...
Implement dynamic batching for token decoding
You are given a black-box “simulated language model” interface that can advance many sequences in a batch. Model interface - Tokens are integers. - mo...
Design O(1) random-sampling set
Design a data structure that supports insert(x), remove(x), and get_random() that returns a uniformly random element among the present items, all in e...
Define and compare smart pointers
What is a smart pointer? How do smart pointers manage ownership and lifetimes compared with raw pointers? Describe common types (unique, shared, weak)...
Explain arrays and memory layout
What is an array? How is an array represented in memory (contiguous layout, element size and alignment, indexing arithmetic). Analyze time complexitie...
Contrast processes and threads
What are the differences between processes and threads? Compare memory isolation, resource ownership, scheduling, context-switch cost, inter-process c...
Validate normalized palindromes with variants
Implement a function isNormalizedPalindrome(s) that returns true if s reads the same forward and backward after removing non‑alphanumeric characters a...