Bytedance OA real question sharing | CodeSignal 70 minutes 4 question ideas + code | ProgramHelp

1,954 Views

ByteDance OA question bank has a certain scale, but the question types and patterns are relatively fixed. As long as you are familiar with the common routines in advance, you can complete the first two questions in ten minutes during the exam and securely win 4 questions in 40 minutes. This article has compiled four real questions from my latest ByteDance OA, with detailed problem-solving ideas and code examples. I hope it will help students who are preparing for Byte overseas positions, TikTok, domestic autumn recruitment or summer internships to familiarize themselves with the rhythm in advance and avoid pitfalls.

Bytedance OA real question sharing | CodeSignal 70 minutes 4 question ideas + code | ProgramHelp

ByteDance OA Overview

Platform: CodeSignal
Duration: 70 minutes
Number of questions: 4
Difficulty: Lower to medium, you can complete it quickly once you are familiar with the routine

T1: User Ratings and Levels

Brief description of the question

Given an initial rating Initial And an array of changes Changes, the final score is obtained after being accumulated in sequence, and it is judged in which grade range the score falls.

Ideas

  • Directly to Initial And Changes Sum
  • Use If-else Judgment interval:
    • < 1000 → "beginner"
    • 1000–1499 → "intermediate"
    • 1500–1999 → "advanced"
    • ≥ 2000 → "pro"

Example

Def solution(initial, changes):
    total = initial + sum(changes)
    if total < 1000:
        return "beginner"
    elif total < 1500:
        return "intermediate"
    elif total < 2000:
        return "advanced"
    else:
        return "pro"

T2: word transformation

Brief description of the question

For each word:

  • If the first and last letters are both vowels (case sensitive,AeiouAEIOU), keep the beginning and end, invert the middle part, capitalize the first letter of the middle part, and lowercase the rest.
  • Otherwise leave unchanged.

Ideas

  • Define vowel set
  • Judge S[0] in vowels and s[-1] in vowels
  • Middle part:S[1:-1] → Invert → Capitalize the first letter, lowercase the rest → Splice

Example

Def solution(text):
    vowels = set('aeiouAEIOU')
    res = []
    for s in text:
        if s[0] in vowels and s[-1] in vowels:
            mid = s[1:-1][::-1]
            if mid:
                mid = mid[0].upper() + mid[1:].lower()
            s = s[0] + mid + s[-1]
        res.append(s)
    return res

T3: Mobile phone battery usage

Brief description of the question

Need to use mobile phone T Minutes, yes N Batteries, each with:

  • Capacity[i]:Available minutes
  • Recharge[i]: The number of minutes it takes to charge after running out of power

Rule:

  • Cycle batteries in sequence
  • The current battery is exhausted → switch to the next one
  • If the next piece is still charging, continue to look for it.
  • If all batteries are charging → Return -1
  • Count the number of completely used batteries

Ideas

  • Simulation time advance
  • Maintain the usable time point of each battery
  • When it is time to replace the battery, look for the first fully charged one in order.
  • If not found → -1

Example

Def solution(t, capacity, recharge):
    n = len(capacity)
    ready_time = [0] * n # When each battery is available
    used_count = 0
    time = 0
    idx=0

    while time < t:
        # Find currently available batteries
        found=-1
        for _ in range(n):
            if ready_time[idx] <= time:
                found=idx
                break
            idx = (idx + 1) % n
        if found == -1:
            return -1

        # Use this battery
        cap = capacity[found]
        ready_time[found] = time + cap + recharge[found]
        time += cap
        used_count += 1
        idx = (found + 1) % n

    return used_count

T4: Travel route reconstruction

Brief description of the question

Given a series of photos, each photo [a, b] Indicates that a and b are visited consecutively during the trip (the order is unknown).
A complete visit sequence is required to be reconstructed (all landmarks appear once and adjacent pairs are photographed).

Ideas

  • This is a chain structure (each node degree ≤ 2)
  • Mapping: adjacency list
  • Find the endpoint of the chain (the node with degree 1)
  • Traverse starting from any endpoint and continue toward unvisited neighbors.

Example

Def solution(travelPhotos):
    from collections import defaultdict, deque
    
    graph = defaultdict(list)
    degree = defaultdict(int)
    
    for a, b in travelPhotos:
        graph[a].append(b)
        graph[b].append(a)
        degree[a] += 1
        degree[b] += 1
    
    # Find the endpoint
    start=None
    for node in graph:
        if degree[node] == 1:
            start=node
            break
    
    # Traverse
    order = []
    prev = None
    cur=start
    while cur is not None:
        order.append(cur)
        nxt = None
        for nei in graph[cur]:
            if nei != prev:
                nxt=nei
                break
        prev, cur = cur, nxt
    
    return order

Need help with CodeSignal OA?

If you're preparing for the CodeSignal online written exam at ByteDance or other tech companies, you're not alone. Many job seekers find that the pace of 70 minutes of four questions is very tight, especially when encountering unfamiliar question types, and it is easy to get stuck.

ProgramHelp Can provide you with:

  • Real OA question bank – Covers high-frequency real questions from ByteDance, TikTok, Amazon, Meta and other companies
  • Problem-solving ideas + code templates – Quickly master the core solutions to each type of questions and no longer struggle
  • One-to-one tutoring – Specialized improvements for your weak areas
  • Emergency assistance – OA assist · Incognito support, CodeSignal | HackerRank | LeetCode, Byte/TikTok/Amazon/Meta

Use the least time to get the highest OA score.

Successfully enter the next round of interviews and get one step closer to an offer.

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0