πŸ’» 2026 MNC Placement Coding & DSA Master Guide

Top 50 Coding Questions for TCS, Infosys & Accenture Placements 2026

🎯 Official 2026 Direct Technical Answer

Technical coding assessments for TCS NQT, Infosys DSE/SP, and Accenture in 2026 focus on arrays, string manipulation, two-pointer techniques, hash maps, recursion, and basic dynamic programming. Mastering time complexity constraints (O(N) vs O(N^2)) is mandatory to pass all hidden test cases within allotted test timers.

πŸ“… Last Updated: November 2026 Edition
πŸ‘₯ Fact-Checked By: Technical Curriculum Review Desk
πŸ† Career Track: MNC Campus Placement Master Program

πŸ“Š Top Repeated MNC Placement Coding Patterns Matrix

Algorithm PatternHigh-Frequency ProblemOptimal Time ComplexityTarget MNC Companies
Two PointersTwo Sum in Sorted Array / Pair with Target DifferenceO(N) time, O(1) spaceTCS NQT, Infosys, Cognizant
Hash Map FrequencyFirst Non-Repeating Character in a StringO(N) time, O(1) space (26 chars)Accenture, Wipro, Capgemini
Array ManipulationTrapping Rain Water / Maximum Subarray Sum (Kadane's)O(N) time, O(1) spaceInfosys SP, TCS Digital, LTIMindtree
String Sliding WindowLongest Substring Without Repeating CharactersO(N) time, O(min(N, M)) spaceAccenture, TCS Prime, Cognizant GenC Next
Dynamic Programming0/1 Knapsack & Climb Stairs ProblemO(N) time, O(N) spaceInfosys DSE, TCS Digital, Persistent Systems
⚑ Live 2026 Interactive Tool

2026 IT Certification Cost & 18% GST Calculator

Calculate exact Pearson VUE exam fees in INR, 18% GST tax breakdown, USD exchange rates & student voucher savings.

Launch Fee Calculator →

πŸ’» Technical Scenarios, Code & Solutions

Question 1

Provide optimal Python and Java solutions for Kadane's Algorithm (Maximum Subarray Sum).

Kadane's algorithm finds the contiguous subarray with the largest sum in O(N) linear time:

Python Solution:
def max_subarray_sum(nums):
    max_so_far = nums[0]
    current_max = nums[0]
    for x in nums[1:]:
        current_max = max(x, current_max + x)
        max_so_far = max(max_so_far, current_max)
    return max_so_far

print(max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]))  # Output: 6

Java Solution:
public static int maxSubArray(int[] nums) {
    int maxSoFar = nums[0];
    int currentMax = nums[0];
    for (int i = 1; i < nums.length; i++) {
        currentMax = Math.max(nums[i], currentMax + nums[i]);
        maxSoFar = Math.max(maxSoFar, currentMax);
    }
    return maxSoFar;
}
Question 2

How do you detect a cycle in a Linked List using Floyd's Tortoise and Hare algorithm?

Use two pointers moving at different speeds (slow moves 1 step; fast moves 2 steps). If a cycle exists, the fast pointer will eventually catch up and meet the slow pointer in O(N) time and O(1) space.

❓ Frequently Asked Technical Questions

Curated by senior corporate mentors and technical hiring leads.

What coding language is best for TCS NQT and Infosys? +
Python and Java are the most popular; Java has faster execution speeds while Python allows faster syntax authoring.
How many coding questions appear in TCS NQT? +
Typically 2 coding questions: 1 basic/intermediate (15 mins) and 1 advanced DSA problem (30 mins).
What causes a Time Limit Exceeded (TLE) error in online platforms? +
Using an O(N^2) nested loop when input constraints (N <= 10^5) require an O(N) or O(N log N) algorithm.
Are built-in library functions allowed in MNC coding rounds? +
Yes, standard libraries like Python collections/sort or Java Arrays/Collections are permitted unless the question explicitly forbids them.
What is the difference between TCS Ninja and TCS Digital/Prime? +
Ninja packages are ~β‚Ή3.6 LPA with basic coding; Digital and Prime packages range from β‚Ή7.0 to β‚Ή9.0 LPA with advanced DSA requirements.
How do you handle edge cases in coding tests? +
Always test empty arrays, single-element inputs, negative integers, duplicate values, and maximum integer constraints.
What is space complexity? +
The amount of memory an algorithm consumes relative to input size, excluding the space taken by the inputs themselves.
Does 4Achievers offer company-specific mock placement drives? +
Yes, 4Achievers runs intensive placement drives covering TCS NQT, Infosys, and Accenture with live compiler simulators.

Master Placement Coding with 1-on-1 Senior Mentorship

Enroll in 4Achievers live mentor-led batches with 24/7 cloud sandbox access, real-world portfolio capstones, and direct interview placement prep.