0 day streak

X (Twitter) coding interview questions

Big techProduct Global

Ranked by how often candidates report them. Each opens in the editor with hidden tests, an animated walkthrough and solutions in four languages; a question you solve once counts for every company that asks it.

0%ready
Your level: practise every reported question.
ProgressTitleDifficultyTopicHow often hereAlso asked atNext step
Design TwitterMerge K Sorted Medium Heaps Amazon, Okta, Palo Alto Networks +5 Solve
LRU CacheLinked Lists Medium Design Data Structures Google, Amazon, Microsoft +140 Solve
Merge IntervalsBasics Medium Intervals Google, Amazon, Microsoft +107 Solve
Trapping Rain WaterTwo Pointer Hard Arrays & Hashing Google, Amazon, Microsoft +88 Solve
Flatten Nested List IteratorStack Medium Design Data Structures LinkedIn, Airbnb, Tesla +7 Solve
Line ReflectionHash Set Lookup Medium Arrays & Hashing Yandex, Micron Technology, Brex +1 Solve
Design HashMapPre-processing + tradeoffs Easy Design Data Structures Apple, Nvidia, Snowflake +25 Solve
Regular Expression MatchingStrings Hard Dynamic Programming Microsoft, Airbnb, Snowflake +17 Solve
Minimum Cost to Connect SticksTop K / Kth Largest / Smallest Medium Heaps Google, JPMorgan Chase, UBS +8 Solve
Number of Black BlocksHashing Medium Arrays & Hashing Stripe, Visa, Block (Square) +2 Solve
Integer to RomanGreedy Medium Arrays & Hashing DoorDash, Booking.com, Zillow +21 Solve
Valid ParenthesesStack Basics Easy Stack Google, Amazon, Microsoft +119 Solve
Merge k Sorted ListsMerge K Sorted Hard Heaps Google, Amazon, Microsoft +59 Solve
Multiply StringsRight to Left Traversal Medium Arrays & Hashing Pinterest, Zillow, Palo Alto Networks +9 Solve
Wildcard MatchingStrings Hard Dynamic Programming Snap, Instacart, TikTok (ByteDance) +11 Solve
Pascal's Triangle1D DP Easy Dynamic Programming Bloomberg, Epic Games, JPMorgan Chase +7 Solve
Word Break IIChoice per Position Hard Recursion & Backtracking Bloomberg, Snap, Booking.com +12 Solve
Max Points on a LineHashing Hard Arrays & Hashing Uber, LinkedIn, Waymo +4 Solve
One Edit DistanceTwo Pointer Medium Arrays & Hashing Stripe, Snap, Yandex Solve
Happy NumberSlow Fast Pointers Easy Linked List Airbnb, Snowflake, Tesla +11 Solve
Reverse Linked ListFront Middle Back Pointer Easy Linked List Microsoft, Apple, Bloomberg +81 Solve
Implement Trie (Prefix Tree)Basics Medium Tries Google, Microsoft, Meta +25 Solve
The Skyline ProblemAdvanced Hard Heaps Google, Microsoft, Yelp +3 Solve
Lowest Common Ancestor of a Binary Search TreeLCA Medium Trees & BST Meta, LinkedIn, Reddit +8 Solve
Flatten 2D VectorPre-processing + tradeoffs Medium Design Data Structures Airbnb, Lyft Solve
Alien DictionaryTopological Sort Hard Graphs Google, Amazon, Microsoft +20 Solve
Best Meeting PointMatrix Traversal Hard Arrays & Hashing Google, DoorDash, Snap +1 Solve
Design SkiplistRandomized Algorithms Hard Design Data Structures eBay, Arista Networks, Optiver +1 Solve
Kth Smallest Element in a Sorted MatrixBinary Search on Answer Space Medium Binary Search OpenAI, Chewy, Brex +4 Solve
Insert Delete GetRandom O(1)Hash Map + Array Medium Design Data Structures Google, Amazon, Apple +50 Solve
Trapping Rain Water IIAdvanced Hard Heaps Google, Palantir, Adobe +5 Solve
Minimum Number of Steps to Make Two Strings AnagramHashing Medium Arrays & Hashing Bloomberg, DoorDash, Akamai +7 Solve
Validate IP AddressSimulation Medium Arrays & Hashing Meta, Nvidia, Yahoo +14 Solve
Design Authentication ManagerHash Map + Heap Medium Design Data Structures OpenAI, Confluent, IBM +1 Solve
Remove All Occurrences of a SubstringStack Basics Medium Stack Arista Networks, Klarna, Charles Schwab +3 Solve
Count Sub IslandsMatrix Graphs Medium Graphs Zepto Solve
Sudoku Solver2D Matrix Backtracking Hard Recursion & Backtracking Microsoft, DoorDash, Snap +12 Solve
Product of Array Except SelfRight to Left Traversal Medium Arrays & Hashing Amazon, Microsoft, Meta +37 Solve
Longest Palindromic SubstringStrings Medium Dynamic Programming Amazon, Microsoft, Apple +68 Solve
Convert Sorted List to Binary Search TreeTree to Lists and vice-versa Medium Trees & BST Apple, Lyft, Salesforce +2 Solve
Middle of the Linked ListSlow Fast Pointers Easy Linked List Apple, Nvidia, Qualcomm +29 Solve
Find First and Last Position of Element in Sorted ArrayBisect Medium Binary Search Meta, LinkedIn, Nvidia +29 Solve
Two SumTwo Sum Easy Arrays & Hashing Google, Amazon, Microsoft +135 Solve
Also reported, being added to AlgoRung (11)

Minimum Genetic Mutation · Tweet Counts Per Frequency · Largest Plus Sign · Masking Personal Information · Permutation Sequence · Time Needed to Buy Tickets · Number of Connected Components in an Undirected Graph · Minimum Elements to Add to Form a Given Sum · Binary Gap · Finding the Users Active Minutes · Process Tasks Using Servers

Questions people ask

What coding questions does X (Twitter) ask most?

Design Twitter, LRU Cache, Merge Intervals, Trapping Rain Water, Flatten Nested List Iterator, Line Reflection, Design HashMap, Regular Expression Matching.

Which topics come up in X (Twitter) coding rounds?

design data structure, graphs, strings, intervals, heaps, dynamic programming.

How hard are X (Twitter) coding questions?

Of the reported questions, 7 are easy, 24 medium and 12 hard. A 45 to 60 minute live interview where you solve one or two data-structures-and-algorithms problems while explaining your thinking. Interviewers score problem solving, code quality, testing and communication.