How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent X interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Problem database last updated: June 20, 2025
45 problems · 8 Easy, 27 Medium, 10 Hard · Ranked #47 of 458
8 Easy
18% · avg 23%
27 Medium
60% · avg 59%
10 Hard
22% · avg 18%
Based on 45 reported problems, X interviews are slightly harder than average - 22% Hard vs 18% across all companies. The majority (60%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.
Compared to the industry average, X puts unusual emphasis on database (8.9% of problems, 7.9x the industry average), randomized (4.4% of problems, 4.8x the industry average), ordered-set (4.4% of problems, 4.4x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (40%), hash-table (31.1%), string (28.9%), design (17.8%). Problems below are sorted by frequency, the ones at the top are asked most often.
| Problem | Difficulty | Frequency | Topics | |
|---|---|---|---|---|
Insert Delete GetRandom O(1) Implement the RandomizedSet class: | Medium | Very Likely | arrayhash-tablemath | Solve |
Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. | Hard | Very Likely | arraytwo-pointersdynamic-programming | Solve |
Flatten Nested List Iterator You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an... | Medium | Very Likely | stacktreedepth-first-search | Solve |
Design Twitter Design a simplified version of Twitter where users can post tweets, follow/unfollow another user, and is able to see the 10 most recent tweets in the user's new... | Medium | Very Likely | hash-tablelinked-listdesign | Solve |
Implement Trie (Prefix Tree) A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various appl... | Medium | Very Likely | hash-tablestringdesign | Solve |
Merge Intervals Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove... | Medium | Very Likely | arraysorting | Solve |
Tweet Counts Per Frequency A social media company is trying to monitor activity on their site by analyzing the number of tweets that occur in select periods of time. These periods can be... | Medium | Very Likely | hash-tablestringbinary-search | Solve |
Investments in 2016 Table: Insurance | Medium | Very Likely | database | Solve |
LRU Cache Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. | Medium | Very Likely | hash-tablelinked-listdesign | Solve |
Permutation Sequence The set [1, 2, 3, ..., n] contains a total of n! unique permutations. | Hard | Very Likely | mathrecursion | Solve |
Multiply Strings Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. | Medium | Very Likely | mathstringsimulation | Solve |
Regular Expression Matching Given an input string s and a pattern p, implement regular expression matching with support for '.' and '' where: | Hard | Very Likely | stringdynamic-programmingrecursion | Solve |
Remove All Occurrences of a Substring Given two strings s and part, perform the following operation on s until all occurrences of the substring part are removed: | Medium | Very Likely | stringstacksimulation | Solve |
Trapping Rain Water II Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining. | Hard | Very Likely | arraybreadth-first-searchheap-priority-queue | Solve |
Number of Black Blocks You are given two integers m and n representing the dimensions of a 0-indexed m x n grid. | Medium | Very Likely | arrayhash-tableenumeration | Solve |
Max Points on a Line Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line. | Hard | Very Likely | arrayhash-tablemath | Solve |
Validate IP Address Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type. | Medium | Very Likely | string | Solve |
The Skyline Problem A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and heights of... | Hard | Very Likely | arraydivide-and-conquerbinary-indexed-tree | Solve |
Design Authentication Manager There is an authentication system that works with authentication tokens. For each session, the user will receive a new authentication token that will expire tim... | Medium | Very Likely | hash-tablelinked-listdesign | Solve |
Word Break II Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possi... | Hard | Very Likely | arrayhash-tablestring | Solve |
Minimum Number of Steps to Make Two Strings Anagram You are given two strings of the same length s and t. In one step you can choose any character of t and replace it with another character. | Medium | Very Likely | hash-tablestringcounting | Solve |
Count Sub Islands You are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connec... | Medium | Very Likely | arraydepth-first-searchbreadth-first-search | Solve |
Lowest Common Ancestor of a Binary Search Tree Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST. | Medium | Very Likely | treedepth-first-searchbinary-search-tree | Solve |
Time Needed to Buy Tickets There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the line. | Easy | Very Likely | arrayqueuesimulation | Solve |
Process Tasks Using Servers You are given two 0-indexed integer arrays servers and tasks of lengths n and m respectively. servers[i] is the weight of the ith server,... | Medium | Very Likely | arrayheap-priority-queue | Solve |
Kth Smallest Element in a Sorted Matrix Given an n x n matrix where each of the rows and columns is sorted in ascending order, return the kth smallest element in the matrix. | Medium | Very Likely | arraybinary-searchsorting | Solve |
Design Skiplist Design a Skiplist without using any built-in libraries. | Hard | Very Likely | linked-listdesign | Solve |
Finding the Users Active Minutes You are given the logs for users' actions on LeetCode, and an integer k. The logs are represented by a 2D integer array logs where each logs[i] = [IDi, timei] i... | Medium | Very Likely | arrayhash-table | Solve |
Happy Number Write an algorithm to determine if a number n is happy. | Easy | Very Likely | hash-tablemathtwo-pointers | Solve |
Valid Parentheses Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. | Easy | Very Likely | stringstack | Solve |
Pascal's Triangle Given an integer numRows, return the first numRows of Pascal's triangle. | Easy | Very Likely | arraydynamic-programming | Solve |
Reverse Linked List Given the head of a singly linked list, reverse the list, and return the reversed list. | Easy | Very Likely | linked-listrecursion | Solve |
Integer to Roman Seven different symbols represent Roman numerals with the following values: | Medium | Very Likely | hash-tablemathstring | Solve |
Invalid Tweets Table: Tweets | Easy | Very Likely | database | Solve |
Merge k Sorted Lists You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. | Hard | Very Likely | linked-listdivide-and-conquerheap-priority-queue | Solve |
Wildcard Matching Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '' where: | Hard | Very Likely | stringdynamic-programminggreedy | Solve |
Masking Personal Information You are given a personal information string s, representing either an email address or a phone number. Return the masked personal information using the below ru... | Medium | Very Likely | string | Solve |
Minimum Elements to Add to Form a Given Sum You are given an integer array nums and two integers limit and goal. The array nums has an interesting property that abs(nums[i]) <= limit. | Medium | Very Likely | arraygreedy | Solve |
Binary Gap Given a positive integer n, find and return the longest distance between any two adjacent 1's in the binary representation of n. If there are no two adjacent 1'... | Easy | Very Likely | bit-manipulation | Solve |
Customer Placing the Largest Number of Orders Table: Orders | Easy | Very Likely | database | Solve |
Minimum Genetic Mutation A gene string can be represented by an 8-character long string, with choices from 'A', 'C', 'G', and 'T'. | Medium | Very Likely | hash-tablestringbreadth-first-search | Solve |
Tree Node Table: Tree | Medium | Very Likely | database | Solve |
Random Pick with Weight You are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index. | Medium | Sometimes | arraymathbinary-search | Solve |
Rotting Oranges You are given an m x n grid where each cell can have one of three values: | Medium | Sometimes | arraybreadth-first-searchmatrix | Solve |
Number of Islands Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. | Medium | Sometimes | arraydepth-first-searchbreadth-first-search | Solve |
Insert Delete GetRandom O(1)
SolveImplement the RandomizedSet class:
Trapping Rain Water
SolveGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
Flatten Nested List Iterator
SolveYou are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an...
Design Twitter
SolveDesign a simplified version of Twitter where users can post tweets, follow/unfollow another user, and is able to see the 10 most recent tweets in the user's new...
Implement Trie (Prefix Tree)
SolveA trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various appl...
Merge Intervals
SolveGiven an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cove...
Tweet Counts Per Frequency
SolveA social media company is trying to monitor activity on their site by analyzing the number of tweets that occur in select periods of time. These periods can be...
LRU Cache
SolveDesign a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Permutation Sequence
SolveThe set [1, 2, 3, ..., n] contains a total of n! unique permutations.
Multiply Strings
SolveGiven two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.
Regular Expression Matching
SolveGiven an input string s and a pattern p, implement regular expression matching with support for '.' and '' where:
Remove All Occurrences of a Substring
SolveGiven two strings s and part, perform the following operation on s until all occurrences of the substring part are removed:
Trapping Rain Water II
SolveGiven an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining.
Number of Black Blocks
SolveYou are given two integers m and n representing the dimensions of a 0-indexed m x n grid.
Max Points on a Line
SolveGiven an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line.
Validate IP Address
SolveGiven a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type.
The Skyline Problem
SolveA city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Given the locations and heights of...
Design Authentication Manager
SolveThere is an authentication system that works with authentication tokens. For each session, the user will receive a new authentication token that will expire tim...
Word Break II
SolveGiven a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possi...
Minimum Number of Steps to Make Two Strings Anagram
SolveYou are given two strings of the same length s and t. In one step you can choose any character of t and replace it with another character.
Count Sub Islands
SolveYou are given two m x n binary matrices grid1 and grid2 containing only 0's (representing water) and 1's (representing land). An island is a group of 1's connec...
Lowest Common Ancestor of a Binary Search Tree
SolveGiven a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.
Time Needed to Buy Tickets
SolveThere are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the line.
Process Tasks Using Servers
SolveYou are given two 0-indexed integer arrays servers and tasks of lengths n and m respectively. servers[i] is the weight of the ith server,...
Kth Smallest Element in a Sorted Matrix
SolveGiven an n x n matrix where each of the rows and columns is sorted in ascending order, return the kth smallest element in the matrix.
Design Skiplist
SolveDesign a Skiplist without using any built-in libraries.
Finding the Users Active Minutes
SolveYou are given the logs for users' actions on LeetCode, and an integer k. The logs are represented by a 2D integer array logs where each logs[i] = [IDi, timei] i...
Happy Number
SolveWrite an algorithm to determine if a number n is happy.
Valid Parentheses
SolveGiven a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
Pascal's Triangle
SolveGiven an integer numRows, return the first numRows of Pascal's triangle.
Reverse Linked List
SolveGiven the head of a singly linked list, reverse the list, and return the reversed list.
Integer to Roman
SolveSeven different symbols represent Roman numerals with the following values:
Merge k Sorted Lists
SolveYou are given an array of k linked-lists lists, each linked-list is sorted in ascending order.
Wildcard Matching
SolveGiven an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '' where:
Masking Personal Information
SolveYou are given a personal information string s, representing either an email address or a phone number. Return the masked personal information using the below ru...
Minimum Elements to Add to Form a Given Sum
SolveYou are given an integer array nums and two integers limit and goal. The array nums has an interesting property that abs(nums[i]) <= limit.
Binary Gap
SolveGiven a positive integer n, find and return the longest distance between any two adjacent 1's in the binary representation of n. If there are no two adjacent 1'...
Minimum Genetic Mutation
SolveA gene string can be represented by an 8-character long string, with choices from 'A', 'C', 'G', and 'T'.
Random Pick with Weight
SolveYou are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index.
Rotting Oranges
SolveYou are given an m x n grid where each cell can have one of three values:
Number of Islands
SolveGiven an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent X interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
X interviews focus heavily on array, hash-table, string problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. X interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.
X has been reported to ask 45 distinct coding problems. The most common topics are array, hash-table, string. 8 are Easy difficulty, 27 are Medium, and 10 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
Based on 45 reported problems, X interviews are slightly harder than average - 22% Hard vs 18% across all companies. 60% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, hash-table, string. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real X coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.
Simulate a X interview with AIarrow_forward