Quadeye Online Assessment Questions 2025 | Quadeye OA 2025 | Good Subsequences | Shader Loader | Substring Removal
Raunit Verma - in Coding
Views: 1
Quadeye Latest Online Assessment Questions 2025 | Quadeye OA 2025 Python Developer | Insights into Quadeye OA 2025 for Aspiring Python Developers
Good Subsequences
A subsequence of a given string is generated by deleting zero or more characters from a string, then concatenating the remaining characters. A good subsequence is one where the frequency of each character is the same. Given a string that consists of n Latin letters, determine how many good subsequences it contains. Since the answer can be quite large, compute its modulo (10⁹+7).Note: An empty subsequence is not a good subsequence.
Example
word = "abca"
A total of 15 non-empty subsequences can be formed from words: "a", "a", "aa", "ab", "aba", "abc", "abca", "ac", "aca", "b", "ba", "bc", "bca", "c", and "ca".
The only subsequences that are not good are "aba", "aca," and "abca" as the frequency of character "a" is 2, and every other character is 1.
The total number of good subsequences = 15 - 3 = 12 and answer to the above example = 12 modulo (10⁹+7) = 12.
Shader Loader
A game's shaders are rendered using two GPUs: a and b. There is a string s, which represents that for the ith shader, a GPU is used.
• If shader[i] = 'a', then GPU a is used for the ith shader.
• If shader[i] = 'b', then GPU b is used for the ith shader.
The idleness of this dual GPU system is defined as the maximum number of shaders for which the same GPU is used consecutively.
For example, for the string shader = "aabbba", for the first 2 seconds, GPU a is used, then for the next 3 seconds, GPU b is used, then for 1 second, GPU a is used. Hence, the idleness of the system is 3.
To reduce the idleness of the system, the following operation can be used at most switchCount times:
• Select any index i of the string shader. If shader[i] = 'a', then change it to shader[i] = 'b' and vice versa.
Find the minimum possible idleness of the system that can be achieved by applying the operations optimally.
Example:
It is given that shader = "aabbbaaaa" and switchCount = 2.
One optimal solution is:
• Switch shader[4] (1-based index) to get shader = "aababaaaa".
• Switch shader[7] (1-based index) to get shader = "aabababaa".
Now shader = "aabababaa", and the system has an idleness of 2.
Substring Removal
Given a string, seq, that consists of the characters 'A' and 'B' only, in one move, delete either an "AB" or a "BB" substring and concatenate the remaining substrings.
Find the minimum possible length of the remaining string after performing any number of moves.
Note: A substring is a contiguous subsequence of a string.
Example:
seq = "BABBA"
Using 0-based indexing, the following moves are optimal:
• Delete the substring "AB" starting at index 1:
"BABBA" → "BBA"
• Delete the substring "BB" starting at index 0:
"BBA" → "A"
There are no more moves, so the minimum possible length of the remaining string is 1.
Tagsquadeyeoa 2025quadeye oa questionsgood subsequences
Raunit Verma
Technical Writer at CodingKaro
Share this on