Cognizant 2024 Papers
Previous year questions. View 2024 Papers →
Cognizant placement papers 2025 with latest online assessment questions for GenC, GenC Pro, and GenC Elevate with solutions and pattern analysis.
This page contains actual Cognizant placement papers from 2025 with latest questions from Online Assessment for all roles.
| Role | Aptitude | Technical | Coding | Time | CTC |
|---|---|---|---|---|---|
| GenC | 25 MCQs | 10 MCQs | 1-2 | 90 min | 4 LPA |
| GenC Pro | 25 MCQs | 15 MCQs | 2 | 120 min | 6 LPA |
| GenC Elevate | 20 MCQs | 15 MCQs | 3 | 150 min | 9 LPA |
Solution:
Solution:
Solution:
Solution:
Answer: 21 (Fibonacci series)
Answer: East (5m east of starting point)
Answer: A-B-E-D-C or similar valid arrangement
Answer: Both statements together are needed - C
Answer: Method overriding (decided at runtime)
Answer: Atomicity, Consistency, Isolation, Durability
Answer: Transport Layer (Layer 4)
Answer: O(log n)
Print 1 to n. For multiples of 3 print “Fizz”, for 5 print “Buzz”, for both print “FizzBuzz”.
def fizzbuzz(n): for i in range(1, n + 1): if i % 15 == 0: print("FizzBuzz") elif i % 3 == 0: print("Fizz") elif i % 5 == 0: print("Buzz") else: print(i)public void fizzBuzz(int n) { for (int i = 1; i <= n; i++) { if (i % 15 == 0) System.out.println("FizzBuzz"); else if (i % 3 == 0) System.out.println("Fizz"); else if (i % 5 == 0) System.out.println("Buzz"); else System.out.println(i); }}Remove duplicates in-place from sorted array. Return new length.
Input: [1,1,2,2,3]
Output: 3 (array becomes [1,2,3,…])
public int removeDuplicates(int[] nums) { if (nums.length == 0) return 0; int i = 0; for (int j = 1; j < nums.length; j++) { if (nums[j] != nums[i]) { i++; nums[i] = nums[j]; } } return i + 1;}def remove_duplicates(nums): if not nums: return 0 i = 0 for j in range(1, len(nums)): if nums[j] != nums[i]: i += 1 nums[i] = nums[j] return i + 1Check if brackets are valid.
Input: ”()[]“
Output: true
public boolean isValid(String s) { Stack<Character> stack = new Stack<>(); for (char c : s.toCharArray()) { if (c == '(' || c == '{' || c == '[') { stack.push(c); } else { if (stack.isEmpty()) return false; char top = stack.pop(); if ((c == ')' && top != '(') || (c == '}' && top != '{') || (c == ']' && top != '[')) { return false; } } } return stack.isEmpty();}def is_valid(s): stack = [] mapping = {')': '(', '}': '{', ']': '['} for char in s: if char in mapping: top = stack.pop() if stack else '#' if mapping[char] != top: return False else: stack.append(char) return not stackFind contiguous subarray with maximum sum (Kadane’s algorithm).
Input: [-2,1,-3,4,-1,2,1,-5,4]
Output: 6 (subarray [4,-1,2,1])
public int maxSubArray(int[] nums) { int maxSum = nums[0]; int currentSum = nums[0]; for (int i = 1; i < nums.length; i++) { currentSum = Math.max(nums[i], currentSum + nums[i]); maxSum = Math.max(maxSum, currentSum); } return maxSum;}def max_subarray(nums): max_sum = current_sum = nums[0] for num in nums[1:]: current_sum = max(num, current_sum + num) max_sum = max(max_sum, current_sum) return max_sumDesign LRU cache with get and put operations in O(1).
from collections import OrderedDict
class LRUCache: def __init__(self, capacity): self.cache = OrderedDict() self.capacity = capacity
def get(self, key): if key not in self.cache: return -1 self.cache.move_to_end(key) return self.cache[key]
def put(self, key, value): if key in self.cache: self.cache.move_to_end(key) self.cache[key] = value if len(self.cache) > self.capacity: self.cache.popitem(last=False)Cognizant 2024 Papers
Previous year questions. View 2024 Papers →
Cognizant Coding Questions
25+ problems. View Coding →
Cognizant Preparation Guide
Complete strategy. View Guide →
Complete Guide
Full guide. View Guide →
Practice 2025 papers for latest pattern!
Last updated: February 2026