Katkat

Solve four coding problems

NebiusSoftware Engineer · Online Assessment

Last updated

This set of problems evaluates algorithmic problem-solving skills focused on array and string manipulation, frequency and multiset reasoning, sliding-window and coverage concepts, and combinatorial counting for palindromability.

The interview included four independent coding problems:

  1. Longest all-healthy service streak You are given the daily health-check results for multiple microservices. Each day is considered healthy only if every microservice passed its health check on that day. Find the maximum number of consecutive healthy days.

  2. Shortest substring covering all distinct characters You are given a string s. Find the length of the shortest substring that contains every distinct character that appears anywhere in s at least once.

  3. Minimize remaining product types after deletions You are given a list of product IDs and an integer m. In one operation, you may delete one occurrence of any product ID. After performing exactly m deletions, minimize the number of distinct product IDs that remain. Return that minimum number.

  4. Count string pairs that can form a palindrome You are given an array of strings. Count how many pairs of strings (i, j) with i < j have the property that, after combining all characters from both strings and reordering them arbitrarily, the result can form a palindrome.