Twilio Coding Interview Questions
25 Twilio coding interview problems with full optimal solutions — 8 easy, 16 medium, 1 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Twilio interviewer values, and a FAQ section.
Showing 16 problems of 25
- #2mediumfrequently asked
2. Add Two Numbers
Add Two Numbers gives Twilio interviewers a clean read on your linked-list mechanics: two non-empty lists hold digits in reverse, and you must return the digit-wise sum as a new linked list. The grading rubric weighs carry propagation, unequal lengths, and a trailing carry past both lists.
3 free resourcesSolve → - #3mediumfrequently asked
3. Longest Substring Without Repeating Characters
Twilio's classic sliding-window question: given a string, return the length of the longest substring without repeating characters. The grading rubric weighs whether you build the optimal O(n) sliding window with a hash map, not the O(n^2) brute-force scan.
3 free resourcesSolve → - #49mediumfrequently asked
49. Group Anagrams
Group Anagrams is Twilio's canonical hash-key-design probe: given an array of strings, group the anagrams together. The grading rubric weighs whether you choose the sorted-string key (simple) or the character-count key (asymptotically faster) and can articulate why each tradeoff matters.
3 free resourcesSolve → - #56mediumcompany favorite
56. Merge Intervals
Merge Intervals is Twilio's quintessential time-range problem: given an array of intervals, merge all overlapping ones and return the result. Twilio's voice/messaging teams use this pattern for collapsing call-window or rate-limit-window logs, and the interview grades whether you sort first and merge in O(n).
3 free resourcesSolve → - #139mediumfrequently asked
139. Word Break
Word Break is Twilio's DP-versus-recursion-with-memo probe: given a string s and a dictionary, determine if s can be segmented into a sequence of dictionary words. The grading rubric weighs whether you avoid exponential blowup with memoization or bottom-up DP, and choose a Set lookup for the dictionary.
3 free resourcesSolve → - #146mediumcompany favorite
146. LRU Cache
LRU Cache is Twilio's premier system-design coding probe: implement get and put in O(1), with eviction of the least-recently-used entry when capacity is exceeded. Twilio's rate-limiter and rolling-window code paths use this exact data structure, and the interview rubric grades whether you reach for a hash map plus doubly-linked list without prompting.
4 free resourcesSolve → - #155mediumfrequently asked
155. Min Stack
Min Stack is Twilio's auxiliary-state-tracking probe: design a stack that supports push, pop, top, and getMin all in O(1). The grading rubric weighs whether you maintain a parallel structure (second stack of running minimums) rather than scanning to compute min on demand.
3 free resourcesSolve → - #200mediumfrequently asked
200. Number of Islands
Number of Islands is Twilio's graph-traversal probe: given an m x n grid of '1' (land) and '0' (water), count distinct islands. The grading rubric weighs whether you reach for DFS/BFS to flood-fill or — more impressively — Union-Find for a streaming variant.
3 free resourcesSolve → - #207mediumfrequently asked
207. Course Schedule
Course Schedule is Twilio's cycle-detection probe: given numCourses and a list of prerequisite pairs, decide if all courses can be finished. The grading rubric weighs whether you frame it as 'does the directed graph have a cycle?' and use either Kahn's BFS topological sort or DFS with three-color marking.
3 free resourcesSolve → - #208mediumfrequently asked
208. Implement Trie (Prefix Tree)
Implement Trie is Twilio's prefix-tree design probe: build a data structure supporting insert, search, and startsWith over lowercase-letter words. The grading rubric weighs whether you choose the 26-slot child array (fast, fixed memory) or a hash-map child structure (memory-frugal for sparse keysets).
3 free resourcesSolve → - #253mediumcompany favorite
253. Meeting Rooms II
Meeting Rooms II is Twilio's resource-scheduling probe: given a list of meeting time intervals, return the minimum number of rooms required. Twilio's voice-team interview reports frame this as 'minimum concurrent call legs' — the algorithmic shape is identical. The grading bar is the sort-and-sweep with min-heap (or two sorted arrays) for O(n log n).
3 free resourcesSolve → - #347mediumfrequently asked
347. Top K Frequent Elements
Top K Frequent Elements is Twilio's data-aggregation probe: given an integer array, return the K most frequent values. The grading rubric weighs whether you reach for a min-heap of size K (O(n log K)) or bucket sort (O(n)), and articulate WHY the second is faster when the value range is bounded by n.
3 free resourcesSolve → - #355mediumfrequently asked
355. Design Twitter
Design Twitter is Twilio's feed-system probe: implement postTweet, follow, unfollow, and getNewsFeed (the 10 most recent tweets from a user and the people they follow). The grading rubric weighs whether you choose a fan-out-on-read model with K-way merge for the feed or fan-out-on-write, and articulate the tradeoff.
3 free resourcesSolve → - #362mediumcompany favorite
362. Design Hit Counter
Design Hit Counter is Twilio's rolling-window probe: track the number of hits received in the past 300 seconds. The grading rubric weighs whether you use a bounded 300-bucket array (memory-efficient regardless of request rate) or a queue (flexible but unbounded under high load), and articulate the tradeoff.
3 free resourcesSolve → - #560mediumfrequently asked
560. Subarray Sum Equals K
Subarray Sum Equals K is Twilio's prefix-sum probe: given an integer array and target k, count the contiguous subarrays whose sum equals k. The grading rubric weighs whether you reach for the prefix-sum-plus-hash-map trick to drop from O(n^2) to O(n), and articulate why two equal prefix sums imply a zero-sum subarray.
3 free resourcesSolve → - #1242mediumfrequently asked
1242. Web Crawler Multithreaded
Web Crawler Multithreaded is Twilio's concurrency probe: crawl all URLs reachable from a startUrl that share the same hostname, returning the list. Twilio's API-platform team uses this to grade concurrent BFS, work-distribution, and visited-set synchronization. The grading bar is a thread-safe visited set plus a work-stealing queue or async pool.
3 free resourcesSolve →