31 practice questions for ByteDance QA Engineer interviews
ByteDance QA engineer interviews test automation frameworks, test strategy, CI integration, performance testing, and debugging complex multi-service systems.
1. [OA] Depth-First Search — Video Recommendation Graph Traversal
ByteDance aims to enhance video viewing experience by recommending similar videos based on user preferences. Given a directed graph where nodes represent videos and edges represent user preferences, apply DFS to find all reachable videos from a starting video node. You need to implement the following function:
List<Integer> recommendVideos(int[][] graph, int startVideo) - returns a list of all videos reachable from startVideo.
Example 1: Input: graph = [[1, 2], [3], [3], []], startVideo = 0 Output: [1, 2, 3] Explanation: From video 0, you can reach videos 1, 2, and 3. Example 2: Input: graph = [[1], [2], []], startVideo = 1 Output: [2] Constraints:
0 <= graph.length <= 100
0 <= graph[i].length <= 100
codingMediumsliding window#2
2. [OA] Sliding Window — Efficient Video Playlist Filtering for ByteDance
In ByteDance’s video application, we need a system to filter video playlists based on user history. The goal is to maximize the number of unique videos in the playlist while adhering to a maximum length constraint. You are given an int[] videoIds representing the videos a user has viewed and an int maxLength which is the maximum length that the playlist can be. The function signature is:
List<Integer> filterPlaylist(int[] videoIds, int maxLength) - returns a list of video IDs in the filtered playlist avoiding repetition.
Example 1: Input: videoIds = [1, 2, 3, 1, 2, 3], maxLength = 4 Output: [1, 2, 3] Explanation: The unique videos that fit within the length 4 are 1, 2, and 3. Example 2: Input: videoIds = [5, 6, 5, 7, 8, 6], maxLength = 5 Output: [5, 6, 7, 8] Explanation: The unique videos that fit within the length 5 are 5, 6, 7, and 8. Constraints: