TCS CodeVita is one of the largest global coding competitions run by a corporate entity, and it sits at a unique intersection: it is simultaneously a prestigious competitive programming contest, a talent identification mechanism for TCS’s premium hiring tracks, and the most demanding preparation ground for the TCS NQT Advanced Coding section. Candidates who participate in CodeVita and perform well earn direct interview access to TCS’s Digital and Prime profiles - bypassing the standard NQT route entirely. Candidates who prepare for CodeVita but do not win still benefit enormously because the CodeVita preparation skill set maps directly onto what TCS Digital Advanced Coding requires. This guide covers the competition completely: its structure, its scoring, how it connects to hiring, how it differs from standard competitive programming, and a systematic 60-day preparation plan that takes candidates from beginner to genuinely competition-ready.

TCS Guide

What TCS CodeVita Is

The Competition at Scale

TCS CodeVita is TCS’s global programming contest, open to engineering students across the world. It operates at a scale that makes it one of the largest college coding competitions globally - hundreds of thousands of registrations across dozens of countries, with participants from India, the United States, Mexico, Canada, Australia, Japan, and many more.

The competition’s scale serves TCS’s talent identification purpose: with participation at this volume, CodeVita surfaces exceptional coders who might otherwise not be on TCS’s radar through campus placement alone. A strong CodeVita performance puts a candidate directly in front of TCS’s advanced hiring pipeline regardless of which college they attend.

The Dual Nature of CodeVita

CodeVita operates in two modes simultaneously:

As a competition: CodeVita has its own prize structure, global rankings, and the prestige associated with performing well against hundreds of thousands of contestants. The top performers receive cash prizes and global rankings that carry real competitive programming credibility.

As a hiring mechanism: Beyond the prizes, CodeVita performance feeds directly into TCS’s Digital and Prime hiring. Top zone finishers in CodeVita receive direct interview opportunities without needing to go through the standard NQT process. This means CodeVita is simultaneously a competition AND a job application - the same performance serves both goals.

Why CodeVita Exists as a Separate Pathway

TCS created CodeVita partly because the NQT, while rigorous, is a standardised aptitude-plus-coding test rather than a pure coding competition. The NQT identifies strong candidates broadly. CodeVita identifies exceptional coders specifically - the candidates who have invested deeply in competitive programming, who can solve hard algorithm problems under time pressure, and who have the kind of technical ambition that TCS’s advanced practices need.

By running both NQT and CodeVita, TCS ensures it captures the full spectrum of technical talent: the broadly strong NQT candidates for Ninja and Digital, and the specifically exceptional competitive programmers for Digital and Prime through CodeVita.


CodeVita Competition Structure

The Rounds Format

CodeVita typically runs in multiple rounds, progressively filtering from a very large participant pool to a small group of top finishers:

Round 1: Zonal (Regional) Round The widest gate. All registered participants attempt this round. The problems are at Medium to Hard competitive programming difficulty. Participants have a fixed time window (often 24 hours for the online round) to solve as many problems as possible. The time window’s length compensates for global time zones - participants worldwide can attempt the round at a time convenient to them.

The zonal round produces zone-level rankings. Zones are defined geographically (India North, India South, India West, India East, India Central for Indian participants; additional zones for international participants). Top performers in each zone advance.

Round 2: National/Global Round A much smaller pool of qualifiers from Round 1. This round is more difficult and has a stricter time window. Problems are at Hard to Very Hard competitive programming difficulty. The national round identifies the top performers across zones, producing a national/global leaderboard.

Grand Finale (Zone Finalists and National Winner Selection) The most competitive round. A small number of top national/global performers compete for the top positions. Finalists may be brought to a TCS campus or participate in a highly monitored online environment. The grand finale produces the final global rankings and the prize winners.

Problem Difficulty Progression

Round Difficulty (CP equivalent) Number of Problems Time Window
Zonal Round 1 Medium to Hard 6-8 problems 24 hours (online)
National Round Hard to Very Hard 5-7 problems 6-9 hours
Grand Finale Very Hard 4-6 problems 4-6 hours

The Zone System for Indian Participants

For Indian participants, zones are typically:

  • Zone 1: North India (Delhi, Uttar Pradesh, Punjab, Haryana, Rajasthan, Himachal Pradesh, Jammu and Kashmir, Uttarakhand)
  • Zone 2: South India (Tamil Nadu, Karnataka, Kerala, Andhra Pradesh, Telangana)
  • Zone 3: West India (Maharashtra, Gujarat, Goa, Madhya Pradesh, Chhattisgarh)
  • Zone 4: East India (West Bengal, Odisha, Bihar, Jharkhand, North-East states)
  • Zone 5: Central India (may vary by implementation)

Each zone produces a fixed number of qualifiers for the national round. The zonal cutoff varies by zone based on the number of participants and problem difficulty.

The 24-Hour Online Round

The 24-hour window of Round 1 is a distinctive feature that differentiates CodeVita from standard contests like Codeforces rounds (90 minutes to 2 hours). The extended window serves multiple purposes:

Time zone accommodation: With global participation, 24 hours ensures that every participant has at least one optimal time window for serious, alert competition.

Problem style support: CodeVita problems are scenario-based (described below) and often more verbose than standard competitive programming problems. Reading and understanding the problem takes longer. The 24-hour window allows for careful problem parsing.

Multiple approach testing: Unlike a 2-hour contest where a single algorithm strategy must work, the 24-hour format allows testing a brute force approach, identifying where it fails, and iterating to an optimal approach.

Sleep and recovery within the window: Participants can sleep, eat, and return to problems fresh. Endurance is still tested (the best performers work efficiently throughout), but the format is less about sustained peak performance in a single session.

The CodeVita Scoring Mechanism

CodeVita scoring is test-case-based with modifications:

Base score per problem: Each problem has a defined maximum score. Solving the problem completely (all test cases passing) earns the full base score.

Partial scoring: For problems where partial credit is awarded, each test case that passes earns a fraction of the total problem score. A solution that passes 6 of 10 test cases earns approximately 60% of the problem’s maximum score.

Time penalty: Many CodeVita implementations apply a time penalty. The faster you solve a problem (measured from the start of the contest), the higher the effective score. This incentivises solving problems quickly and completely rather than spending excessive time on a single problem.

Optimality bonus: Some CodeVita problems have a secondary scoring layer where solutions that are both correct AND optimal in time complexity earn a bonus. A brute-force solution that passes all test cases may earn 80% of the problem’s maximum score; an optimal solution earns 100%. This incentivises not just correctness but algorithmic efficiency.

Wrong answer penalty: Some rounds penalise wrong submissions (incorrect output for test cases) with a time penalty that effectively reduces the total contest score. This incentivises careful testing before submission.


How CodeVita Performance Connects to TCS Hiring

The Direct Hiring Pathway

The most valuable aspect of CodeVita for career-focused participants is the direct hiring pathway:

Zone Finalists (Round 1 qualifiers): Qualifying from a zone typically earns a direct NQT waiver invitation for TCS Digital consideration. Zone finalists are invited to TCS’s hiring process at the Digital level without needing to appear for NQT. This is the minimum hiring benefit of CodeVita participation.

National Round qualifiers: Candidates who advance to the national round receive a prioritised interview invitation for TCS Digital or Prime, depending on their performance. National round qualifiers have demonstrated advanced competitive programming ability that aligns with Digital and Prime profile expectations.

Grand Finale qualifiers and winners: Top finishers in CodeVita’s grand finale receive premium hiring consideration - Prime profile interviews, fast-tracked hiring processes, and in some cases direct offers contingent on interview performance. The global winner earns the highest-prestige position in TCS’s competitive hiring pipeline.

The Interview Advantage Beyond the Pathway

Even for CodeVita participants who do not advance far in the competition, the experience creates interview advantages:

Resume signal: “Participated in TCS CodeVita” with a zonal ranking noted indicates competitive programming engagement to TCS interviewers. At the Digital interview level, where technical depth is evaluated, having competed in a rigorous competition demonstrates commitment and exposure.

Interview preparation: CodeVita preparation builds exactly the skills tested in TCS Digital technical interviews - algorithmic problem-solving, complexity analysis, clean code production under time pressure. Candidates who have prepared for CodeVita answer the DSA component of Digital technical interviews with noticeably more fluency than those who have not.

Familiarity with TCS coding standards: CodeVita uses TCS iON’s infrastructure and coding standards. Participants who have used the CodeVita coding environment are already comfortable with the interface and submission system used in NQT Advanced Coding and TCS Digital technical coding rounds.

The NQT Advanced Coding Alignment

The strongest argument for CodeVita preparation regardless of competition outcome is the alignment with NQT Advanced Coding. The two sections are prepared by identical skill development:

CodeVita Requirement NQT Advanced Coding Requirement
Medium to Hard competitive programming problems Medium to Hard competitive programming problems
Two complete, correct solutions in 90 minutes Both problems solved completely for Prime consideration
Optimal time complexity required for full score Optimal complexity prevents TLE on hidden test cases
Multiple algorithm patterns (DP, Graph, Greedy, etc.) Multiple algorithm patterns needed across the two problems
Clean code for optimality bonus evaluation Clean code evaluated by human reviewers
Real-world scenario problem framing Same framing style in recent NQT Advanced rounds

The preparation is identical. A candidate who prepares for CodeVita is simultaneously preparing for NQT Advanced Coding. This dual benefit makes CodeVita preparation the highest-leverage competitive coding investment a TCS-aspiring candidate can make.


How CodeVita Problems Differ from Standard Competitive Programming

The Scenario-Based Problem Style

Standard competitive programming problems (Codeforces, CodeChef, ICPC) are typically stated mathematically or abstractly: “Given an array of N integers, find the maximum sum of a non-empty subsequence such that no two elements in the subsequence are adjacent.”

CodeVita problems are framed as real-world scenarios: “A logistics company manages delivery routes across N cities. Due to supply chain constraints, certain routes have restricted access during specific conditions. Given a network of routes and their constraints, determine the minimum cost path from the distribution centre to all delivery destinations while respecting all restrictions.”

Both problems may reduce to the same underlying algorithm (in these examples, dynamic programming and shortest path respectively), but the CodeVita version requires significant additional work:

  1. Reading and parsing a longer, narrative problem statement
  2. Identifying which elements of the scenario translate to which mathematical structures
  3. Distinguishing relevant constraints from narrative context

This scenario-based framing is both a challenge and a distinguishing skill. Candidates who practise competitive programming only with abstract problem statements often struggle with CodeVita’s narrative style even when they know the algorithm. Practice with scenario-based problems is a specific CodeVita preparation requirement.

Problem Complexity Characteristics

Multi-constraint problems: CodeVita problems frequently have multiple simultaneous constraints. A single problem might require:

  • Finding the optimal path in a graph
  • Subject to node visit order constraints
  • With some nodes marked as mandatory
  • And some edges time-dependent

Each constraint individually is familiar; the combination creates a problem that does not map directly to a standard known algorithm. The solver must compose multiple techniques rather than applying a single learned solution.

Partial solution opportunities: Because CodeVita has partial scoring on test cases, a correct brute-force solution that handles small inputs is valuable even when the optimal algorithm is not found. This differs from standard competitive programming where only full-score solutions count.

This creates a two-tier CodeVita strategy:

  • Tier 1: Brute-force solution → earns partial test case score → submit early
  • Tier 2: Optimised solution → earns remaining test case score and optimality bonus → replace brute force

This layered approach maximises score when optimal solutions are elusive.

Input parsing complexity: CodeVita problems frequently require sophisticated input parsing - reading structured data, building complex data structures from input, and handling edge cases in the input format itself. Standard competitive programming problems have cleaner, simpler input formats by convention.


The CodeVita Compiler and Language Environment

Supported Languages

CodeVita supports a broad set of programming languages:

  • C (GCC)
  • C++ (GCC, typically C++14 or C++17)
  • Java (JDK)
  • Python 3
  • C# (.NET)
  • Perl
  • PHP
  • Ruby

The language choice:

For maximum performance and competitive advantage, C++ is the dominant choice among top CodeVita performers for several reasons:

  • Fastest execution speed (critical when time limits are tight)
  • Broadest STL support (sort, priority_queue, map, set all highly optimised)
  • bits/stdc++.h includes everything in one header

Java is a strong second choice for candidates comfortable with it. Python is viable for problems where the time limit is generous, but Python’s execution speed disadvantage (roughly 5-10x slower than C++) can cause TLE on hard problems with tight constraints.

The relationship to TCS NQT compiler:

TCS iON (which CodeVita runs on) uses GCC for C/C++ compilation. The same compiler, the same standards, and the same general environment as NQT Advanced Coding. Practising on CodeVita’s environment means zero adaptation required when using the same environment for NQT.

Input and Output in CodeVita

CodeVita problems typically use standard input (stdin) and standard output (stdout), unlike TCS NQT’s command-line argument input in some problems. The reason: CodeVita problems have complex, multi-line inputs that would be unwieldy as command-line arguments.

Typical input patterns in CodeVita:

First line: N M (two integers - size of input)
Next N lines: row of M integers
Last line: Q (number of queries)
Next Q lines: each query as two integers u v

For C++ CodeVita submissions:

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, m;
    cin >> n >> m;

    vector<vector<int>> grid(n, vector<int>(m));
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            cin >> grid[i][j];

    // process and output
    return 0;
}

The ios_base::sync_with_stdio(false) and cin.tie(NULL) lines are essential for fast I/O in competitive programming - they disable synchronisation between C and C++ I/O and untie cin from cout, reducing I/O time significantly for large inputs.


Topic-Wise Competitive Coding Syllabus for CodeVita and NQT Digital

The following topic-wise syllabus covers both CodeVita preparation and NQT Advanced Coding preparation simultaneously, since the skill sets are identical.

Tier 1: Foundation Algorithms (Mandatory for Both)

Dynamic Programming Dynamic programming is the most frequently tested category in both CodeVita and NQT Advanced Coding. Coverage required:

Classical 1D DP:

  • Fibonacci sequence and coin change (learning the DP formulation)
  • Longest Increasing Subsequence (LIS) - standard O(N²) and optimised O(N log N)
  • Maximum subarray (Kadane’s algorithm)
  • Minimum cost path (1D array with steps constraint)

Classical 2D DP:

  • Longest Common Subsequence (LCS) - foundation for edit distance
  • Edit distance (minimum operations to convert string A to string B)
  • Matrix chain multiplication (interval DP pattern)
  • Coin change (count ways and minimum coins)
  • 0/1 Knapsack and variants

DP on grids:

  • Minimum cost path from top-left to bottom-right of a grid
  • Count paths with constraints (obstacles, mandatory waypoints)
  • Longest path in a DAG using DP

DP on trees:

  • Tree DP (diameter, maximum independent set on tree)
  • Subtree property accumulation

Bitmask DP:

  • Travelling Salesman Problem (small N, exponential DP)
  • Optimal assignment with bitmask state

Graph Algorithms Graph problems appear in approximately 25-30% of CodeVita problems.

BFS/DFS:

  • Standard BFS for shortest path in unweighted graphs
  • DFS for connectivity, cycle detection, topological sort
  • Multi-source BFS (BFS from multiple starting points simultaneously)
  • BFS on implicit graphs (state-space search)

Shortest path:

  • Dijkstra’s algorithm for non-negative weights (O((V+E) log V) with priority queue)
  • Bellman-Ford for negative weights (O(VE))
  • Floyd-Warshall for all-pairs shortest path (O(V³))
  • Johnson’s algorithm (awareness level)

Minimum Spanning Tree:

  • Kruskal’s algorithm with Union-Find (O(E log E))
  • Prim’s algorithm (O(E log V) with priority queue)

Advanced graph:

  • Topological sort (Kahn’s algorithm and DFS-based)
  • Strongly Connected Components (Tarjan’s or Kosaraju’s algorithm)
  • Bridges and Articulation Points
  • Bipartite checking and bipartite matching

Data Structures

Standard:

  • Stack, Queue, Deque - implementation and problem-solving applications
  • Priority Queue (min-heap and max-heap applications)
  • Hash maps and hash sets (O(1) average operations)

Intermediate:

  • Segment Tree (range query, point update) - O(log N) operations
  • Binary Indexed Tree / Fenwick Tree (prefix sums, range queries)
  • Trie (prefix tree for string problems)

Advanced (for CodeVita top performers and Prime targeting):

  • Segment Tree with lazy propagation (range update, range query)
  • Persistent data structures (conceptual awareness)
  • Sqrt decomposition

Tier 2: String Algorithms

Pattern matching:

  • KMP (Knuth-Morris-Pratt) algorithm - O(N+M) string matching
  • Z-algorithm - O(N) string analysis
  • Rabin-Karp (hashing-based, randomised)

String structure:

  • Manacher’s algorithm - O(N) palindrome detection
  • Suffix array (awareness level for CodeVita)

String hashing:

  • Polynomial rolling hash for O(1) substring comparison
  • Double hashing to reduce collision probability

Tier 3: Mathematical Algorithms

Number theory:

  • Sieve of Eratosthenes - O(N log log N) prime generation
  • Segmented sieve for large ranges
  • GCD (Euclidean algorithm) and LCM
  • Modular arithmetic (modular exponentiation, modular inverse)
  • Euler’s totient function
  • Chinese Remainder Theorem

Combinatorics:

  • nCr computation with precomputed factorials and modular inverse
  • Lucas’ theorem for large nCr modulo prime
  • Catalan numbers and their applications

Geometry (for CodeVita, rare in NQT):

  • Point-in-polygon check
  • Convex hull (Graham scan)
  • Line intersection

Tier 4: Advanced Techniques

Greedy algorithms:

  • Activity selection and interval scheduling
  • Job scheduling with deadlines
  • Fractional knapsack
  • Greedy by exchange argument proof framework

Divide and conquer:

  • Merge sort and its applications (inversion count)
  • Binary search on the answer (monotone function binary search)
  • Closest pair of points

Game theory:

  • Grundy values / Sprague-Grundy theorem
  • Nim game and variants
  • Game theory DP (minimax with memoisation)

Bit manipulation:

  • XOR properties for sum of subsets
  • Bit counting (popcount / __builtin_popcount)
  • Subset enumeration with bitmasks

CodeVita vs Other Coding Competitions

The Competitive Landscape

Competition Organiser Hiring Connection Difficulty Format
TCS CodeVita TCS Direct TCS Digital/Prime hiring Hard to Very Hard 24-hour online, multi-round
HackWithInfy Infosys Direct Infosys hiring (SIG track) Hard Online contest, multi-round
Code Gladiators Tech Mahindra Tech Mahindra hiring preference Medium to Hard Online, multi-round
Google Code Jam Google No direct hiring, prestige only Very Hard Strict timed rounds
ICPC ACM No direct hiring, highest prestige Very Hard Team-based, strict timed
Facebook Hacker Cup Meta No direct hiring, prestige Very Hard Individual, strict timed
CodeChef SnackDown CodeChef No direct hiring, prestige Hard Team-based, multi-round

CodeVita vs HackWithInfy

The most relevant comparison for candidates choosing where to invest preparation time.

Similarities: Both competitions are run by Indian IT giants (TCS and Infosys). Both directly connect to hiring tracks (TCS Digital/Prime and Infosys SIG respectively). Both are globally open and have multi-round structures.

Differences:

Difficulty calibration: HackWithInfy problems are generally at Hard competitive programming level. CodeVita problems can reach Very Hard, particularly in the National round and Grand Finale. CodeVita requires a deeper competitive programming foundation.

Problem style: HackWithInfy has more traditional competitive programming problem statements. CodeVita has the distinctive scenario-based framing that requires additional parsing skill.

Hiring outcome: HackWithInfy specifically feeds Infosys SIG (Special Initiatives Group), which is a premium technical track. CodeVita feeds TCS Digital and Prime. If you are targeting TCS, CodeVita is the more direct path. If you are targeting Infosys SIG, HackWithInfy is more relevant.

Time format: HackWithInfy rounds are typically shorter (3-5 hours). CodeVita’s 24-hour Round 1 is more accommodating of different schedules.

The dual participation recommendation: Candidates with strong competitive programming foundations should participate in both. The preparation is identical (competitive programming skill set), and the two competitions feed different companies’ premium tracks. Dual participation doubles the hiring pathway.

CodeVita vs Google Code Jam / ICPC

Code Jam and ICPC are prestige competitions without direct hiring pipelines. Unlike CodeVita and HackWithInfy, Google Code Jam and ICPC performance does not translate directly into job offers or interview shortcuts. They are valuable for building competitive programming credentials that signal ability broadly, but they do not offer the specific career acceleration that CodeVita’s hiring pipeline provides.

The difficulty comparison:

  • CodeVita National/Finale level ≈ Codeforces Div.1 B/C level
  • Google Code Jam Round 1/2 ≈ Codeforces Div.1 C/D level
  • ICPC Regionals ≈ Codeforces Div.1 D/E level

For candidates whose goal is a TCS Digital or Prime offer rather than the global competitive programming circuit, CodeVita is the higher-ROI investment.

ICPC as a prestige credential: A strong ICPC regional performance is unambiguously impressive to any TCS interviewer evaluating technical depth. If you have ICPC credentials, lead with them in the technical interview. ICPC preparation (team-based, extremely hard problem solving) also prepares for CodeVita.

CodeVita vs Code Gladiators (Tech Mahindra)

Code Gladiators is Tech Mahindra’s equivalent to CodeVita. Similar structure, similar goals, similar difficulty range. For candidates targeting Tech Mahindra specifically, Code Gladiators is the relevant competition. For TCS targeting, CodeVita is the priority. The preparation overlaps, so participating in both is a reasonable strategy.


The 60-Day CodeVita Preparation Plan

Prerequisites Assessment

Before starting this plan, assess your current competitive programming level:

Level 1 (Beginner, 0-50 LeetCode problems solved): The 60-day plan produces a competitive Round 1 performance. Advancing to national rounds from this starting point within 60 days is ambitious - consider this the 60-day foundation-building cycle to compete more seriously in the next CodeVita cycle.

Level 2 (Intermediate, 50-150 LeetCode Medium problems solved): The 60-day plan can produce Round 1 qualification and potentially national round access.

Level 3 (Advanced, 150+ LeetCode including Hards, active on Codeforces/CodeChef): This plan is a focused intensification. Top zone performance and national round qualification is realistic.

The 60-Day Calendar

Days 1-10: Foundation Data Structures and Basic DP

Day 1-2: Arrays and Two-Pointer Study: Two-pointer technique for sorted arrays, sliding window Practice: 5 LeetCode Easy arrays, 5 LeetCode Medium sliding window Goal: Solve two-pointer problems in under 20 minutes

Day 3-4: Stack and Queue Study: Monotonic stack, queue-based BFS, deque applications Practice: Next Greater Element I and II, Largest Rectangle in Histogram, Binary Tree Level Order Goal: Implement monotonic stack pattern correctly

Day 5-6: Hashing and Frequency Counting Study: HashMap for O(1) lookup, anagram and frequency problems Practice: Two Sum variants, Group Anagrams, Longest Substring Without Repeating Characters Goal: Identify when hashing replaces O(N²) brute force

Day 7-8: Introduction to Dynamic Programming Study: Fibonacci DP, coin change formulation, the “state” concept Practice: Climbing Stairs, Coin Change (minimum coins), House Robber Goal: Write DP correctly from scratch for 1D sequence problems

Day 9-10: 2D Dynamic Programming Introduction Study: Grid DP, LCS, Edit Distance Practice: Unique Paths, Minimum Path Sum, Longest Common Subsequence Goal: Correctly define 2D DP state and transition

Days 11-20: Graphs and Advanced DP

Day 11-12: Graph Representation and BFS Study: Adjacency list vs matrix, BFS for shortest path Practice: Number of Islands, Rotting Oranges, Word Ladder Goal: Implement BFS from scratch with correct visited set management

Day 13-14: DFS and Cycle Detection Study: DFS for connectivity, cycle detection in directed and undirected graphs Practice: Course Schedule I and II, Clone Graph, Pacific Atlantic Water Flow Goal: Identify cycle detection in directed vs undirected graphs

Day 15-16: Dijkstra’s and Shortest Path Study: Dijkstra’s with priority queue, Bellman-Ford for negative edges Practice: Network Delay Time, Cheapest Flights Within K Stops, Path With Minimum Effort Goal: Implement Dijkstra’s correctly with edge case handling

Day 17-18: Advanced DP - Knapsack and Intervals Study: 0/1 Knapsack, unbounded Knapsack, interval DP pattern Practice: Partition Equal Subset Sum, Coin Change 2, Burst Balloons Goal: Distinguish 0/1 Knapsack from unbounded Knapsack; implement interval DP

Day 19-20: Tree Algorithms Study: Binary tree traversal, BST operations, tree DP Practice: Maximum Depth of Binary Tree, Diameter of Binary Tree, Lowest Common Ancestor Goal: Implement tree DP for diameter and path problems

Days 21-30: String Algorithms and Number Theory

Day 21-22: String Fundamentals Study: String hashing, rolling hash for O(1) substring comparison Practice: Rabin-Karp implementation, Longest Duplicate Substring (binary search + hashing) Goal: Implement polynomial rolling hash correctly

Day 23-24: KMP Algorithm Study: Failure function construction, KMP matching Practice: Implement KMP from scratch, Find All Anagrams in a String Goal: Write KMP without reference in under 25 minutes

Day 25-26: Number Theory - Primes and Modular Arithmetic Study: Sieve of Eratosthenes, GCD (Euclidean), modular exponentiation, modular inverse Practice: Count Primes, Pow(x, n), implement nCr mod prime with Fermat’s little theorem Goal: Compute nCr mod prime for large N and R correctly

Day 27-28: Combinatorics Study: Precomputed factorials and inverses for fast nCr, Catalan numbers Practice: Unique Binary Search Trees, Pascale’s Triangle II Goal: Compute nCr mod prime using precomputed tables in O(1) after O(N) preprocessing

Day 29-30: Greedy Algorithms Study: Activity selection, job scheduling, proof by exchange argument Practice: Jump Game, Jump Game II, Gas Station, Meeting Rooms II Goal: Identify greedy-solvable problems and prove correctness

Days 31-40: Advanced Algorithms

Day 31-32: Segment Trees Study: Build, query, update for range sum and range min/max Practice: Implement Range Sum Segment Tree, Range Minimum Query Goal: Implement segment tree from scratch with O(log N) query and update

Day 33-34: Binary Indexed Tree (Fenwick Tree) Study: Prefix sum updates and queries in O(log N) Practice: Range Sum Query - Mutable, Count of Smaller Numbers After Self Goal: Implement Fenwick Tree for prefix queries; recognise when to use BIT vs Segment Tree

Day 35-36: Graph Advanced - MST and Union-Find Study: Kruskal’s with Union-Find, Prim’s, Union-Find with path compression and union by rank Practice: Minimum Spanning Tree, Number of Provinces, Redundant Connection Goal: Implement Union-Find with path compression; implement Kruskal’s

Day 37-38: Topological Sort and SCCs Study: Kahn’s BFS topological sort, Kosaraju’s SCC algorithm Practice: Course Schedule II, Alien Dictionary, Critical Connections in a Network Goal: Implement both topological sort methods; identify SCC application problems

Day 39-40: Bitmask DP Study: Bitmask state in DP, subset enumeration, TSP with bitmask Practice: Traveling Salesman Problem (small N), Minimum Number of Lines to Cover Points, Partition to K Equal Sum Subsets Goal: Write bitmask DP correctly for exponential state spaces

Days 41-50: CodeVita Problem Style Practice

This segment shifts from algorithmic foundations to CodeVita-specific problem-solving skills.

Day 41-42: Scenario Problem Parsing Practice Take 5 scenario-based problems (from CodeVita practice material, HackerEarth company challenges, or similar narrative-style problems). For each:

  • Spend 5 minutes identifying the core algorithmic structure (what kind of graph/DP/etc.)
  • Spend 5 minutes identifying the constraints
  • Solve using the identified algorithm

Day 43-44: Multi-Constraint Problem Solving Practice problems that combine multiple techniques:

  • Shortest path + DP
  • Graph traversal + bitmask state
  • String matching + sliding window

For each, identify where each technique applies and how they compose.

Day 45-46: 24-Hour Session Simulation Simulate a CodeVita Round 1 session:

  • Take 6-8 competitive programming problems at Mixed Medium-Hard difficulty
  • Use a 24-hour window (track actual time spent, not a continuous 24-hour session)
  • Implement the brute-force first, then optimise
  • Review all solutions after the session

Day 47-48: Partial Solution Strategy Practice deliberately solving problems at two levels: brute force first (passes small test cases), then optimal (passes all test cases).

This practice builds the CodeVita-specific skill of maximising score even when the full optimal solution is not found.

Day 49-50: Speed and Clean Code Take 10 competitive programming problems you have already solved. Re-solve each from scratch under time pressure (20 minutes per problem). Focus on:

  • Writing clean variable names
  • Adding brief comments on non-obvious logic
  • Handling edge cases explicitly

Days 51-55: Competition Simulation

Day 51-52: First Full Mock Competition Take a 4-hour block. Select 6 CodeVita-style problems at appropriate difficulty. Solve under competition conditions.

Post-competition analysis:

  • Which problems did you solve vs fail?
  • Where did you spend time inefficiently?
  • What algorithms were you reaching for but could not implement cleanly?

Day 53-54: Targeted Weakness Study Address the specific algorithms that caused failures in the Day 51-52 mock. If you could not implement segment tree efficiently, spend Day 53 on segment tree implementation practice.

Day 55: Second Mock Competition Repeat the 4-hour competition simulation. Compare performance to Day 51-52 to verify improvement.

Days 56-60: Final Refinement

Day 56-57: Advanced DP Patterns Review Quick review of all DP patterns covered. Solve 2 DP problems per day at Hard level.

Day 58: Competition Strategy Review Review the key competition decisions:

  • Problem selection order (easy problems first for guaranteed points)
  • Brute force submission timing (when to submit partial to lock in points)
  • Time allocation per problem

Day 59: Light Practice Two to three problems only. No intensive study. Preserve energy for the competition.

Day 60: Competition Day Execute the strategy developed across 60 days. Trust the preparation.


The Problem-Solving Framework for CodeVita

Reading a CodeVita Problem in 5 Minutes

The scenario-based framing of CodeVita problems requires a structured reading approach:

Step 1: Skip the narrative, read the mathematical spec (90 seconds) Jump to the end of the problem statement where input and output format are specified. Understanding the input structure and output expectation before reading the scenario often makes the scenario easier to map.

Step 2: Read the scenario with algorithm in mind (2 minutes) After knowing the input/output, the scenario provides context. Translate as you read:

  • “Cities connected by roads” → Graph nodes and edges
  • “Minimum cost to reach all locations” → Shortest path or MST
  • “Assignments respecting priority constraints” → Topological sort or DP

Step 3: Read the constraints (30 seconds) The constraints table (N ≤ 10^5, M ≤ 10^6, etc.) immediately suggests the required time complexity. If N ≤ 10^5, O(N log N) or better is needed.

Step 4: Identify the algorithm (60 seconds) Based on the structure and constraints, determine the primary algorithm. Is there a DP pattern? A graph algorithm? A greedy criterion?

Step 5: Verify with the sample test case (30 seconds) Mentally trace your algorithm through the provided sample. Does it produce the expected output? If not, the algorithm identification is wrong - reconsider.

Total reading and algorithm identification: approximately 5 minutes. Spending more than 8 minutes on problem understanding before starting to code is a red flag that either the problem type is unfamiliar (find a different problem) or more practice with scenario parsing is needed.

The Brute Force First Strategy

For every CodeVita problem, the sequence:

Phase 1: Brute force implementation (target: 20-30 minutes) Write the simplest correct implementation. For a shortest path problem, BFS or even brute-force DFS over all paths. For a DP problem, recursive implementation without memoisation.

Why brute force first: The brute force establishes correctness. Debugging an incorrect optimal solution is much harder than optimising a correct brute force. Additionally, in CodeVita with partial scoring, the brute force earns points on small test cases while you work on the optimal.

Phase 2: Submit the brute force (immediate) Submit as soon as the brute force passes the sample test cases. Lock in those partial points. This is the CodeVita-specific strategy not applicable to standard competitive programming where only full solutions score.

Phase 3: Optimise (remaining time) Transform the brute force to the optimal approach:

  • Recursive DFS without memoisation → DP with memoisation → bottom-up DP
  • O(N²) nested loops → O(N log N) with sorting + binary search or two-pointer
  • BFS on explicit graph → BFS on implicit graph with pruning

Phase 4: Submit optimal (when ready) Replace the partial-scoring brute force with the full-scoring optimal. Verify with sample before submitting.


The CodeVita Interview: What Comes After Strong Performance

The Fast-Track Interview for Zone Finalists

Zone finalists and national round qualifiers typically receive a direct invitation to TCS’s hiring process without sitting NQT. The interview process for CodeVita candidates at the Digital and Prime level:

Technical Interview Round 1 (60-90 minutes): Covers the same ground as standard Digital technical interviews but with additional depth:

  • Algorithm and DS problems at Medium-Hard level (expect the interviewer to know you competed in CodeVita and calibrate accordingly)
  • “Explain how you would approach a CodeVita-style problem” - demonstrating the brute force first, optimise strategy
  • Discussion of specific algorithms used in your submitted CodeVita solutions
  • System design concepts at introductory level (for Prime consideration)

Technical Interview Round 2 (possible for Prime candidates): Deep technical drill into specific domains based on your CodeVita performance:

  • If you excelled in graph problems: graph algorithm depth
  • If you excelled in DP: DP pattern variations and proofs

HR Interview: Standard questions with additional CodeVita context:

  • “Why did you choose to compete in CodeVita?”
  • “Walk me through a CodeVita problem you found most interesting.”
  • “How do you approach a programming problem you have never seen before?”

Communicating CodeVita Performance in Interviews

Even for candidates who did not qualify beyond Round 1, CodeVita participation is worth communicating:

In the Technical Interview: “I participated in TCS CodeVita and solved 3 problems in the zonal round, finishing in the top X percentile of my zone. The specific techniques I used included [BFS with state compression for one problem, DP on a tree for another]. This preparation directly informed how I approach algorithm design problems.”

This framing:

  1. Shows initiative (chose to participate)
  2. Demonstrates technical depth (specific techniques named)
  3. Connects to current interview skills (the preparation helps the interview)

On LinkedIn and Resume: Add CodeVita participation with rank/zone achievement if notable. “TCS CodeVita Zone Finalist” is a specific, verifiable credential. Even “TCS CodeVita Participant - solved N of M problems in zonal round” demonstrates engagement.


Competitive Programming Platforms

Codeforces (Primary recommendation for CodeVita preparation): Codeforces contests (Div. 1, Div. 2, Div. 3) at 90-minute format build the speed and accuracy that CodeVita requires. The global competition with real-time standings and rated performance provides genuine benchmark against other competitive programmers.

Target: Codeforces Div.2 comfortable (rating 1400+) for zonal qualification. Div.1 capable (rating 1600+) for national round competitiveness.

LeetCode (Primary recommendation for NQT Advanced Coding aligned practice): LeetCode’s problem library mapped to competitive programming patterns. The editorial discussions provide multiple solution approaches that build pattern recognition.

Target: 100 Medium problems before starting CodeVita preparation. Additional 50 Hard problems for national round targeting.

CodeChef (Strong alternative to Codeforces): CodeChef Div.2 and Div.3 contests provide similar preparation value to Codeforces. The long challenge format (10 days, multiple problems) resembles CodeVita’s extended time format.

HackerEarth: Company challenges and CircuitHackerEarth problems include scenario-based problems similar to CodeVita’s style. Specifically useful for practising narrative problem parsing.

AtCoder: High-quality competitive programming problems with clean mathematical formulation. AtCoder Beginner Contests (ABC) are an excellent complement for candidates finding Codeforces difficult.

Algorithm-Specific Resources

For DP:

  • “Dynamic Programming for Coding Interviews” (Meenakshi and Kamal Rawat) - practical problem-focused
  • Aditya Verma’s DP playlist (YouTube) - Indian competitive programmer with clear DP pattern explanations

For Graph Algorithms:

  • “Graph Theory” (Diestel) - theoretical foundation
  • NeetCode’s Graph playlist (YouTube) - LeetCode-focused graph problem patterns

For Segment Trees and Advanced DS:

  • Competitive Programmer’s Handbook (Laaksonen) - free PDF, comprehensive
  • cp-algorithms.com - implementation reference for advanced data structures

For CodeVita-specific style:

  • TCS CodeVita practice portal (where available) - official sample problems
  • HackerEarth company challenges - closest in style to CodeVita’s scenario format

Participation Without Winning: The Residual Benefits

Even candidates who do not advance beyond Round 1 - or who solve only 1-2 problems in the zonal round - gain meaningful benefits from CodeVita participation:

Technical Skill Development

The preparation discipline required for CodeVita (the 60-day plan or equivalent self-study) produces skills that directly benefit NQT Advanced Coding performance. A candidate who completed 150 LeetCode problems and solved a few CodeVita problems has a fundamentally stronger Advanced Coding baseline than one who studied only Foundation-level aptitude.

Interview Storytelling

In TCS Digital technical interviews, having a specific competitive programming story to tell is an asset:

“I participated in TCS CodeVita. I was able to solve the graph BFS problem in Round 1 within the first hour, but I struggled with the DP problem. After the competition, I specifically studied the DP pattern that problem required - interval DP - which I now understand well.”

This narrative demonstrates:

  • Initiative (chose to compete)
  • Self-awareness (identified a specific weakness)
  • Growth mindset (learned from the failure)

All three are qualities TCS Digital interviewers positively evaluate.

Community and Network

CodeVita’s participant community is active on platforms like LinkedIn, Codeforces forums, and coding-specific Discord servers. Engaging with this community after Round 1 participation provides:

  • Problem solution explanations from top performers
  • Editorial discussions that teach the intended algorithms
  • Peer connection with other competitive programmers preparing for similar hiring tracks

The CodeVita-to-Career Pipeline: A Case Study

The Journey of a Typical CodeVita Participant

Consider a candidate who follows this path:

Months 1-3: Complete the 60-day CodeVita preparation plan. By the end, comfortable with Div.2 Codeforces problems, solved 150 LeetCode including 20 Hards.

Month 4 (CodeVita Round 1): Registers and sits the 24-hour zonal round. Solves 3 of 7 problems completely and partially solves a fourth. Finishes in the top 20% of their zone.

Result: Does not qualify for the national round (top 5-10% qualify) but finishes above median in the zone.

Month 5 (NQT Registration and preparation): Registers for TCS NQT. The CodeVita preparation means Advanced sections are well-prepared. Takes NQT, scores in the Digital range in Advanced Coding (both problems meaningful progress), strong Foundation scores.

Result: TCS Digital offer. The same competitive programming preparation that drove CodeVita performance drove NQT Advanced Coding performance.

At the Digital Technical Interview: Can reference CodeVita participation specifically. Solves the algorithmic interview problem using the DP technique practised in CodeVita preparation. The interviewer notes the competitive programming background and asks follow-up questions about graph algorithms - comfortable territory.

Result: TCS Digital offer accepted. The CodeVita investment - even without qualifying beyond Round 1 - directly contributed to the Digital outcome.

This is the realistic pipeline for a competitive, well-prepared candidate who does not reach CodeVita’s top tiers. The competition provides preparation discipline, interview stories, and NQT Advanced Coding alignment that collectively produce a strong outcome even without the direct hiring shortcut.


Summary: The CodeVita Investment Calculus

CodeVita is worth participating in and preparing for if any of the following are true:

You are targeting TCS Digital or Prime. The preparation is identical to what Digital/Prime Advanced Coding requires. The upside includes a direct hiring shortcut. There is no downside.

You enjoy competitive programming or want to develop algorithmic depth. CodeVita’s problem quality and scale make it genuinely interesting beyond its career utility.

You are targeting Infosys SIG simultaneously. HackWithInfy preparation overlaps significantly with CodeVita preparation. Preparing for both with one skill set doubles the premium hiring pathway.

You want to differentiate yourself in TCS interviews. CodeVita participation with a specific technical story creates a memorable and differentiating interview narrative.

The 60-day preparation plan in this guide builds the competitive programming foundation from beginner to competitive-level systematically. The skill set built is not disposable after CodeVita - it serves in the NQT Advanced Coding section, in TCS Digital and Prime technical interviews, and in any technically demanding coding role at any company.

Competitive programming, done seriously, is one of the highest-leverage technical skill investments a computer science student can make. CodeVita is the vehicle that TCS has created to both test and reward that investment. Use it.


Deep Dive: Dynamic Programming Patterns for CodeVita

Dynamic programming is the most frequently tested algorithmic category in CodeVita, appearing in approximately one-third of all problems across rounds. Unlike textbook problems with obvious DP structure, CodeVita DP problems are embedded in scenarios that require the solver to first identify the DP applicability, then define the state correctly, then write the transitions.

Pattern 1: Sequence DP

The signature: A problem asking for the optimal (maximum, minimum, longest, shortest, count of) property of a sequence of decisions, where each decision affects subsequent available choices.

The formulation: Define dp[i] as the optimal property for the first i elements of the sequence. The transition uses previously computed values.

CodeVita scenario example style: “A company has N quarterly targets. Each quarter, the company can either pursue the standard plan (gaining X[i] revenue) or invest in infrastructure (spending Y[i] but multiplying future gains by factor Z). Find the maximum cumulative revenue.”

This scenario maps to a sequence DP where dp[i] = maximum revenue through quarter i, with transitions depending on whether quarter i used the standard plan or investment.

Practice problems (LeetCode):

  • Maximum Alternating Subsequence Sum (#1911, Medium-Hard)
  • Maximum Profit in Job Scheduling (#1235, Hard)
  • Paint House III (#1473, Hard)
  • Strange Printer (#664, Hard)

Pattern 2: Grid DP

The signature: Problems involving movement through a 2D grid, with constraints on movement direction, mandatory waypoints, or weighted paths.

The formulation: Define dp[i][j] as the optimal property for reaching cell (i,j). Transitions come from adjacent cells respecting movement constraints.

CodeVita scenario example style: “A delivery drone can move right or down through an N×M grid. Some cells have obstacles. Some cells have refuelling stations that the drone must visit. Others have fees. Find the minimum cost route from top-left to bottom-right that visits all mandatory refuelling stations.”

This scenario likely requires bitmask DP combining grid position with a state of which mandatory cells have been visited: dp[i][j][mask] = minimum cost to reach (i,j) having visited the mandatory stations represented by mask.

Practice problems:

  • Minimum Path Sum (#64, Medium)
  • Dungeon Game (#174, Hard)
  • Cherry Pickup (#741, Hard)
  • Number of Ways to Stay in the Same Place After Some Steps (#1269, Hard)

Pattern 3: Interval DP

The signature: Problems that ask for the optimal property of a range [l, r], where the solution for [l, r] depends on solutions for sub-intervals.

The formulation: Define dp[l][r] as the optimal property for the subrange [l, r]. The transition tries every split point k where l ≤ k < r.

CodeVita scenario example style: “A chain of N suppliers must be merged sequentially. Each merge of suppliers i and j costs proportional to their combined capacity. Find the optimal merging order to minimise total cost.”

This is the classic matrix chain multiplication / optimal BST pattern. dp[l][r] = minimum cost to merge all suppliers from index l to r.

Practice problems:

  • Burst Balloons (#312, Hard)
  • Strange Printer (#664, Hard)
  • Minimum Cost to Merge Stones (#1000, Hard)
  • Zuma Game (#664, Hard)

Pattern 4: DP on Graphs (DAG DP)

The signature: Problems on directed acyclic graphs where the optimal path or count of paths is needed.

The formulation: Topological sort the DAG. Process nodes in topological order. dp[node] = optimal property for paths ending at this node.

CodeVita scenario example style: “A project has N tasks with dependencies. Each task has a value and a duration. Find the maximum-value set of tasks that can be completed respecting all dependencies, given a total time budget T.”

This maps to DP on the dependency DAG with time budget as an additional dimension: dp[node][time] = maximum value reachable through this node with time remaining.

Practice problems:

  • Longest Increasing Path in a Matrix (#329, Hard)
  • Minimum Cost to Reach Destination in Time (#1928, Hard)

Pattern 5: Bitmask DP for Subset States

The signature: Problems where the optimal assignment or tour must be found over a small number of elements (N ≤ 20), and the state requires knowing which elements have been processed.

The formulation: dp[mask] = optimal property when the set of processed elements is represented by mask. Each bit in mask represents one element (0 = not processed, 1 = processed).

CodeVita scenario example style: “N client offices (N ≤ 15) must be visited by a team. Travel costs between every pair of offices are given. Some clients require visiting in specific sequences relative to each other. Find the minimum cost tour visiting all offices.”

This maps to bitmask DP travelling salesman: dp[mask][last] = minimum cost to visit all offices in mask, arriving at office last.

Practice problems:

  • Minimum Cost to Connect Two Groups of Points (#1595, Hard)
  • Shortest Path Visiting All Nodes (#847, Hard)
  • Partition to K Equal Sum Subsets (#698, Medium)
  • Assign Work to Workers (#1986, Hard)

Deep Dive: Graph Algorithms for CodeVita

Graph Problem Recognition

The first step in any CodeVita graph problem is recognising the underlying structure. Scenario elements that suggest specific graph algorithms:

Scenario Language Underlying Graph Concept
“Minimum cost to connect all locations” Minimum Spanning Tree
“Fastest route between two cities” Shortest Path (Dijkstra’s/BFS)
“Can all tasks be completed given dependencies” Topological Sort (DAG cycle check)
“Groups of connected elements” Connected Components (BFS/DFS/Union-Find)
“Route that visits all locations once” Hamiltonian Path (NP-hard, use bitmask DP for small N)
“All pairs of shortest distances” Floyd-Warshall (small N), APSP
“Critical edges whose removal disconnects” Bridges / Articulation Points
“Communities or tightly-connected groups” Strongly Connected Components

Dijkstra’s Algorithm: Implementation That Always Works

The most common CodeVita graph algorithm error is Dijkstra’s implementation bugs. Here is a verified, always-correct implementation:

#include <bits/stdc++.h>
using namespace std;

const int INF = 1e9;

vector<int> dijkstra(int src, int n, vector<vector<pair<int,int>>>& adj) {
    // adj[u] = {(v, weight), ...} list of (neighbour, edge weight) pairs
    vector<int> dist(n, INF);
    priority_queue<pair<int,int>, vector<pair<int,int>>, greater<>> pq;
    // pq stores {distance, node} - min-heap by distance

    dist[src] = 0;
    pq.push({0, src});

    while (!pq.empty()) {
        auto [d, u] = pq.top(); pq.pop();

        // Critical: skip if we already found a shorter path to u
        if (d > dist[u]) continue;

        for (auto [v, w] : adj[u]) {
            if (dist[u] + w < dist[v]) {
                dist[v] = dist[u] + w;
                pq.push({dist[v], v});
            }
        }
    }
    return dist;
}

The critical line: if (d > dist[u]) continue;

Without this check, the algorithm processes nodes multiple times, producing incorrect results. This is the single most common Dijkstra implementation bug. When a node is extracted from the priority queue, if its stored distance is greater than the current best-known distance, it is a stale entry from before a shorter path was found. Skip it.

Multi-Source BFS: The Underappreciated Technique

Multi-source BFS starts BFS simultaneously from multiple source nodes. Instead of one starting node in the BFS queue, all sources are added at depth 0.

When it appears: CodeVita problems where multiple facilities/warehouses/emergency responders need to reach destinations, and the goal is minimum distance from the nearest source.

Implementation:

vector<int> dist(n, INF);
queue<int> q;

// Add all sources simultaneously at distance 0
for (int src : sources) {
    dist[src] = 0;
    q.push(src);
}

// Standard BFS from here
while (!q.empty()) {
    int u = q.front(); q.pop();
    for (int v : adj[u]) {
        if (dist[v] == INF) {
            dist[v] = dist[u] + 1;
            q.push(v);
        }
    }
}

This technique converts an O(S × (V+E)) naive approach (run BFS from each source separately) to O(V+E) with multi-source BFS.

Union-Find: The Implementation That Never Fails

struct UnionFind {
    vector<int> parent, rank;

    UnionFind(int n) : parent(n), rank(n, 0) {
        iota(parent.begin(), parent.end(), 0); // parent[i] = i
    }

    int find(int x) {
        if (parent[x] != x)
            parent[x] = find(parent[x]); // path compression
        return parent[x];
    }

    bool unite(int x, int y) {
        int rx = find(x), ry = find(y);
        if (rx == ry) return false; // already same component

        // union by rank
        if (rank[rx] < rank[ry]) swap(rx, ry);
        parent[ry] = rx;
        if (rank[rx] == rank[ry]) rank[rx]++;
        return true; // successfully united
    }

    bool connected(int x, int y) {
        return find(x) == find(y);
    }
};

The two critical optimisations:

  1. Path compression: parent[x] = find(parent[x]) flattens the tree during find operations, making future finds nearly O(1).
  2. Union by rank: Attaches the smaller-depth tree to the root of the larger-depth tree, preventing degenerate O(N) find operations.

With both optimisations, union-find operations are effectively O(α(N)) ≈ O(1) for all practical purposes.


CodeVita Problem Style Analysis: Translating Scenarios

The Translation Framework

Every CodeVita scenario problem has a translation from narrative to mathematical formulation. Practising this translation is as important as knowing algorithms.

Translation vocabulary:

Scenario Element Mathematical Translation
Locations/cities/nodes Graph vertices
Roads/connections/links Graph edges
Cost/time/distance Edge weights
All locations must be visited Hamiltonian path (if path) or spanning subgraph
Nearest facility Multi-source BFS / Voronoi on grid
No loops allowed Directed acyclic graph, topological constraints
Sequence must respect order Topological sort / DP on sequence
Identical items distributed Combinatorics / Stars and bars
Maximum of minimums Binary search on the answer
Minimum time with limited resources DP with resource as a dimension

The “Binary Search on the Answer” Pattern

This pattern appears in CodeVita problems where the answer is a monotone function: if value X is achievable, all values Y < X are also achievable (or all values Y > X are achievable).

Recognition: Problems phrased as “find the minimum [X] such that [some condition holds]” or “find the maximum [X] such that [some condition holds]” often use this pattern.

Example scenario: “N packages must be shipped over D days. Each day can carry at most K total weight. Find the minimum K such that all packages can be shipped in D days.”

The check function: “Given capacity K, can all packages be shipped in D days?” is easy to verify (greedy assignment). The answer K is monotone: if K works, K+1 also works. Binary search on K over the range [max(packages), sum(packages)].

int minCapacity(vector<int>& packages, int days) {
    // Check: can we ship with capacity 'cap' in 'days' days?
    auto canShip = [&](int cap) {
        int daysNeeded = 1, current = 0;
        for (int p : packages) {
            if (p > cap) return false; // single package exceeds capacity
            if (current + p > cap) {
                daysNeeded++;
                current = 0;
            }
            current += p;
        }
        return daysNeeded <= days;
    };

    int lo = *max_element(packages.begin(), packages.end());
    int hi = accumulate(packages.begin(), packages.end(), 0);

    while (lo < hi) {
        int mid = (lo + hi) / 2;
        if (canShip(mid)) hi = mid;
        else lo = mid + 1;
    }
    return lo;
}

The template:

// Binary search on the answer [lo, hi]
while (lo < hi) {
    int mid = (lo + hi) / 2; // or (lo + hi + 1) / 2 for maximum
    if (check(mid)) hi = mid;  // valid, try smaller
    else lo = mid + 1;         // invalid, need larger
}
// lo (= hi) is the answer

Extended Practice Problem Sets for CodeVita

Practice Set 1: DP Problems at CodeVita Style

Problem 1 (Medium, 25 minutes target): A factory produces N product variants in sequence. Each variant can be produced using one of two production modes. Mode A costs C_a[i] for variant i. Mode B costs C_b[i] for variant i. Switching between modes incurs a switching cost S. Mode A must not be used for more than K consecutive variants. Find the minimum total production cost.

This is a sequence DP with state: dp[i][mode][consecutive] = minimum cost having produced variant i in mode {A,B} with consecutive consecutive uses of mode A.

Problem 2 (Medium-Hard, 35 minutes target): N delivery points are arranged in a line. A delivery truck starts at position 0. The truck can make at most M deliveries before returning to base. Deliveries must be made in order of increasing position. Find the minimum total distance for a complete delivery plan with at most M deliveries per trip.

This combines greedy (make deliveries in order) with DP (optimal trip splitting).

Problem 3 (Hard, 45 minutes target): A city has N districts connected by M bidirectional roads. Each road has a construction quality score. The city wants to identify all roads that, if closed, would increase the minimum travel time between at least one pair of districts. List these critical roads.

This is a bridge-finding problem on a weighted graph variant.

Practice Set 2: Graph Problems at CodeVita Style

Problem 4 (Medium, 20 minutes target): N warehouses are spread across a region. Some warehouses are directly connected by supply routes with known transportation cost. A central hub wants to build a distribution network that connects all warehouses at minimum total construction cost while ensuring the network has no redundant connections. Find the total cost of this minimum network.

This is MST (Kruskal’s or Prim’s). The scenario uses “warehouses” and “supply routes” for nodes and edges.

Problem 5 (Medium-Hard, 35 minutes target): M employees must be assigned to N projects. Each employee has a skill rating for each project (0-10, 0 means unqualified). Each project has a required team size. Each employee can be assigned to at most one project. Maximise the total skill score of all assignments.

This is a bipartite matching problem (maximum weight bipartite matching). For small N, M ≤ 20, bitmask DP is an alternative.

Problem 6 (Hard, 50 minutes target): A network of N servers is arranged as a directed graph. Data packets travel from source server S to destination server T. Each edge has a bandwidth capacity. Packets may be split across multiple paths. Find the maximum total data flow from S to T.

This is the maximum flow problem (Ford-Fulkerson / Edmonds-Karp algorithm). A classic algorithm problem embedded in a network infrastructure scenario.


CodeVita Scoring Optimisation Strategies

Maximising Score Beyond Correctness

Given CodeVita’s partial scoring and optimality bonus structure, candidates who understand how to maximise score earn meaningfully more than those who only focus on full correctness.

Strategy 1: Early submission of partial solutions Submit a brute-force solution that passes small test cases as soon as it is ready (20-30 minutes into the problem). This locks in partial points while you work on the optimal solution.

The time cost of this strategy: 0 (the partial solution was going to be written anyway before optimisation). The benefit: points from small test cases if you run out of time before reaching the full solution.

Strategy 2: Problem selection order Read all problems at the start (15-20 minutes). Sort by estimated difficulty based on constraint sizes and problem description length. Start with the easiest problem (highest confidence, fastest first submission). Work up in difficulty.

The rationale: easier problems solved completely earn more points than harder problems partially solved with equal time investment.

Strategy 3: Focus on test case variety When debugging a partial solution that fails some test cases, deliberately construct test cases in categories:

  • Smallest valid input (N=1, single element)
  • Maximum size input (N=10^5, or whatever the constraint is)
  • Edge cases (all same elements, sorted/reverse-sorted arrays, completely connected/disconnected graphs)

A solution that handles these categories correctly is likely to pass most hidden test cases.

Strategy 4: The optimality bonus calculation Before spending time optimising an already-correct solution for the optimality bonus, calculate whether the bonus is worth the time. If a brute force earns 80% of a problem’s score and the optimal earns 100%, and the problem is worth 100 points, the bonus is 20 points. If optimisation will take 45 minutes, those 45 minutes might be better spent on a new problem where the first 30 minutes of brute force work earns 60-80 points.

This calculation depends on the remaining contest time and how many problems remain unsolved.


The Competitive Programming Mindset: Sustaining Long-Term Practice

Why Competitive Programming Requires Sustained Practice

Competitive programming skill decays faster than most other technical skills when practice stops. The skill depends on:

  1. Algorithm recall: Knowing which algorithm to apply to which problem type requires active memory. Without practice, patterns become fuzzy.
  2. Implementation speed: Writing correct code quickly is a muscle that requires regular exercise.
  3. Debugging intuition: Recognising common bug patterns (off-by-one, integer overflow, wrong base case) improves with exposure and fades without it.

The practical implication: starting CodeVita preparation 4 weeks before the competition after a 6-month gap from competitive programming is unlikely to produce strong results. The 60-day plan should be done continuously, not with breaks.

Building the Daily Practice Habit

The minimum viable daily practice:

  • 1 LeetCode problem per day (any difficulty appropriate to current level)
  • 30 minutes (not 2 hours that sounds good but doesn’t happen)

The ideal daily practice:

  • 2-3 LeetCode problems + 1 Codeforces problem on contest days
  • 1-2 hours

The weekly structure:

  • Monday-Friday: 2 LeetCode problems each day
  • Saturday: Codeforces contest (2-hour rated contest)
  • Sunday: Post-contest editorial review (understand every problem you could not solve)

The Saturday contest + Sunday editorial review cycle is the highest-leverage weekly competitive programming habit. Contests provide real time pressure. Editorials expose the intended solutions, teaching approaches you would not have discovered independently.

Tracking Progress

Codeforces rating: The objective measure of competitive programming ability. Track weekly. If rating is not increasing after 4+ weeks of consistent practice, adjust: attempt harder problems, study editorials more carefully, participate in more contests.

LeetCode solved count by difficulty: Track medium and hard problems solved separately. Easy problems after the first 50 do not meaningfully contribute to CodeVita preparation.

Time per problem on solved problems: Track whether your speed on familiar problem types is improving. If you solved 50 DP problems but still need 45 minutes for each, speed practice is needed.


Frequently Asked Questions: TCS CodeVita

“Do I need to register separately for CodeVita if I am already registered on TCS NextStep?” Yes. CodeVita has its own registration at the TCS CodeVita portal. NQT registration and CodeVita registration are separate. Check TCS’s official CodeVita registration page for the current process.

“What happens if I solve 0 problems in CodeVita Round 1?” Your score is 0. You do not qualify for subsequent rounds. The only consequence is that you did not use the time effectively. You can re-register for the next CodeVita cycle with better preparation.

“Can CodeVita performance replace NQT entirely for TCS Digital hiring?” For candidates who advance far in CodeVita (zone finalists and national round participants), yes - TCS provides direct hiring access without NQT. For candidates who participate but do not advance significantly, NQT is still the primary route to Digital.

“What programming language is best for CodeVita?” C++ for maximum performance. Java for candidates who are more proficient in Java and whose problem-solving ability outweighs the language speed advantage of C++. Avoid Python for Hard problems with tight time limits.

“Is there an age limit for CodeVita participation?” CodeVita is primarily for current engineering students (undergraduate and postgraduate). Exact eligibility criteria including graduation year constraints are specified in the current cycle’s registration requirements.

“How many problems should I aim to solve in CodeVita Round 1?” Solving 3-4 problems completely in the 24-hour zonal window is typically competitive for zone advancement. Solving 2 completely with partial progress on a third is often sufficient for a meaningful zone ranking. Solving 5+ completely is a strong zone performance.

“Can I use online resources during the CodeVita 24-hour window?” CodeVita’s round format varies. The 24-hour online window typically allows use of documentation and learning resources (it is not proctored in the same way as NQT). However, copying solutions from online sources constitutes plagiarism and violates the code of conduct. The problem-solving skill must be yours; external documentation for language syntax or API reference is generally acceptable.

“If I qualify from CodeVita for an interview, do I still need NQT?” No. CodeVita qualification provides a direct interview path bypassing NQT for the relevant profile (Digital or Prime). This is the primary career benefit of strong CodeVita performance.

“I am a non-CS branch student. Can I participate in CodeVita?” Yes. CodeVita is open to all engineering disciplines. Non-CS students with strong competitive programming backgrounds have participated and performed well. The competition evaluates algorithmic problem-solving ability, not academic branch.

“How do I find past CodeVita problems for practice?” TCS publishes official CodeVita practice problems through the CodeVita portal. Community solutions for past problems appear on platforms like GitHub and competitive programming forums. These are valuable for understanding CodeVita’s scenario-based problem style. Note that reproducing copyrighted problem statements verbatim violates TCS’s intellectual property - study the style and approach, not the exact content.


The Bigger Picture: Competitive Programming as a Career Asset

CodeVita is the specific mechanism; competitive programming is the broader skill set. The career implications of competitive programming ability extend far beyond TCS hiring:

In interviews at any technical company: Algorithm and DS interview questions are universal across technical hiring - Google, Microsoft, Amazon, Uber, Zomato, Swiggy, PhonePe, Razorpay, and all others. Competitive programming preparation is the most transferable technical interview preparation there is.

In actual engineering work: Large-scale systems problems require the same analytical thinking that competitive programming develops - identifying the computational structure of a problem, selecting appropriate algorithms, and reasoning about time and space complexity. These skills appear daily in senior engineering work.

As a credential: High competitive programming ratings (Codeforces 1600+, Experts category) are a verifiable global credential. Unlike university projects or internships which are assessed subjectively, a competitive programming rating is objective and universally understood by technical hiring teams.

For further education: Strong competitive programming performance is a positive signal for admission to research-oriented computer science programmes. It demonstrates mathematical thinking and algorithmic depth in a way that academic grades alone do not.

TCS CodeVita is the starting point for many candidates’ competitive programming journey. For the candidates who continue beyond CodeVita - who participate in ICPC, who pursue Codeforces ratings seriously, who consistently solve hard algorithm problems as a practice habit - the career benefits compound across every technical role they ever pursue.

The 60-day plan in this guide gets you to CodeVita-competitive. What you build from there is up to you and how far you want to take it.


The Week-by-Week 60-Day Plan: Detailed Weekly Goals

The Progress Checkpoints

The 60-day plan above is day-level. Here is the week-by-week framework with measurable completion criteria:

Week 1 (Days 1-7): Arrays and Basic Algorithms Target: 25 LeetCode problems solved (mix of Easy and Medium). Comfortable with two-pointer, sliding window, basic hash map patterns. Checkpoint: Solve Longest Substring Without Repeating Characters from scratch in under 20 minutes without reference.

Week 2 (Days 8-14): DP Introduction Target: 20 DP problems solved including the standard 1D and grid patterns. Understand the state-transition formulation. Checkpoint: Solve Coin Change (minimum coins) and Unique Paths independently in under 25 minutes each.

Week 3 (Days 15-21): Graph Algorithms Target: BFS, DFS, Dijkstra’s, and basic Union-Find implemented from scratch. 15 graph problems solved. Checkpoint: Implement Dijkstra’s with priority queue from scratch in under 20 minutes without reference. Solve Network Delay Time correctly.

Week 4 (Days 22-28): Advanced DP and String Algorithms Target: Interval DP and tree DP patterns understood. KMP implemented. 15 hard problems attempted (even if not all solved). Checkpoint: Solve Burst Balloons (interval DP) with correct state definition. Implement KMP in under 30 minutes.

Week 5 (Days 29-35): Advanced Data Structures Target: Segment tree built from scratch. Fenwick tree implemented. 10 segment tree and Fenwick problems solved. Checkpoint: Build a segment tree for range sum queries with point updates in under 35 minutes without reference.

Week 6 (Days 36-42): Competitive Programming Contests Target: 3 Codeforces Div.2 contests participated. Solved at least B and C problems in each. Post-contest editorial review completed. Checkpoint: Codeforces rating above 1200 (or maintained if already above). At least one D-level problem attempted.

Week 7 (Days 43-49): CodeVita Style Problems Target: 10 scenario-based problems practiced. Translation from narrative to algorithm happening in under 5 minutes per problem. Checkpoint: Given a 500-word scenario problem, identify the core algorithm and formulate the state in under 5 minutes.

Week 8 (Days 50-56): Full Competition Simulations Target: Two full 4-hour simulation sessions completed. Scoring strategy practiced (brute force first, then optimise). Checkpoint: Solve 3 of 6 problems completely in a 4-hour simulation.

Week 9 (Days 57-60): Final Refinement Target: Weakness areas from simulations addressed. Clean code habits cemented. Checkpoint: Every implemented solution during this period has meaningful variable names, correct edge case handling, and appropriate complexity analysis noted.


Quick Reference: The CodeVita Participation Checklist

Before Registration

  • Create/verify TCS CodeVita account at the official portal
  • Check eligibility criteria (graduation year, engineering discipline)
  • Register with accurate academic information

Before Round 1

  • Complete all 60 days of preparation (or equivalent)
  • Practise scenario problem parsing (5-minute translation exercise on 3 problems)
  • Set up C++ development environment with competitive programming template
  • Plan the 24-hour window: when will you work, when will you sleep, when will you return

During Round 1

  • Read all problems in the first 20 minutes
  • Sort by estimated difficulty (do easiest first)
  • Submit brute force for partial credit before optimising
  • Track time spent per problem (do not spend more than 3 hours on any single problem)
  • Use remaining time on unsolved problems’ partial credit attempts

After Round 1

  • Note your zone ranking from the results
  • Review all problems you did not solve completely (study the intended algorithm)
  • If qualified for national round: continue preparation with harder problem sets
  • Regardless of outcome: reference CodeVita participation in NQT registration and TCS interviews

Final Note: The Compound Effect of Competitive Programming

The candidates who reach TCS Digital or Prime profiles through CodeVita are disproportionately represented among the highest-trajectory TCS engineers. This is not a coincidence - the same qualities that drive competitive programming success (systematic problem analysis, comfort with algorithmic complexity, persistence through difficult problems) are the qualities that drive engineering career success.

Competitive programming does not just teach algorithms. It teaches the thinking pattern of approaching an unfamiliar, complex problem without panic, breaking it into structures you understand, and building a solution methodically. This pattern, practiced thousands of times through competitive programming problems, becomes a professional operating system.

The 60-day plan in this guide is the minimum investment for CodeVita participation. The candidates who take competitive programming seriously beyond those 60 days - who build it into their weekly routine, who compete regularly, who study algorithms deeply rather than learning just enough to pass - develop a career advantage that compounds through every technical challenge they ever face.

CodeVita is the door. Competitive programming is the key. This guide tells you how to use both.


CodeVita Registration and Logistics Guide

How to Register for CodeVita

TCS CodeVita runs on an annual cycle. Registration opens typically several weeks before Round 1 and is done through the official TCS CodeVita portal.

Registration process:

  1. Visit the TCS CodeVita official website (search “TCS CodeVita registration” for the current registration URL, as it changes by cycle)
  2. Create an account using a personal email address (professional-looking address recommended)
  3. Complete the participant profile: name, college, degree, graduation year, discipline
  4. Select your zone (for Indian participants: North, South, East, West, Central)
  5. Confirm registration

The profile accuracy requirement: TCS verifies academic credentials for top performers who advance to hiring consideration. Register with accurate information. Misrepresenting academic details is a disqualification risk.

The Practice Portal

TCS CodeVita typically provides a practice portal before Round 1 where sample problems are available. Use this practice portal to:

  • Familiarise yourself with the submission interface
  • Understand the input/output format requirements
  • Test your development environment (language choice, compiler)
  • Practice submitting solutions under contest-like conditions

The practice portal problems are the best single resource for CodeVita-specific problem style preparation, since they are official TCS problems in the exact CodeVita format.

Technical Preparation for Submission Day

C++ template for CodeVita submissions:

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9 + 7;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    // Your solution here

    return 0;
}

Having this template memorised means zero setup time at the start of each problem.

Java template:

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        StreamTokenizer in = new StreamTokenizer(br);

        // Your solution here
        // Use in.nextToken(); in.nval for numbers

        out.flush();
    }
}

Python template:

import sys
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from functools import lru_cache
from math import gcd, sqrt, ceil, floor
import bisect

input = sys.stdin.readline

def solve():
    # Your solution here
    pass

solve()

These templates are not just aesthetic - they include the critical I/O optimisations that prevent TLE on large inputs. The C++ ios_base::sync_with_stdio(false) and the Java BufferedReader are essential performance optimisations for competitive programming.

The Post-Competition Career Actions

Regardless of your CodeVita Round 1 outcome, take these actions within a week of the results:

  1. Update LinkedIn: Add “TCS CodeVita Participant” with your zone and ranking (if notable). Even “Solved X of Y problems in Zone XYZ” is a specific, verifiable credential.

  2. Note the algorithms you could not solve: Each unsolved problem represents a skill gap. Use the editorial (when TCS releases it) or community discussion to understand the intended approach.

  3. Register for TCS NQT: CodeVita participation is not a substitute for NQT registration. Register for the next NQT cycle to ensure a TCS hiring pathway regardless of CodeVita outcome.

  4. Continue the competitive programming habit: The preparation does not end with CodeVita. Maintain weekly contest participation on Codeforces or CodeChef to keep the algorithmic skills sharp for NQT Advanced Coding.

Every coding competition is a snapshot of your ability at that moment. The candidates who treat CodeVita as one data point in a continuous development journey, rather than a pass/fail verdict on their career prospects, consistently develop the skills that produce strong NQT Advanced Coding performance and strong technical interview outcomes - which are ultimately what the TCS Digital and Prime hiring decisions are based on.