0 day streak

TikTok (ByteDance) 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
Number of IslandsConnected Components Medium Graphs Google, Amazon, Microsoft +114 Solve
LRU CacheLinked Lists Medium Design Data Structures Google, Amazon, Microsoft +140 Solve
Course ScheduleTopological Sort Medium Graphs Google, Amazon, Microsoft +42 Solve
Number of Distinct IslandsMatrix Graphs Medium Graphs Snap, Coupang, Anduril +5 Solve
Reverse Nodes in k-GroupFront Middle Back Pointer Hard Linked List Amazon, Microsoft, Meta +33 Solve
Making A Large IslandConnected Components Hard Graphs Amazon, Meta, Uber +9 Solve
Path Sum IIIBacktracking Medium Trees & BST Zillow, Quora, ServiceNow +4 Solve
Count Number of Nice SubarraysSliding Window · Variable Medium Arrays & Hashing Roblox, InMobi Solve
Cheapest Flights Within K StopsDijkstra Medium Graphs Google, Airbnb, Stripe +13 Solve
All Nodes Distance K in Binary TreeChild + Ancestor Handling Medium Trees & BST Amazon, Meta, Apple +14 Solve
Meeting Rooms IILine Sweep Medium Intervals Google, Amazon, Meta +50 Solve
Longest Increasing Subsequence1D DP Medium Dynamic Programming Google, Microsoft, Agoda +29 Solve
Longest Substring Without Repeating CharactersSliding Window · Variable Medium Arrays & Hashing Google, Amazon, Microsoft +114 Solve
Merge IntervalsBasics Medium Intervals Google, Amazon, Microsoft +107 Solve
Text JustificationSimulation Hard Arrays & Hashing Google, Microsoft, LinkedIn +28 Solve
Trapping Rain WaterTwo Pointer Hard Arrays & Hashing Google, Amazon, Microsoft +88 Solve
All O`one Data StructureLinked Lists Hard Design Data Structures Amazon, LinkedIn, Atlassian +3 Solve
Block Placement QueriesSegment Tree Hard Intervals Uber, Roblox, Visa +3 Solve
Restore IP AddressesChoice per Position Medium Recursion & Backtracking Microsoft, Nvidia, Yahoo +8 Solve
Non-overlapping IntervalsBasics Medium Intervals Google, Grammarly, Verkada +3 Solve
Gas StationKadane's Algorithm Medium Arrays & Hashing Amazon, Microsoft, Bloomberg +23 Solve
Remove Duplicate LettersMonotonic Stack Medium Monotonic Stack Amazon, Expedia Group, UBS +3 Solve
Longest Substring with At Most K Distinct CharactersSliding Window · Hash Map Medium Arrays & Hashing Microsoft, Coupang, Adobe +3 Solve
Rotate ArrayDouble Reversal Trick Medium Arrays & Hashing Apple, Bloomberg, Nutanix +30 Solve
Single-Threaded CPUComposite comparator Medium Heaps DoorDash, Goldman Sachs Solve
Longest Mountain in ArrayTwo Pointer Medium Arrays & Hashing Apple, Databricks, Zscaler +4 Solve
Possible BipartitionCycle Detection Medium Graphs Snowflake, Samsung, Meesho Solve
Shortest Path in a Grid with Obstacles EliminationBFS for shortest path Hard Graphs Databricks, Bloomberg, Pinterest +6 Solve
Maximum Width of Binary TreeTraversals Medium Trees & BST Flipkart Solve
Wildcard MatchingStrings Hard Dynamic Programming Snap, Instacart, X (Twitter) +11 Solve
Binary Tree Maximum Path SumPostorder + Multiple Return Values Hard Trees & BST Google, Amazon, Meta +29 Solve
Group AnagramsHashing Medium Arrays & Hashing Amazon, Microsoft, Meta +82 Solve
Find First and Last Position of Element in Sorted ArrayBisect Medium Binary Search Meta, LinkedIn, Nvidia +29 Solve
Rotate ImageIn-place Transformations Medium Arrays & Hashing Amazon, Apple, Nvidia +38 Solve
N-Queens2D Matrix Hard Recursion & Backtracking Netflix, Elastic, Epic Games +17 Solve
Search in Rotated Sorted ArrayRotated Array Medium Binary Search Amazon, Microsoft, Apple +59 Solve
Spiral MatrixMatrix Traversal Medium Arrays & Hashing Microsoft, Apple, Databricks +52 Solve
Minimum Window SubstringSliding Window · Hash Map Hard Arrays & Hashing Google, Amazon, Microsoft +37 Solve
Decode StringStack Basics Medium Stack Google, Amazon, Microsoft +31 Solve
Course Schedule IITopological Sort Medium Graphs Google, Amazon, Meta +42 Solve
Subarray Sum Equals KPrefix Sum Strategy Medium Arrays & Hashing Google, Amazon, Microsoft +41 Solve
Word Search2D Matrix Backtracking Medium Recursion & Backtracking Google, Microsoft, Meta +36 Solve
Coin ChangeKnapsack Medium Dynamic Programming Google, Amazon, Microsoft +55 Solve
3SumTwo Sum Medium Arrays & Hashing Google, Amazon, Microsoft +68 Solve
House RobberAlternate Selection / Pick / Not pick Medium Dynamic Programming Google, Microsoft, Airbnb +43 Solve
Maximum SwapRight to Left Traversal Medium Arrays & Hashing Meta, Elastic, Klarna +2 Solve
Longest Happy StringAdvanced Medium Heaps Wayfair, Capgemini Solve
Snapshot ArrayBasics Medium Binary Search Google, Apple, Netflix +9 Solve
Two SumTwo Sum Easy Arrays & Hashing Google, Amazon, Microsoft +135 Solve
Longest Consecutive SequenceHash Set Lookup Medium Arrays & Hashing Google, Amazon, Microsoft +34 Solve
Basic Calculator IIStack Basics Medium Stack Meta, Apple, Airbnb +18 Solve
Top K Frequent ElementsComposite comparator Medium Heaps Google, Amazon, Microsoft +53 Solve
Basic Calculator IIIStack Basics Hard Stack DoorDash, Tesla, Snap +5 Solve
Longest Palindromic SubstringStrings Medium Dynamic Programming Amazon, Microsoft, Apple +68 Solve
Sqrt(x)Search on Answer Range Easy Binary Search Wayfair, Epic Games, Grammarly +15 Solve
Valid Parenthesis StringStack Basics Medium Stack Google, Roku, Activision Blizzard +4 Solve
Generate ParenthesesPick / Not-Pick Medium Recursion & Backtracking Google, Amazon, Microsoft +28 Solve
Merge k Sorted ListsMerge K Sorted Hard Heaps Google, Amazon, Microsoft +59 Solve
Best Time to Buy and Sell StockState Machine DP - Stock Problems Easy Dynamic Programming Amazon, Microsoft, Apple +101 Solve
Kth Largest Element in an ArrayTop K / Kth Largest / Smallest Medium Heaps Amazon, Meta, Apple +51 Solve
Daily TemperaturesMonotonic Stack Medium Monotonic Stack Amazon, Grab, eBay +20 Solve
Construct Binary Tree from Preorder and Inorder TraversalTree Serialization / Deserialization Medium Trees & BST Microsoft, eBay, Block (Square) +9 Solve
Valid ParenthesesStack Basics Easy Stack Google, Amazon, Microsoft +119 Solve
Simplify PathStack Basics Medium Stack Meta, Snowflake, Grab +11 Solve
Word LadderBFS for shortest path Hard Graphs Google, Amazon, Microsoft +39 Solve
Binary Tree Right Side ViewViews Medium Trees & BST Google, Meta, Elastic +16 Solve
Find Median from Data StreamAdvanced Hard Heaps Google, Amazon, Apple +47 Solve
Insert Delete GetRandom O(1)Hash Map + Array Medium Design Data Structures Google, Amazon, Apple +50 Solve
Word Search IITrie + Backtracking Hard Tries Google, Amazon, Uber +12 Solve
Also reported, being added to AlgoRung (3)

Longest Substring with At Most Two Distinct Characters · Number of Atoms · Longest Substring with At Least K Repeating Characters

Questions people ask

What coding questions does TikTok (ByteDance) ask most?

Number of Islands, LRU Cache, Course Schedule, Number of Distinct Islands, Reverse Nodes in k-Group, Making A Large Island, Path Sum III, Count Number of Nice Subarrays.

Which topics come up in TikTok (ByteDance) coding rounds?

graphs, dynamic programming, sliding window, intervals, stack, design data structure.

How hard are TikTok (ByteDance) coding questions?

Of the reported questions, 4 are easy, 49 medium and 16 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.