Twitter Coding Interview Questions: 25 Tagged Problems
25 coding problems tagged Twitter — 5 easy · 14 medium · 6 hard — with solutions in 13 languages. Plus a 3-week study plan by topic.
- Problems: 25
- By difficulty: 5 easy · 14 medium · 6 hard
- Languages: JavaScript, TypeScript, Python, Java, C++, C, C#, Go, Kotlin, Swift, Rust, PHP and Ruby
- Cost: Free on every plan; sign in to run and submit
25 problems the CodeKairo catalogue tags as commonly asked in Twitter's coding rounds — 5 easy, 14 medium and 6 hard — each judged by hidden tests in 13 languages. The most common topics among them are Arrays (11), Strings (9) and Hash Table (8). Tagged for Twitter and no other company: Tweet Counts Per Frequency, Finding the Users Active Minutes and Pascal's Triangle. The tag is the catalogue's own annotation of where a problem tends to come up — not a list published by Twitter, which CodeKairo is not affiliated with.
Twitter study plan by topic
All 25 problems tagged Twitter over 3 weeks, about 14 h 50 min of solving, grouped by technique in the order they build on each other — Strings, Hash Table, Counting and Two Pointers and 14 more.
Week 1: Strings, Hash Table, Counting +5
10 problems on Strings, Hash Table, Counting, Two Pointers, Stack, Queue, Simulation and Intervals, easiest first within each topic.
- Masking Personal Information Medium
- Finding the Users Active Minutes Medium
- Minimum Number of Steps to Make Two Strings Anagram Medium
- Happy Number Easy
- Valid Parentheses Easy
- Remove All Occurrences of a Substring Medium
- Trapping Rain Water Hard
- Time Needed to Buy Tickets Easy
- Multiply Strings Medium
- Merge Intervals Medium
Week 2: Greedy, Divide and Conquer, Heap +4
11 problems on Greedy, Divide and Conquer, Heap, Ordered Set, Bit Manipulation, Backtracking and Breadth-First Search, easiest first within each topic.
- Integer to Roman Medium
- Minimum Elements to Add to Form a Given Sum Medium
- Wildcard Matching Hard
- The Skyline Problem Hard
- Kth Smallest Element in a Sorted Matrix Medium
- Process Tasks Using Servers Medium
- Trapping Rain Water II Hard
- Tweet Counts Per Frequency Medium
- Binary Gap Easy
- Word Break II Hard
- Minimum Genetic Mutation Medium
Week 3: Union Find, Dynamic Programming, Geometry
4 problems on Union Find, Dynamic Programming and Geometry, easiest first within each topic.
All problems tagged Twitter
Easy (5)
- Binary Gap Bit Manipulation
- Time Needed to Buy Tickets Array, Queue, Simulation
- Happy Number Hash Table, Math, Two Pointers
- Pascal's Triangle Array, Dynamic Programming
- Valid Parentheses String, Stack
Medium (14)
- Tweet Counts Per Frequency Hash Table, Binary Search, Sorting
- Finding the Users Active Minutes Array, Hash Table
- Masking Personal Information String
- Minimum Elements to Add to Form a Given Sum Array, Greedy
- Process Tasks Using Servers Array, Simulation, Heap (Priority Queue)
- Minimum Genetic Mutation Hash Table, String, Breadth-First Search
- Count Sub Islands Array, Depth-First Search, Breadth-First Search
- Number of Connected Components in an Undirected Graph Depth-First Search, Breadth-First Search, Union Find
- Remove All Occurrences of a Substring String, Stack, Simulation
- Kth Smallest Element in a Sorted Matrix Array, Binary Search, Sorting
- Minimum Number of Steps to Make Two Strings Anagram Hash Table, String, Counting
- Integer to Roman Hash Table, Math, String
- Merge Intervals Array, Sorting, Intervals
- Multiply Strings String, Math, Simulation
Hard (6)
- The Skyline Problem Array, Divide and Conquer, Heap (Priority Queue)
- Word Break II Hash Table, String, Dynamic Programming
- Trapping Rain Water II Array, Matrix, Heap (Priority Queue)
- Max Points on a Line Hash Table, Math, Geometry
- Wildcard Matching String, Dynamic Programming, Greedy
- Trapping Rain Water Array, Two Pointers, Dynamic Programming
Topics Twitter asks most
- Arrays 11 problems
- Strings 9 problems
- Hash Table 8 problems
- Math 4 problems
- Simulation 4 problems
- Heap 4 problems
- Breadth-First Search 4 problems
- Dynamic Programming 4 problems
- Sorting 3 problems
- Stack 3 problems
- Matrix 3 problems
- Greedy 3 problems