ByteDance Coding Interview Questions
25 ByteDance coding interview problems with full optimal solutions — 10 easy, 11 medium, 4 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an ByteDance interviewer values, and a FAQ section.
Showing 10 problems of 25
- #5easyfrequently asked
5. Maximum Subarray
Maximum Subarray asks for the largest sum any contiguous slice of an integer array can reach — the home of Kadane's algorithm and one of the most-asked questions in screening rounds anywhere. ByteDance candidates report the bar is not finding Kadane's (most prepared candidates do) but explaining the one-line decision it makes at every index: extend the running subarray, or abandon it and restart — and proving why a negative running sum can never help any future window.
- #1easyfoundational
1. Two Sum
Find two indices in an array whose values sum to a target — a warm-up that ByteDance uses to gauge hash-map fluency before deeper recommendation pipeline questions.
- #2easyfoundational
2. Valid Parentheses
Verify a string of brackets is properly balanced — ByteDance leans on this to confirm stack fluency before pivoting to feed-ranking expression parsers.
- #3easyfoundational
3. Merge Two Sorted Lists
Stitch two sorted linked lists into one — ByteDance uses this to test pointer hygiene that maps directly to merging sorted candidate rankings.
- #4easyfoundational
4. Best Time to Buy and Sell Stock
Find the maximum profit from a single buy-sell pair — ByteDance uses it to test running-minimum bookkeeping before scaling to streaming ranking signals.
- #6easyfoundational
6. Reverse Linked List
Reverse a singly linked list in place — ByteDance uses it to verify pointer fluency before moving to feed-pipeline buffer questions.
- #7easyfoundational
7. Linked List Cycle
Detect whether a linked list contains a cycle — ByteDance uses it to confirm you reach Floyd's two-pointer trick before discussing content-graph traversal.
- #8easyfoundational
8. Climbing Stairs
Count distinct ways to climb n stairs taking 1 or 2 steps — ByteDance uses it to test the leap from recursion to DP before deeper ranking-DP problems.
- #9easyfoundational
9. Valid Palindrome
Determine if a string is a palindrome ignoring non-alphanumeric characters — ByteDance uses it as a moderation-pipeline warm-up before harder text-normalization questions.
- #10easyfoundational
10. Contains Duplicate
Return true if any value appears twice in the array — ByteDance uses it as a dedup warm-up before deeper content-fingerprinting questions.