Сбер. IT interview
Questions15
Given a string containing the letters A–Z, write a function `rle` that converts the string `"AAAABBBCCXYZDDDDEEEFFFAAAAAAABBBBBBBBBBB"` into the string `"A4B3C2XYZD4E3F3A6B28"`. If a character occurs once, it remains unchanged; if it occurs more than once, append the number of repetitions to it. The function should also raise an error if given an invalid string as input.
Why accumulate characters/strings in a list and then join them instead of concatenating strings directly?
Given a string containing the letters A–Z, write a function `rle` that converts runs of identical characters into a character and the number of its repetitions. If a character occurs once, it remains unchanged. For example, the string `AAAABBBCCXYZDDDDEEEFFFAAAAAAABBBBBBBBBBB` should be converted into `A4B3C2XYZD4E3F3A7B11`. The function should raise an error if the string contains invalid characters. Given a matrix A of size ax × ay with int32 elements, find the submatrix of size kx × ky with the highest average value. The sizes kx and ky are given. Given a matrix A of size ax × ay with int32 elements, find the submatrix of size kx × ky in which the difference between the maximum and minimum elements is greatest. The sizes kx and ky are given.
12 more questions from this interview
A subscription opens every question, and Copilot suggests answers live during your Сбер. IT interview.
Sign in to unlockSummarized questions based on candidates' accounts. These materials do not represent the official position of the companies and do not disclose internal processes. If you believe a publication violates your rights — contact us.