← nebius Interview Insights

nebius·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Interviewed at Nebius for a software engineer role and got a matrix-based coding problem that looked straightforward but had a small gotcha in how you handle the row check. Pretty standard technical phone screen vibe.

Questions Asked (1)

Q1

You're given a 2D matrix of daily health-check results for a set of microservices, where each cell is 1 (pass) or 0 (fail). Find the length of the longest contiguous sequence of days where every microservice passed.

Algorithms & Data Structures
Author's notes

My first instinct was to overthink it and reach for some kind of sliding window, but it's really just a linear scan.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify that the problem reduces to finding the longest contiguous range of columns where every row has a 1. Then propose an efficient solution: for each column, compute the AND of all rows (or equivalently, check if any row has a 0), and find the longest run of columns where the AND is 1. This can be done in O(R*C) time by scanning columns and maintaining a running count, or in O(C) time after preprocessing each column with early termination.

Pro tip: Mention that you can optimize by stopping early when a 0 is found in a column, and that the problem is essentially finding the longest subarray of columns where the column-wise minimum is 1. Also, discuss how to handle large matrices with streaming or parallel processing if needed.

1. Clarify the problem

Confirm that the matrix has R rows (microservices) and C columns (days), and that a day is 'good' if all entries in that column are 1. The goal is the maximum number of consecutive good days.

2. Identify the core operation

For each column, determine if it is all 1s. This can be done by checking each row in that column, or by computing the column-wise AND. The longest contiguous sequence of such columns is the answer.

3. Design an efficient algorithm

Scan columns from left to right. For each column, check all rows until a 0 is found (early exit). If all are 1, increment a current run length; otherwise reset it. Keep track of the maximum run length. Time complexity O(R*C) worst-case, but often faster with early exit.

4. Consider optimizations and edge cases

Discuss potential optimizations like using bitwise operations if rows are represented as bitsets, or parallelizing column checks. Handle edge cases: empty matrix, single row/column, all 1s, all 0s.

5. Analyze complexity and test

State time and space complexity. Walk through a small example to verify correctness. Mention that the solution is optimal for the given constraints.

Key Points to Mention

  • Column-wise AND or checking all rows per column
  • Early termination when a 0 is encountered in a column
  • Maintaining current and maximum run lengths
  • Time complexity O(R*C) and space O(1)
  • Edge cases: empty matrix, all pass, all fail, single row/column
  • Potential optimizations: bitsets, parallel processing, streaming

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