← Nebius Interview Insights

Nebius·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Interviewed at Nebius for a software engineer role, got a matrix-based problem that looked deceptively simple but had a few wrinkles worth thinking through.

Questions Asked (1)

Q1

Given a 2D matrix of daily health-check results for a set of microservices (rows are days, columns are services, each cell is 1 for pass or 0 for fail), find the length of the longest contiguous sequence of days where every single microservice passed.

Algorithms & Data Structures
Author's notes

My first instinct was to overcomplicate it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify that the goal is to find the longest run of consecutive days where all services passed, which is equivalent to finding the longest contiguous subarray of rows where the row-wise minimum is 1. Then propose an efficient O(days × services) solution by scanning each day, tracking the current streak of all-pass days, and updating the maximum streak.

Pro tip: Mention that you can optimize memory by processing the matrix row by row without storing all rows, and that early termination is possible if the remaining days cannot beat the current maximum streak.

1. Clarify the problem and constraints

Confirm that 'every single microservice passed' means all cells in a day are 1, and ask about matrix size, data types, and whether the matrix is given as a list of lists or can be streamed.

2. Define the core condition

For each day (row), determine if all services passed. This can be done by checking if the minimum value in the row is 1, or by iterating through the row until a 0 is found.

3. Design the algorithm

Initialize current_streak and max_streak to 0. Iterate through each day: if the day is all-pass, increment current_streak and update max_streak; otherwise, reset current_streak to 0.

4. Analyze complexity and edge cases

Time complexity is O(days × services) since each cell is visited at most once. Space complexity is O(1) extra. Handle edge cases: empty matrix, single day, single service, all days pass, no days pass.

5. Implement and test

Write clean code with meaningful variable names. Test with provided examples and edge cases, and consider if the matrix can be processed in a streaming fashion to save memory.

Key Points to Mention

  • Row-wise all-pass condition: check if every element in the row is 1 (e.g., using min or early exit).
  • Streak tracking: maintain current consecutive all-pass days and update the maximum.
  • Time complexity: O(days × services) optimal since each cell must be examined in the worst case.
  • Space complexity: O(1) extra space if processing row by row; O(days × services) if storing the entire matrix.
  • Edge cases: empty matrix, single row/column, all pass, all fail.
  • Potential optimization: early termination if remaining days cannot exceed current max streak.

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