Twitter Interview Prep (SWE / MLE)
This is the one page on this site where the honest answer is that there is no standard loop. Post-2022 reports conflict irreconcilably. One first-person account describes an intro call, a coding round and a three-round onsite completed in a single week. Another describes roughly six interviews over several months, STAR behaviourals throughout, ending in a candidate presentation.
What the reports agree on is the cause: hiring manager autonomy. Round count, duration, format and even whether there is a presentation appear to be set by the team rather than by a central process. If anything is characteristic it is the practical format some teams use, where you rebuild a real product feature in the team’s own stack instead of solving an abstract algorithm.
Interview Process
| Stage | Duration | Focus |
|---|---|---|
| Intro Round | ~30 min | Background and role fit |
| Coding Round | 45-60 min | Live coding. LeetCode medium to hard, sometimes two problems |
| Onsite | 45-60 min each | ~3 rounds, technical and team dependent. Remote is reported as possible |
The table above is the leaner of two incompatible reported patterns and should not be treated as the process. The other runs to about six interviews over several months and finishes with a presentation you prepare. Both come from credible candidate accounts, and there is no way to reconcile them.
System design is reported as heavily weighted for mid-level and senior candidates. Scala and Java were historically the backend languages; current expectations appear team-specific, and one report describes being asked to rebuild an Android feature in Kotlin live.
A practical warning on research: searching for X careers surfaces X Development, Alphabet’s moonshot lab, and xAI, which are different companies. Candidate reports get conflated across all three. Discount anything that does not clearly name X Corp.
What Twitter Actually Tests
Derived from 51 reported Twitter-tagged problems. Difficulty mix:
| Difficulty | Count | Share |
|---|---|---|
| Easy | 8 | 16% |
| Medium | 31 | 61% |
| Hard | 12 | 24% |
Hard problems are a real but minority share. Medium fluency wins most rounds; Hard shows up late in the loop.
Where those problems fall by pattern:
| Rank | Pattern | Problems | Share of list |
|---|---|---|---|
| 1 | Arrays & Hashing | 11 | 22% |
| 2 | Design (Coding) | 7 | 14% |
| 3 | Strings | 5 | 10% |
| 4 | Heap / Priority Queue | 5 | 10% |
| 5 | Dynamic Programming | 5 | 10% |
| 6 | Graphs | 4 | 8% |
| 7 | Trees | 3 | 6% |
| 8 | Stack & Monotonic Stack | 3 | 6% |
| 9 | Math & Bit Manipulation | 2 | 4% |
| 10 | Sliding Window & Two Pointers | 2 | 4% |
Twitter Signature Problems
These rank high on Twitter’s list but are reported by few other companies — the questions that are distinctively theirs rather than generic interview classics. The last column is how many of the 142 companies on this site report each one.
| # | Problem | Pattern | Difficulty | Also asked at | Link |
|---|---|---|---|---|---|
| 1 | Finding the Users Active Minutes | Hash Table + Array | Medium | 2 of 142 | LeetCode → |
| 2 | Masking Personal Information | String | Medium | 2 of 142 | LeetCode → |
| 3 | Flatten 2D Vector | Iterator + Design | Medium | 3 of 142 | LeetCode → |
| 4 | Tweet Counts Per Frequency | Ordered Set + Design | Medium | 3 of 142 | LeetCode → |
| 5 | Count Sub Islands | Union-Find + BFS | Medium | 5 of 142 | LeetCode → |
| 6 | Process Tasks Using Servers | Heap | Medium | 4 of 142 | LeetCode → |
| 7 | Binary Gap | Bit Manipulation | Easy | 6 of 142 | LeetCode → |
| 8 | Design Authentication Manager | Doubly Linked List + Design | Medium | 7 of 142 | LeetCode → |
| 9 | Design Skiplist | Linked List + Design | Hard | 7 of 142 | LeetCode → |
| 10 | Minimum Genetic Mutation | Bidirectional Search + BFS | Medium | 6 of 142 | LeetCode → |
| 11 | Number of Black Blocks | Enumeration + Hash Table | Medium | 7 of 142 | LeetCode → |
| 12 | Number of Connected Components in an Undirected Graph | Union-Find + Graph | Medium | 7 of 142 | Solve → |
| 13 | One Edit Distance | Two Pointers | Medium | 7 of 142 | Solve → |
| 14 | Permutation Sequence | Recursion + Math | Hard | 6 of 142 | LeetCode → |
If you are short on time, these carry more Twitter-specific signal per hour than the universal top-100 lists.
System Design (HLD) Problems Asked at Twitter
| # | Problem | Difficulty | Link |
|---|---|---|---|
| 1 | Twitter Feed and Timeline | Advanced | Read → |
| 2 | Trending Topics | Advanced | Read → |
| 3 | Notification System | Intermediate | Read → |
| 4 | Search Autocomplete | Intermediate | Read → |
| 5 | Chat System (Direct Messages) | Intermediate | Read → |
| 6 | Rate Limiter (API Quotas) | Beginner | Read → |
| 7 | Unique ID Generator (Snowflake IDs) | Intermediate | Read → |
| 8 | Distributed Cache | Advanced | Read → |
LLD / Machine Coding Problems Asked at Twitter
If you draw the practical variant, the useful preparation is building a small feature end to end in an unfamiliar stack under time pressure. These are the models closest to what the product actually does.
| # | Problem | Difficulty | Link |
|---|---|---|---|
| 1 | Pub Sub System (Fan-out) | Intermediate | Read → |
| 2 | Multilevel Cache | Intermediate | Read → |
| 3 | Rate Limiter | Beginner | Read → |
| 4 | Task Scheduler | Advanced | Read → |
DSA Problems Asked at Twitter
49 problems across 11 pattern groups. Each group is allocated in proportion to its real share of Twitter’s tagged list, then filled with the highest-frequency problems in that group — so the weight here matches the distribution above rather than burying graph and tree work under the usual array classics.
Arrays & Hashing
Prefix sums, counting, and grid walks. The warm-up round, and the one people get careless on. All 11 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 1 | Best Meeting Point | Matrix + Math | Hard | Solve → |
| 2 | Count Student Number in Departments | Implementation | Medium | LeetCode → |
| 3 | Customer Placing the Largest Number of Orders | Database | Easy | LeetCode → |
| 4 | Finding the Users Active Minutes | Hash Table + Array | Medium | LeetCode → |
| 5 | Invalid Tweets | Database | Easy | LeetCode → |
| 6 | Investments in 2016 | Database | Medium | LeetCode → |
| 7 | Minimum Elements to Add to Form a Given Sum | Implementation | Medium | LeetCode → |
| 8 | Number of Black Blocks | Enumeration + Hash Table | Medium | LeetCode → |
| 9 | Permutation Sequence | Recursion + Math | Hard | LeetCode → |
| 10 | Rectangles Area | Implementation | Medium | LeetCode → |
| 11 | Tree Node | Database | Medium | LeetCode → |
Design (Coding)
Build a data structure to a spec. Graded on API shape and the complexity of each operation, not just correctness. All 7 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 12 | Design Authentication Manager | Doubly Linked List + Design | Medium | LeetCode → |
| 13 | Design Skiplist | Linked List + Design | Hard | LeetCode → |
| 14 | Design Twitter | Linked List + Design | Medium | LeetCode → |
| 15 | Flatten 2D Vector | Iterator + Design | Medium | LeetCode → |
| 16 | Insert Delete GetRandom O(1) | Randomized + Design | Medium | LeetCode → |
| 17 | LRU Cache | Doubly Linked List + Design | Medium | Solve → |
| 18 | Tweet Counts Per Frequency | Ordered Set + Design | Medium | LeetCode → |
Dynamic Programming
State definition is the whole battle. Say the recurrence out loud before you write the table. All 5 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 19 | Pascal’s Triangle | DP | Easy | Solve → |
| 20 | Regular Expression Matching | DP | Hard | Solve → |
| 21 | Trapping Rain Water | Monotonic Stack + Two Pointers | Hard | Solve → |
| 22 | Wildcard Matching | Greedy + DP | Hard | Solve → |
| 23 | Largest Plus Sign | DP | Medium | LeetCode → |
Heap / Priority Queue
Top-k, streaming medians, and scheduling. Usually the difference between a passing and a timing-out solution. All 5 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 24 | Kth Smallest Element in a Sorted Matrix | Heap + Binary Search | Medium | Solve → |
| 25 | Merge k Sorted Lists | Tournament Sort + Merge Sort | Hard | Solve → |
| 26 | Process Tasks Using Servers | Heap | Medium | LeetCode → |
| 27 | Trapping Rain Water II | Heap + BFS | Hard | Solve → |
| 28 | Minimum Cost to Connect Sticks | Heap + Greedy | Medium | LeetCode → |
Strings
Parsing, transformation, and in-place edits. Clarify the character set and whitespace rules before you start. All 5 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 29 | Integer to Roman | Math + Hash Table | Medium | Solve → |
| 30 | Masking Personal Information | String | Medium | LeetCode → |
| 31 | Minimum Number of Steps to Make Two Strings Anagram | Counting + Hash Table | Medium | Solve → |
| 32 | Multiply Strings | Simulation + Math | Medium | Solve → |
| 33 | Validate IP Address | String | Medium | LeetCode → |
Graphs
Traversal, connectivity, ordering, and shortest paths. The hardest bucket to fake — either you have drilled it or you have not. All 4 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 34 | Alien Dictionary | DAG + Topological Sort | Hard | Solve → |
| 35 | Count Sub Islands | Union-Find + BFS | Medium | LeetCode → |
| 36 | Minimum Genetic Mutation | Bidirectional Search + BFS | Medium | LeetCode → |
| 37 | Number of Connected Components in an Undirected Graph | Union-Find + Graph | Medium | Solve → |
Trees
Recursion discipline: what you return up, what you pass down. Follow-ups usually push from recursive to iterative. All 3 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 38 | Flatten Nested List Iterator | Iterator + Queue | Medium | Solve → |
| 39 | Lowest Common Ancestor of a Binary Search Tree | Lowest Common Ancestor + Binary Lifting | Medium | Solve → |
| 40 | The Skyline Problem | Sweep Line + Fenwick Tree | Hard | Solve → |
Stack & Monotonic Stack
Nearest-greater, parsing, and span problems. The monotonic variant is the one people miss. All 3 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 41 | Remove All Occurrences of a Substring | Stack | Medium | Solve → |
| 42 | Time Needed to Buy Tickets | Queue | Easy | LeetCode → |
| 43 | Valid Parentheses | Bracket Sequences + Stack | Easy | Solve → |
Tries & String Search
Prefix structures and substring matching. Common wherever autocomplete or search is part of the product. All 2 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 44 | Implement Trie (Prefix Tree) | Trie + Design | Medium | Solve → |
| 45 | Word Break II | Memoization + Trie | Hard | LeetCode → |
Sliding Window & Two Pointers
Linear-time scans over arrays and strings. High volume, low variance — these should be automatic. All 2 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 46 | Happy Number | Floyd Cycle + Two Pointers | Easy | Solve → |
| 47 | One Edit Distance | Two Pointers | Medium | Solve → |
Math & Bit Manipulation
Number theory, geometry, and bit tricks. Short to write, easy to get subtly wrong on overflow and sign. All 2 on the list.
| # | Problem | Pattern | Difficulty | Link |
|---|---|---|---|---|
| 48 | Binary Gap | Bit Manipulation | Easy | LeetCode → |
| 49 | Max Points on a Line | Euclidean Algorithm + GCD | Hard | Solve → |
Twitter’s Favourite Patterns (Ranked)
| Rank | Pattern | Frequency | Problems on list | Start with |
|---|---|---|---|---|
| 1 | Arrays & Hashing | Very High | 11 (22%) | Best Meeting Point, Count Student Number in Departments, Customer Placing the Largest Number of Orders |
| 2 | Design (Coding) | High | 7 (14%) | Design Authentication Manager, Design Skiplist, Design Twitter |
| 3 | Dynamic Programming | High | 5 (10%) | Pascal’s Triangle, Regular Expression Matching, Trapping Rain Water |
| 4 | Heap / Priority Queue | Medium-High | 5 (10%) | Kth Smallest Element in a Sorted Matrix, Merge k Sorted Lists, Process Tasks Using Servers |
| 5 | Strings | Medium-High | 5 (10%) | Integer to Roman, Masking Personal Information, Minimum Number of Steps to Make Two Strings Anagram |
| 6 | Graphs | Medium-High | 4 (8%) | Alien Dictionary, Count Sub Islands, Minimum Genetic Mutation |
| 7 | Trees | Medium | 3 (6%) | Flatten Nested List Iterator, Lowest Common Ancestor of a Binary Search Tree, The Skyline Problem |
| 8 | Stack & Monotonic Stack | Medium | 3 (6%) | Remove All Occurrences of a Substring, Time Needed to Buy Tickets, Valid Parentheses |
| 9 | Tries & String Search | Medium | 2 (4%) | Implement Trie (Prefix Tree), Word Break II |
| 10 | Sliding Window & Two Pointers | Medium | 2 (4%) | Happy Number, One Edit Distance |
How to read this: the top three rows are where your preparation hours should go. A candidate fluent in Arrays & Hashing, Design (Coding), Dynamic Programming covers the bulk of what Twitter actually asks. The rest is insurance for the one round that goes somewhere unexpected.
Behavioural Round
| # | Question |
|---|---|
| 1 | Walk me through the most technically demanding thing on your resume. |
| 2 | Tell me about shipping something on a compressed timeline. |
| 3 | Describe a time you took ownership of something outside your remit. |
| 4 | Tell me about a decision you made that turned out wrong. |
| 5 | How do you operate when priorities change week to week? |
| 6 | Describe disagreeing with your manager and what happened. |
| 7 | Why X? |
14-Day Prep Plan
Built from the pattern ranking above, so the heaviest topics get the most time.
| Day | Focus | Problems |
|---|---|---|
| 1 | Arrays & Hashing (part 1) | Best Meeting Point, Count Student Number in Departments, Customer Placing the Largest Number of Orders |
| 2 | Arrays & Hashing (part 2) | Finding the Users Active Minutes, Invalid Tweets, Investments in 2016 |
| 3 | Design (Coding) (part 1) | Design Authentication Manager, Design Skiplist, Design Twitter |
| 4 | Design (Coding) (part 2) | Flatten 2D Vector, Insert Delete GetRandom O(1), LRU Cache |
| 5 | Dynamic Programming | Pascal’s Triangle, Regular Expression Matching, Trapping Rain Water |
| 6 | Heap / Priority Queue | Kth Smallest Element in a Sorted Matrix, Merge k Sorted Lists, Process Tasks Using Servers |
| 7 | Strings | Integer to Roman, Masking Personal Information, Minimum Number of Steps to Make Two Strings Anagram |
| 8 | Graphs | Alien Dictionary, Count Sub Islands, Minimum Genetic Mutation |
| 9 | Trees | Flatten Nested List Iterator, Lowest Common Ancestor of a Binary Search Tree, The Skyline Problem |
| 10 | Stack & Monotonic Stack | Remove All Occurrences of a Substring, Time Needed to Buy Tickets, Valid Parentheses |
| 11 | Tries & String Search | Implement Trie (Prefix Tree), Word Break II |
| 12 | Mock round | Two problems in 45 minutes, timed, no hints. Simulate the real round. |
| 13 | Revision | Redo the problems you failed or needed a hint on. |
| 14 | Light review + rest | Re-read your pattern notes. Sleep early. |
Tips for Twitter Interviews
- Ask your recruiter for the actual loop before you prepare. This is the one company on this site where the published patterns disagree so sharply that preparing to the wrong one is a real risk. Round count, format and whether there is a presentation are all team decisions.
- Prepare the unique ID generator and the timeline fan-out properly. Snowflake IDs originated here and the timeline is the canonical fan-out problem. Both are fair game and both are well documented.
- Be ready to build rather than solve. Several reports describe implementing a real product feature live in the team’s language. That rewards fluency in a stack over pattern recall.
- Do not assume the pre-acquisition process. Reports from before and after 2022 describe different companies. Treat older guides as historical.
- Weight system design heavily if you are mid-level or senior. It is the one element reported consistently across otherwise incompatible accounts.
- Prepare STAR answers properly in case you draw the long loop. One reported pattern runs behavioural questions through all six interviews and ends with a presentation, which is a completely different preparation task from a one-week coding loop.
Other Company Prep
- Meta Interview Prep →
- Reddit Interview Prep →
- Snap Interview Prep →
- Pinterest Interview Prep →
- All Company Guides →
- Back to Interview Guide →
Reported loops for X Corp conflict sharply after 2022 and the volume of credible first-person accounts is low. Nothing on this page should be treated as a fixed process, and research is further complicated by name collisions with X Development and xAI. Confirm everything with your recruiter.