HackTheRounds Interview Experiences

ByteDance Software Engineer OA Interview Experience (2026) - CodeSignal Skyline Square, Nearly Regular Crosses, Lex-Smallest Reverse

ByteDance CodeSignal OA: 70 minute four problem set with largest square in skyline, nearly regular cross counting, lexicographic string reversal, overlaps with

By Anonymous ยท 2026-04-07

Background

Writing this the afternoon I finished the ByteDance CodeSignal OA, while the test details are still fresh. I am a backend-leaning SWE with about four years of experience in the US, applied to ByteDance's US product org for a mid-level role through a referral. The OA link came 13 days after the recruiter phone screen with a five-day window. ByteDance is on CodeSignal, not HackerRank, which matters because the question rotation overlaps heavily with Uber, Roblox, and HRT rather than with the classic LeetCode-import style. If you have done any of those three recently, this set will feel familiar.

Timeline

OA Format (70 min, CodeSignal)

Four problems, 70 minutes, CodeSignal's general problem bank style. You can run against custom stdin and against the provided example cases, but you cannot see the hidden test set's pass count until after time expires. Python is the default language for most people, including me. C++ and Java are available.

Four problems in 70 minutes means about 17 minutes per problem on average. The first two are typically easy, the third leans medium, and the fourth ranges from medium to medium-hard depending on the draw. Getting all four AC inside the time is the bar for a strong pass.

Problem 1: Largest Inscribed Square in a Skyline

Problem: Given an array of skyscraper heights where each building is 1 unit wide and buildings are adjacent with no gaps, find the area of the largest axis-aligned square that fits inside the skyline.

The trick is that the square's side length is bounded by the minimum height in a contiguous window and by the window's width. You are looking for the maximum s such that there exists a window of size s with a minimum height of at least s .

My approach: binary search on the answer s . For a candidate s , scan all windows of size s and check whether any window's minimum is at least s . The window-minimum scan is a standard monotonic-deque sliding window in O(n) per candidate. Total runtime O(n log max height) .

The CodeSignal-flavored alternative would be a brute-force O(n^2) scan over all window sizes and positions, which at their typical constraint caps is usually fast enough. I went with the binary-search version because I trusted my sliding-window boilerplate more under time pressure.

Verified on the example [1, 2, 3, 2, 1] which should return 4: the window of size 2 starting at index 1 has minimum 2, fits a 2-by-2 square. No window of size 3 has minimum at least 3. Matches.

Practice it: This question is coming soon to HackTheRounds. Problem 2: Counting Nearly-Regular Cro

This question is coming soon to HackTheRounds. sses

Problem: In a 2D integer matrix, a "cross" is the union of row r and column c . The cross is "nearly regular" if all elements of the cross are equal except possibly the single cell at the row-column intersection. Count the number of nearly-regular crosses.

A cross is nearly regular when, excluding the intersection cell, every other cell in row r has the same value as every other cell in column c . Two natural precomputations let you answer each cross in O(1) :

  • For each row `r`, precompute whether every cell in that row (excluding a candidate column `c`) is equal to some single value, and what that value is.
  • Same for each column.

With those tables, for each cell (r, c) you check whether row-excluding-c has a uniform value v row and column-excluding-r has a uniform value v col , and whether v row == v col . If so the cross is nearly regular.

The tricky piece is "excluding one cell" without rechecking the whole row for each candidate. The cleaner framing: precompute, per row, the uniform-value (if any) when the row as a whole is uniform. Separately precompute whether the row has "at most one outlier" and if so, what value the rest take. Same for columns. Then the count is over cells where row-rest and col-rest agree and are uniform modulo the single intersection cell.

Total runtime comes out to O(n m) after the precomputation, which the problem explicitly signals as the intended bound.

Practice it: This question is coming soon to HackTheRounds. Problem 3: Lexicographically Smallest

This question is coming soon to HackTheRounds. One-Reversal

Problem: Given a string, you can perform exactly one operation: reverse a prefix of length k for any 1 <= k <= n , or reverse a suffix of length k for any 1 <= k <= n . Return the lexicographically smallest string you can produce.

The problem explicitly allows O(n^3) solutions, which is the generous budget for a brute-force enumeration: try every k for both prefix and suffix reversal, materialize the resulting string, and keep the minimum. That is 2n candidates, each with an O(n) construction and an O(n) comparison, for O(n^3) total.

I went with brute force because the constraints allow it and because a smarter approach would take longer to verify than it would save in runtime. The one thing to remember is that reversing the first 1 character or the last 1 character both leave the string unchanged, so both are the "do-nothing-but-pay-the-operation" options that are always candidates.

Verified on the example "dbaca" which should yield "abdca" : reversing the first 3 characters gives "abdca" . Matches.

Practice it: This question is coming soon to HackTheRounds. Problem 4: Standard CodeSignal Medium

This question is coming soon to HackTheRounds.

The fourth problem in my draw was an array-and-string hybrid I will not fully describe out of respect for the test's hidden pool. The pattern was "iterate over positions, maintain a running invariant, answer queries in a single pass" with a twist that required you to notice a reindexing shortcut. I finished with about six minutes on the clock and did not stress-test as much as I would have liked.

Result

Still pending at the time of writing. CodeSignal typically releases the hidden test pass count within 24 hours of submission, and the recruiter has said either way they will follow up within four business days. I will update this post once the verdict lands.

Tips

  1. The ByteDance OA rotation looks like Uber, Roblox, and HRT. Prep against those three banks. The question types, test-case style, and even the specific grader quirks overlap. If you have done a recent Uber OA, you have effectively done 60 percent of the ByteDance prep. Do not spend prep time on problem types that never show up (for example, heavy graph or segment-tree problems are rare in this rotation).
  2. Read the complexity ceiling in the problem statement, then aim for it exactly. CodeSignal problems often announce "a solution within `O(n^3)` will fit." Take that seriously. Writing a smart `O(n log n)` solution when `O(n^3)` is accepted costs you time for no reward, and it introduces bugs.
  3. Budget 17 minutes per problem and set a hard skip rule. Four problems in 70 minutes means you cannot linger. If you are past the 17-minute mark on a problem and still do not have a clean implementation in your head, skip and come back. Finishing three problems cleanly beats wrestling with four partially.
  4. Write boundary tests before you submit each problem. Empty input, single element, maximum size. CodeSignal's hidden test set weights these heavily and the example inputs they show you rarely exercise them.
  5. Choose a language you can debug fast. Python is the usual pick for CodeSignal. If you are a strong C++ user, use C++ for speed, but know that the verbose I/O and overflow traps cost more time than the runtime buys you on these problem sizes.
  6. Do not try to chase a perfect score on Problem 1 at the expense of Problems 3 and 4. The scoring is roughly additive and problem 4 alone is worth more than a polished problem 1. If you see a clean Problem 1 solution in 10 minutes, take it and move on.

If the result is a pass I will update this post with the next round's notes. If not, the lesson from the four hours of prep I put in is that ByteDance's OA is a test of CodeSignal-adjacent pattern recognition under time, not a test of algorithm depth. Prep accordingly.