← Bytedance Interview Insights

Bytedance·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Bytedance software engineer interview with a brain teaser that sounds simple but has a neat trick to it. Not your typical coding round.

Questions Asked (1)

Q1

A worker is paid one gold bar for seven days of work. You can only make two cuts to the bar. How do you pay exactly 1/7 of the bar at the end of each day?

Algorithms & Data Structures
Author's notes

I stared at this for a while.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize that this is a classic puzzle about representing numbers in binary. With two cuts, you can create pieces of sizes 1, 2, and 4 units, which can be combined to form any number from 1 to 7. Explain how to use these pieces to pay exactly 1/7 of the bar each day by making change.

Pro tip: Don't just give the answer; explain the underlying principle of binary representation and how it applies to making change. This shows you can generalize the solution to other similar problems.

1. Understand the problem

Clarify that the worker must receive exactly 1/7 of the bar each day, and the bar can only be cut twice, resulting in three pieces.

2. Determine piece sizes

Use binary representation to decide the sizes: 1/7, 2/7, and 4/7. These can be combined to form any integer multiple of 1/7 from 1 to 7.

3. Plan the daily payments

Outline the exchange of pieces each day: Day 1 give 1/7; Day 2 take back 1/7 and give 2/7; Day 3 give 1/7; Day 4 take back 1/7 and 2/7 and give 4/7; and so on.

4. Verify the solution

Check that after each day, the worker has exactly the cumulative amount owed, and that the total at the end is the whole bar.

Key Points to Mention

  • Binary representation and powers of 2
  • Making change by exchanging pieces
  • The pieces are 1/7, 2/7, and 4/7 of the bar
  • The worker's total after each day equals the day number times 1/7
  • Generalization to other numbers of days (e.g., 15 days with 4 pieces)
  • Efficiency: minimal number of cuts (2) for 7 days

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.