TikTok | Software Engineer General Master’s Full-time | Interview Experience
Interview Date: Not specified
Result: Not specified
Difficulty: Not specified
Interview Process
The interview process included an online assessment (OA) that has transitioned from HackerRank to Codesignal. The new format consists of 4 programming problems, randomly selected from the Codesignal question bank.
Technical Questions
- Count Rows and Columns: Take the smaller value of the row and column indices as m. Derive a formula to calculate the result directly. Each query outputs the answer instantly.
- Palindrome Checking: First check if the number of O’s and I’s can form a palindrome (even length requires all even, odd length requires exactly one odd). If not, return -1. If possible, use two pointers to converge towards the center. If they don’t match, find the closest swap and keep track of the number of swaps.
- Grid Path Problem: Traverse an n*m grid to the bottom-right corner. Shift right until the end, then start the next row. Return -1 for obstacles and -2 for loops. Use a map to track teleport positions and a set for visited cells. Count each step as one move/teleport and check cell states.
- Longest Subarray Problem: Find the longest subsequence in an array satisfying an upper bound k. Use two sliding pointers. When moving the left endpoint, adjust the right endpoint to the maximum valid position (pref[r] - 2*pref[l] ≤ k). Iterate to record the solution. Time complexity O(n).
Tips & Insights
Be familiar with algorithms related to dynamic programming, sliding window techniques, and grid traversal problems. Practice coding under timed conditions to simulate the assessment environment.