PapersAdda★
archivelatest 6 nov 2026source-led
est. 2026
delhi/ncr edition
content stamp 6 Nov 2026
PapersAdda★
placement and prep archive, source-anchored
guides, routes, and source notes
source notes on individual briefs
section: Company Placement Papers / placement papers / Wipro
04 Nov 2026
placement brief / Company Placement Papers / placement papers / Wipro / 04 Nov 2026

Wipro Coding Questions 2026: NLTH Practice Set

What Wipro's own page says about NLTH coding, what candidate sources add, and 8 original tested practice problems in Python and C++.

on this page§ 09
Placement PapersExam PatternSyllabus 2026Prep RoadmapInterview GuideEligibilitySalary GuideCutoff Trends
advertisement

Practice problems in the style of the Wipro NLTH coding round, with Python and C++ solutions

PapersAdda is independent and is not affiliated with Wipro. These problems are our own writing and none was asked in a real Wipro test.

What Wipro's own page establishes

The page is titled Elite National Talent Hunt and is carried on the Superset platform (app.joinsuperset.com) with the line "Content provided by Wipro". It names the 2023 batch ("Year of passing: 2023") and "National Talent Hunt 2023", so read it as the last official wording we could reach, not as a 2026 notice. The assessment step reads: an 80-minute online assessment testing verbal, analytical, quantitative and written communication skills "followed by coding". Wipro's careers site at careers.wipro.com shows no assessment details in the text we could read on 31 October 2026.

Two safety facts from the same page are worth keeping. Wipro states it does not charge any fee at any stage of the program, and that only registrations made at Wipro's official recruitment website are valid. If an agent sells you a slot, a paper or an answer key, that is not Wipro.

What candidate sources add

FACE Prep's Wipro NLTH article (dated August 2026) describes the coding section as two programming problems in 60 minutes, with C, C++, Java and Python supported, at generally easy to medium difficulty: the first problem often a straightforward array or string task, the second slightly harder. It also says a shorter format with aptitude and an essay only exists for some drives. That is one candidate-facing site, so weigh it as one voice, not as Wipro's rule.

The same article lists topics that come up regularly: arrays and strings, sorting and searching, hashing and recursion, basic mathematics and number problems, linked lists, stacks and queues, two-pointer and sliding-window patterns, and output prediction and debugging.

Wipro-side numbers in PapersAdda's own guides are candidate-reported as well; read them next to this page: Wipro NLTH 2026 complete guide and Wipro Elite NTH placement papers.

Topic ladder: what to practise in what order

Wipro publishes no syllabus for the coding block, so this ladder follows the candidate topic list above and puts the cheapest wins first.

OrderTopic from the candidate listProblems on this page
1Arrays and strings1, 8
2Basic mathematics and number problems2, 4, 6
3Sorting and searching, merging3
4Two-pointer and sliding window5
5Hashing7 (the hardest here)

If you have only a week, do the first three rows and treat Problem 7 as the stretch goal.

Practice problems in the style of the Wipro coding round

All eight are original. Each program reads standard input and prints to standard output; real platforms may wrap input differently, so adapt only the reading lines.

Problem 1: First character that appears once

Given a lowercase string, print the 0-based position of the first character that occurs exactly once in the whole string, or -1 if there is none.

Input format: a single line with the string.

Output format: one integer.

Worked example:

Input:
loveleetcode
Output:
2

l appears twice and o appears twice, but v appears once, at position 2.

Idea: count every character first, then scan again from the left for the first count of 1.

s = input().strip()
count = {}
for ch in s:
    count[ch] = count.get(ch, 0) + 1
ans = -1
for i, ch in enumerate(s):
    if count[ch] == 1:
        ans = i
        break
print(ans)
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin >> s;
    int cnt[256] = {0};
    for (unsigned char ch : s) cnt[ch]++;
    int ans = -1;
    for (size_t i = 0; i < s.size(); i++) {
        if (cnt[(unsigned char)s[i]] == 1) { ans = (int)i; break; }
    }
    cout << ans << endl;
    return 0;
}

Time complexity: O(n) time, O(1) extra space for a fixed alphabet.

Problem 2: Find the missing number

n different integers are chosen from 1 to n + 1. Exactly one number in that range is missing. Print it.

Input format: first line n, second line the n numbers in any order.

Output format: the missing number.

Worked example:

Input:
4
1 2 4 5
Output:
3

The range is 1 to 5, whose total is 15. The given numbers add up to 12, and 15 minus 12 is 3.

Idea: subtract the sum of the input from the formula (n + 1)(n + 2) / 2 for the full range.

import sys
data = sys.stdin.read().split()
n = int(data[0])
nums = list(map(int, data[1:1 + n]))
total = (n + 1) * (n + 2) // 2
print(total - sum(nums))
#include <bits/stdc++.h>
using namespace std;
int main() {
    long long n;
    cin >> n;
    long long total = (n + 1) * (n + 2) / 2;
    for (long long i = 0; i < n; i++) {
        long long x;
        cin >> x;
        total -= x;
    }
    cout << total << endl;
    return 0;
}

Time complexity: O(n) time, O(1) extra space.

Problem 3: Median of two sorted arrays

Two sorted arrays of non-negative integers are given (one of them may be empty, but not both). Print the median of all values together with exactly one digit after the decimal point.

Input format: first line n and m, second line the n values of the first array, third line the m values of the second (an empty line if m is 0).

Output format: the median with one decimal place.

Worked example:

Input:
2 2
1 3
2 4
Output:
2.5

Merged, the values are 1, 2, 3, 4. With an even count the median is the average of the middle two, (2 + 3) / 2 = 2.5.

Idea: merge the two arrays with two pointers as in merge sort, then read the middle value or the middle two.

import sys
data = sys.stdin.read().split()
n, m = int(data[0]), int(data[1])
a = list(map(int, data[2:2 + n]))
b = list(map(int, data[2 + n:2 + n + m]))
i = j = 0
merged = []
while i < n and j < m:
    if a[i] <= b[j]:
        merged.append(a[i]); i += 1
    else:
        merged.append(b[j]); j += 1
merged.extend(a[i:])
merged.extend(b[j:])
t = n + m
if t % 2 == 1:
    med = merged[t // 2]
else:
    med = (merged[t // 2 - 1] + merged[t // 2]) / 2
print(f"{med:.1f}")
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, m;
    cin >> n >> m;
    vector<long long> a(n), b(m), merged;
    for (auto &x : a) cin >> x;
    for (auto &x : b) cin >> x;
    int i = 0, j = 0;
    while (i < n && j < m) {
        if (a[i] <= b[j]) merged.push_back(a[i++]);
        else merged.push_back(b[j++]);
    }
    while (i < n) merged.push_back(a[i++]);
    while (j < m) merged.push_back(b[j++]);
    int t = n + m;
    double med = (t % 2 == 1) ? (double)merged[t / 2]
                              : (merged[t / 2 - 1] + merged[t / 2]) / 2.0;
    printf("%.1f\n", med);
    return 0;
}

Time complexity: O(n + m) time, O(n + m) extra space.

Problem 4: Count primes in a range

Given L and R, count the prime numbers p with L <= p <= R, where 1 <= L <= R <= 1000000.

Input format: one line with L and R.

Output format: one integer.

Worked example:

Input:
10 30
Output:
6

The primes between 10 and 30 are 11, 13, 17, 19, 23 and 29, which is six numbers.

Idea: build a sieve up to R once, crossing out multiples starting at i times i, then count the survivors between L and R.

import sys
l, r = map(int, sys.stdin.read().split())
sieve = bytearray([1]) * (r + 1)
sieve[0] = 0
if r >= 1:
    sieve[1] = 0
i = 2
while i * i <= r:
    if sieve[i]:
        for j in range(i * i, r + 1, i):
            sieve[j] = 0
    i += 1
print(sum(sieve[l:r + 1]))
#include <bits/stdc++.h>
using namespace std;
int main() {
    int l, r;
    cin >> l >> r;
    vector<char> sieve(r + 1, 1);
    sieve[0] = 0;
    if (r >= 1) sieve[1] = 0;
    for (long long i = 2; i * i <= r; i++) {
        if (sieve[i]) {
            for (long long j = i * i; j <= r; j += i) sieve[j] = 0;
        }
    }
    int count = 0;
    for (int i = l; i <= r; i++) count += sieve[i];
    cout << count << endl;
    return 0;
}

Time complexity: O(R log log R) time, O(R) extra space.

Problem 5: Longest stretch with at most two kinds of letters

Given a lowercase string, find the length of the longest contiguous piece that contains at most two different characters.

Input format: one non-empty line.

Output format: one integer.

Worked example:

Input:
eceba
Output:
3

The piece ece uses only e and c and has length 3. No longer piece stays within two letters.

Idea: grow a window to the right; when it holds three kinds of letters, shrink it from the left until it holds two again, and track the best length.

s = input().strip()
count = {}
left = 0
best = 0
for right, ch in enumerate(s):
    count[ch] = count.get(ch, 0) + 1
    while len(count) > 2:
        c = s[left]
        count[c] -= 1
        if count[c] == 0:
            del count[c]
        left += 1
    best = max(best, right - left + 1)
print(best)
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin >> s;
    map<char, int> cnt;
    int left = 0, best = 0;
    for (int right = 0; right < (int)s.size(); right++) {
        cnt[s[right]]++;
        while (cnt.size() > 2) {
            char c = s[left];
            if (--cnt[c] == 0) cnt.erase(c);
            left++;
        }
        best = max(best, right - left + 1);
    }
    cout << best << endl;
    return 0;
}

Time complexity: O(n) time, O(1) extra space.

Problem 6: Difference between the two diagonals

For a square matrix of size n, add the main diagonal (top-left to bottom-right) and the other diagonal (top-right to bottom-left). Print the absolute difference of the two sums. A centre cell counts in both sums.

Input format: first line n, then n lines of n integers each.

Output format: one non-negative integer.

Worked example:

Input:
3
11 2 4
4 5 6
10 8 -12
Output:
15

The main diagonal is 11 + 5 + (-12) = 4. The other diagonal is 4 + 5 + 10 = 19. The difference is 15.

Idea: cell (i, j) lies on the main diagonal when i = j and on the other one when i + j = n - 1.

import sys
data = sys.stdin.read().split()
n = int(data[0])
vals = list(map(int, data[1:1 + n * n]))
primary = sum(vals[i * n + i] for i in range(n))
secondary = sum(vals[i * n + (n - 1 - i)] for i in range(n))
print(abs(primary - secondary))
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    long long primary = 0, secondary = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            long long x;
            cin >> x;
            if (i == j) primary += x;
            if (i + j == n - 1) secondary += x;
        }
    }
    cout << llabs(primary - secondary) << endl;
    return 0;
}

Time complexity: O(n squared) time to read the matrix, O(1) extra space.

Problem 7: Subarrays with a given sum

Count the contiguous subarrays whose elements add up to K. The values can be negative or zero, so a plain two-pointer window will not work.

Input format: first line n and K, second line n integers.

Output format: one integer.

Worked example:

Input:
5 7
3 4 7 2 -3
Output:
2

The subarray 3, 4 adds to 7 and the single value 7 adds to 7. No other contiguous piece does, so the answer is 2.

Idea: keep a running prefix sum and a map of how many times each prefix sum has appeared; a subarray ends here whenever prefix minus K was seen before.

import sys
from collections import defaultdict
data = sys.stdin.read().split()
n, k = int(data[0]), int(data[1])
a = list(map(int, data[2:2 + n]))
seen = defaultdict(int)
seen[0] = 1
prefix = 0
count = 0
for x in a:
    prefix += x
    count += seen[prefix - k]
    seen[prefix] += 1
print(count)
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    long long k;
    cin >> n >> k;
    unordered_map<long long, long long> seen;
    seen[0] = 1;
    long long prefix = 0, count = 0;
    for (int i = 0; i < n; i++) {
        long long x;
        cin >> x;
        prefix += x;
        auto it = seen.find(prefix - k);
        if (it != seen.end()) count += it->second;
        seen[prefix]++;
    }
    cout << count << endl;
    return 0;
}

Time complexity: O(n) average time, O(n) extra space.

Problem 8: Reverse every word

Reverse the letters of each word in a sentence but keep the word order. Words are separated by single spaces.

Input format: one line.

Output format: the transformed sentence.

Worked example:

Input:
hello world
Output:
olleh dlrow

Each word is reversed on its own: hello becomes olleh and world becomes dlrow.

Idea: split on spaces, reverse each piece, join with spaces.

sentence = input().strip()
print(" ".join(word[::-1] for word in sentence.split(" ")))
#include <bits/stdc++.h>
using namespace std;
int main() {
    string line;
    getline(cin, line);
    istringstream in(line);
    string w, out;
    bool first = true;
    while (in >> w) {
        reverse(w.begin(), w.end());
        if (!first) out += " ";
        out += w;
        first = false;
    }
    cout << out << endl;
    return 0;
}

Time complexity: O(n) time and O(n) extra space for n characters.

How the solutions were verified

Every Python and C++ program was run on hand-checked cases (four to six per problem, including the smallest legal input) and on 60 random inputs per problem, each compared with a separate brute-force checker. All runs matched. C++ was compiled with g++ in C++17 mode. The test machine had no Java compiler, so none is shown.

Mistakes that cost marks

  • Printing extra text. Judges compare output exactly, so a stray "Answer:" fails every case.
  • Reading input line by line when the platform puts values on one line. Reading all tokens at once avoids this.
  • Skipping the empty case. Problem 3 above allows one of the two arrays to be empty.
  • Using a nested loop on a limit that needs a linear pass. Problem 4 runs to a million, which is why it uses a sieve.
  • Submitting code that does not compile. Run a final compile before you submit.

WHAT PAPERSADDA THINKS

Wipro's coding block, as the candidate source describes it, is a fair test of whether you can finish. The two-problem shape rewards the candidate who gets problem one fully correct in ten minutes and then has fifty left for problem two. Order your attempt that way. For the Turbo track, see our Elite vs Turbo comparison, and note it rests on candidate reports.

Do not spend your time hunting for a leaked paper. Sixty minutes of this practice set teaches more than a memorised answer, and Wipro's NTH page says only registrations made at its official recruitment website are valid.

Frequently Asked Questions

What does Wipro say about the coding part of its fresher test?

Wipro's own Elite National Talent Hunt page, which names the 2023 batch, says the online assessment tests verbal, analytical, quantitative and written communication skills followed by coding. It does not state the number of coding problems, the time or the languages. Check your own invitation for the current format.

How many coding problems are there in Wipro NLTH?

Wipro does not publish a number on a page PapersAdda could read. FACE Prep, a candidate-facing site, describes two programming problems in 60 minutes in an article dated August 2026, and says a shorter format with only aptitude and an essay exists for some drives. Treat both as candidate-reported.

Which programming languages can I use in the Wipro coding section?

FACE Prep lists C, C++, Java and Python as supported languages. Wipro does not publish the list on a page we could read, so confirm it on your test screen. The solutions here are in Python and C++.

Were these practice problems asked in a real Wipro test?

No. PapersAdda wrote all eight for practice, in the easy to medium band that the candidate source describes. None of them is, or claims to be, a real Wipro question.

Are the solutions tested?

Yes. Each Python and C++ program was run on hand-checked cases and on 60 random cases compared against a brute-force checker, and every run matched. The test machine had no Java compiler, so there is no Java code here.

Does Wipro charge a fee for the Elite National Talent Hunt?

Wipro's page says Wipro does not charge any fee at any stage of the program and that only registrations made at Wipro's official recruitment website are valid. Anyone asking for money to give you a test slot or answers is not acting for Wipro.

advertisement
Sources and review notesreviewed 4 Nov 2026
Verification window
Page last edited 4 Nov 2026 by Aditya Sharma. A review date records an editorial edit, not a guarantee that every external fact is still current.
Evidence labels

Official notices, candidate reports, offer documents, and editorial practice questions carry different confidence levels. The visible source list lets you inspect the evidence instead of relying on a blanket verification badge.

Verification policy: /editorial-standards/. Found something incorrect? Submit a correction - we respond within 48 hours.

topic cluster

More resources in Company Placement Papers

Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.

Start with the pillar guide: Wipro Elite NTH 2026 (NLTH): Eligibility, Pattern & Prep Guide - the complete, source-anchored reference for this cluster.

Open Company Placement Papers hubBrowse all articles

company hub

Explore all Wipro resources

Open the Wipro hub to jump between placement papers, interview questions, salary guides, and related pages in one place.

Open Wipro hub

paid contributor programme

Sat Wipro this year? Share your story, earn ₹500.

First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story with byline.

Submit your story →

ready to practice?

Take a free timed mock test

Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.

Start free mock test →
related guides
more from PapersAdda
Topics & PracticePlacement Aptitude Mock Test 3 - 2026 (Timed Full Set with Solutions)
12 min read
Topics & PracticePlacement Aptitude Mock Test 4 - 2026 (Timed Full Set with Solutions)
11 min read
Topics & PracticePlacement Aptitude Mock Test 5 - 2026 (Timed Full Set with Solutions)
11 min read
Topics & PracticePlacement Aptitude Mock Test 6 - 2026 (Timed Full Set with Solutions)
12 min read

Share this guide