Sasken's coding round is one of the toughest parts of its selection process — one hands-on coding question in 60 minutes, decent enough marks riding on it. These questions are reconstructed from real student feedback after their Sasken assessments.
A note on accuracy: The original feedback we collected was fragmented, inconsistently worded, and in a few cases missing key details (exact rules, full sample data). Each question below has been reformatted into the standard assessment pattern (Problem Statement → Input Format → Output Format → Sample Input/Output → Explanation). Where the underlying logic could be reliably confirmed from the given sample, it's presented with full confidence. Where the feedback was too vague to reconstruct exactly, this is clearly flagged, along with the most plausible interpretation and similar problems to practice instead.
Preparing for Sasken? Use all three resources together:
- Sasken Technologies Hiring 2027 — role details, eligibility & selection process
- Sasken Assessment — MCQ Practice Bank — 140 MCQs on C, C++, DSA & OS
Question 1: Count Right-Angled Triangles in a Binary Matrix
Confirmed logic — appeared in two separate feedback entriesProblem Statement: Given a binary matrix (containing only 0s and 1s), count the total number of right-angled triangles that can be formed using the 1s in the matrix. A right-angled triangle is formed by three cells containing 1, where one cell acts as the right-angle corner, with one other 1 somewhere else in its row and one other 1 somewhere else in its column.
Input Format: First line: number of rows R and columns C. Next R lines: C space-separated values (0 or 1) representing the matrix.
Output Format: A single integer — the total count of right-angled triangles.
Constraints: 1 ≤ R, C ≤ 100 (typical range; not explicitly confirmed)
Sample Input 1:
3 4
1 0 1 0
1 0 0 0
1 0 0 0
Sample Output 1: 2
Sample Input 2 (dimensions only, matrix not remembered):
4 4
Sample Output 2: 4
Explanation: For every cell (i, j) containing 1, it can act as the right-angle vertex for (count of 1s in row i − 1) × (count of 1s in column j − 1) triangles. Summing this over all 1-cells gives the answer. For Sample 1: Row 0 has two 1s (cols 0, 2), Column 0 has three 1s (rows 0,1,2). Only cell (0,0) contributes: (2−1) × (3−1) = 1 × 2 = 2. All other 1-cells contribute 0, giving a total of 2.
One student recalled this as "inverted" right-angle triangles — likely just referring to the orientation of the right-angle vertex (top-left vs. bottom-right). The core row/column counting logic is the same either way.
Question 2: Closest Greater Subsequence Number
Problem Statement: Given two numbers, generate all possible numbers formed by subsequences of the digits of the first number (maintaining their original order). Among all these subsequence-numbers, find the one that is closest to the second number but strictly greater than it.
Input Format: Two integers — num1 (source of digits) and num2 (target to exceed).
Output Format: The closest subsequence-number greater than num2. Print -1 if none exists.
The sample recalled by the student (num1=2, num2=-1011,1001 → Output: {5,3}) doesn't cleanly fit the described logic — it may involve multiple test cases bundled together or a transcription error. Treat that specific sample with caution.
Illustrative example (reconstructed for clarity):
Input: num1 = 1234, num2 = 20
Output: 23
Explanation: Subsequences of 1234 (order preserved): 1, 2, 3, 4, 12, 13, 14, 23, 24, 34, 123, 124, 134, 234, 1234... The smallest one greater than 20 is 23.
Practice tip: This is fundamentally a subsequence-generation + closest-value-search problem. Practice generating subsequences via recursion/bitmasking, then use sorting or a min-comparison scan to find the closest value greater than a target.
Question 3: Digit-Sum Augmented Value ("Augmented Value")
Problem Statement: Given a number, compute its "augmented value" by adding ten times the sum of its digits to the original number.
Input Format: A single integer N.
Output Format: The computed augmented value.
Sample Input: 421
Sample Output: 491
Explanation: Sum of digits of 421 = 4+2+1 = 7. Augmented value = 421 + (7 × 10) = 421 + 70 = 491. ✅ Matches the sample.
Reconstructed from a single data point — the actual rule in the real question may differ slightly (e.g. a different multiplier), so verify if you can find a second example.
Question 4: Digit Subsequence / Array-Based Question
No specifics were recalled for this one. Since arrays are the single most common topic in Sasken's coding round, practice these high-frequency array patterns instead:
- Rotate array by k positions (in-place)
- Maximum subarray sum (Kadane's algorithm)
- Rearranging positive/negative numbers alternately
- Find missing/duplicate number in a range
- Two-pointer / sliding window subarray problems
Question 5: Count Substrings with "Round Keys" in a Binary String
Problem Statement (partial): Given a binary string, count the number of substrings that satisfy a specific property referred to as a "round key" (the definition was provided within the actual question but not recalled by the student).
Input Format: A binary string S. Output Format: Count of substrings meeting the round-key condition.
Cannot be reliably reconstructed without knowing what "round key" means in this context. It's likely a made-up term specific to that year's question, defining some pattern (e.g. substrings with equal 0s and 1s, palindromic substrings, or substrings that are valid binary representations of a "key" value). Practice these adjacent, high-frequency binary-string problems instead:
- Count substrings with equal number of 0s and 1s
- Count binary substrings where all 1s come before all 0s (or vice versa)
- Count substrings with exactly k ones
Question 6: Character-to-Range Hashmap Lookup ("Waste of Time")
Problem Statement (partial): Each lowercase letter is mapped (via a hashmap) to a fixed array of numbers, e.g. a = [1,7], b = [3,4], ..., z = [2,5,10]. Given a single character as input, compute some output value derived from its mapped array.
Input Format: A single lowercase character. Output Format: A computed integer.
Sample Input: e
Sample Output: 30
Without knowing the actual array mapped to 'e', the exact computation (sum, product, range difference, etc.) cannot be confirmed. Given the title "Waste of Time," this may involve calculating elapsed/idle time from interval-style array values (e.g. end − start, or summing gaps between intervals). Practice hashmap-based character lookup problems and interval/range arithmetic as a close substitute.
Question 7: Remaining Energy After Repeated Min-Max Reduction ("Destroy Energy of Monsters")
Reconstruction matches the sample exactlyProblem Statement: Given an array of monster energies, repeatedly take the current smallest and largest values, replace them both with a single value equal to their difference (largest − smallest), and repeat this process until only one value remains. Output that final remaining value.
Input Format: First line: size of array n. Second line: n space-separated integers.
Output Format: A single integer — the remaining energy.
Sample Input:
4
1 2 3 4
Sample Output: 2
Explanation (verified step-by-step against the sample):
Step 1: smallest=1, largest=4 -> diff=3 -> array becomes [2, 3, 3]
Step 2: smallest=2, largest=3 -> diff=1 -> array becomes [3, 1]
Step 3: smallest=1, largest=3 -> diff=2 -> array becomes [2]
Final remaining energy = 2 (matches sample)
This reconstruction matches the sample exactly, but is based on a single test case — verify the rule if a second example becomes available. A min-heap/max-heap (or sorting each round) is the efficient way to implement this.
Question 8: Elevator Reachability ("Climbing Up and Down")
Problem Statement (reconstructed): A building has F floors and L lifts, each lift servicing a fixed, ordered list of floors (its "route"). Starting from a given floor, you may ride a lift only if you board it at the start of its route, traveling through its stops in order. You may transfer to a different lift only at a floor common to both lifts' routes. Find the highest floor you can ultimately reach.
Input Format: Line 1: number of floors F. Line 2: number of lifts L. Next L lines: the ordered list of floors each lift services. Starting floor is given separately.
Output Format: The highest floor reachable.
Sample Input:
F = 10
L = 2
Lift 1 floors: 2, 5, 9, 3
Lift 2 floors: 3, 4, 7
Starting floor: 2
Sample Output: 7
Explanation (best-fit interpretation): Starting at floor 2 (the first stop of Lift 1's route), you ride Lift 1 through its stops (2 → 5 → 9 → 3). Floor 3 is also the starting stop of Lift 2's route, allowing a transfer. From floor 3, riding Lift 2 (3 → 4 → 7) reaches a maximum of floor 7.
This assumes lifts follow a fixed route (not "go to any of my floors freely") and that transfers only happen at a shared starting floor — an assumption made to fit the sample output of 7 (since floor 9, reachable directly via Lift 1, is higher but apparently not the intended answer). Treat this as a graph/BFS-style "reachability through shared nodes" problem for practice, and confirm the exact transfer rule if you encounter this question again.
Question 9: Sort an Array (Basic)
Fully clear — no ambiguityProblem Statement: Write a program to sort an array of 10 integers, provided by the user, in ascending order.
Input Format: 10 space-separated integers.
Output Format: The sorted array, space-separated, in ascending order.
Sample Input:
5 4 8 1 0 9 7 6 2 3
Sample Output:
0 1 2 3 4 5 6 7 8 9
Explanation: A direct sorting problem — any O(n log n) or O(n²) sort works fine given the tiny input size (n=10). Good opportunity to write it manually (e.g. bubble/insertion sort) rather than using a built-in sort function, since assessments sometimes ask you to implement sorting logic yourself rather than call a library function.
Continue your Sasken prep:
- Sasken Assessment — MCQ Practice Bank — 140 MCQs on C, C++, DSA & OS with explanations
- Sasken Technologies Hiring 2027 — full role details, eligibility & how to apply