Top 30 Wipro Turbo Coding Questions & Solutions (DSA, Sliding Window & DP) 2026
Executive Summary: Wipro Turbo Coding Assessment (2026)
The Wipro Turbo coding round tests 2 medium-to-hard algorithmic challenges within 60 minutes. While basic test-cases pass with brute-force (O(N²)), Turbo qualification strictly requires optimal time complexity (O(N) or O(N log N)) to pass hidden stress tests and memory constraints:
- ✓Primary Patterns: Sliding Window, HashMaps, Two Pointers, Dynamic Programming (0/1 Knapsack, Coin Change), and Monotonic Stacks.
- ✓Languages Allowed: C, C++, Java 17, and Python 3. Java and C++ are preferred for strict execution speed.
- ✓Verbal Code Defense: In Technical Round 2, the interviewer will ask you to share your screen and explain why your solution does not exceed space limits.
Maximum Sum Subarray of Size K
Problem Statement: Given an array of positive integers and a number K, find the maximum sum of any contiguous subarray of size K.
public static intmaxSubArraySum(int[] arr, int k) {
if (arr.length < k) return -1;
int windowSum = 0, maxSum = 0;
// Initialize first window
for (int i = 0; i < k; i++) windowSum += arr[i];
maxSum = windowSum;
// Slide window across remaining array
for (int i = k; i < arr.length; i++) {
windowSum += arr[i] - arr[i - k];
maxSum = Math.max(maxSum, windowSum);
}
return maxSum;
}
Complexity: Time: O(N) because each element enters and leaves the window exactly once. Space: O(1) as no auxiliary data structures are allocated.
0/1 Knapsack Problem (Bounded DP)
Problem Statement: Given weights and values of N items, determine the maximum value that can be accommodated in a knapsack of capacity W.
defknapSack(W, wt, val, n):
dp = [0] * (W + 1)
for i in range(n):
# Iterate backwards to prevent reuse of current item
for w in range(W, wt[i] - 1, -1):
dp[w] = max(dp[w], val[i] + dp[w - wt[i]])
return dp[W]
Verbal Defense Tip: Explain why you iterate backwards from W down to wt[i]: "Iterating backwards ensures each item is counted at most once in a 1D DP array, avoiding 2D matrix overhead."
Next Greater Element (Circular Array)
Problem Statement: Given an array, print the Next Greater Element (NGE) for every element. If no greater element exists, output -1.
public int[] nextGreaterElements(int[] nums) {
int n = nums.length;
int[] result = new int[n];
Arrays.fill(result, -1);
Deque<Integer> stack = new ArrayDeque<>();
for (int i = 0; i < 2 * n; i++) {
while (!stack.isEmpty() && nums[stack.peek()] < nums[i % n]) {
result[stack.pop()] = nums[i % n];
}
if (i < n) stack.push(i);
}
return result;
}
Complexity: Time: O(N) because every index is pushed and popped from the stack at most once. Space: O(N) stack auxiliary memory.
Complete 30 Wipro Turbo Coding Questions Master Checklist
| # | Problem Name | Core Pattern | Target Complexity |
|---|---|---|---|
| 1 | Check String Rotation | String Concatenation | O(N) |
| 2 | Longest Substring Without Repeating | Sliding Window + HashMap | O(N) |
| 3 | 0/1 Knapsack Problem | Dynamic Programming | O(N*W) |
| 4 | Next Greater Element (Circular) | Monotonic Stack | O(N) |
| 5 | Trapping Rain Water | Two Pointers | O(N) |
| 6 | Coin Change (Minimum Coins) | Dynamic Programming | O(N*Amount) |
| 7 | Detect Cycle in Directed Graph | DFS + Recursion Stack | O(V + E) |
| 8 | Lowest Common Ancestor in BST | Tree Traversal | O(H) |
| 9 | Rotate Matrix by 90 Degrees | Transpose & Reverse | O(N²) |
| 10 | Valid Parentheses Expression | Stack Data Structure | O(N) |
| 11 | Longest Common Subsequence (LCS) | 2D Dynamic Programming | O(M*N) |
| 12 | Merge Intervals | Sorting + Interval Comparison | O(N log N) |
| 13 | LRU Cache Design (Logic Viva) | HashMap + Doubly Linked List | O(1) Get/Put |
| 14 | Find All Anagrams in a String | Fixed Size Sliding Window | O(N) |
| 15 | Kth Smallest Element in Array | QuickSelect / Max-Heap | O(N) Avg |