Cognizant 2025 Papers
Latest placement papers. View 2025 Papers →
Download Cognizant placement papers 2024 PDF with actual online assessment questions, solutions, and exam pattern analysis for GenC, GenC Pro, and GenC Elevate.
This page contains actual Cognizant placement papers from 2024 with 50+ questions from Online Assessment including aptitude, technical MCQs, and coding problems.
| Role | Aptitude | Technical | Coding | Time |
|---|---|---|---|---|
| GenC | 25 MCQs | 10 MCQs | 1-2 problems | 90 min |
| GenC Pro | 25 MCQs | 15 MCQs | 2 problems | 120 min |
| GenC Elevate | 20 MCQs | 15 MCQs | 3 problems | 150 min |
Solution:
Solution:
Solution:
Solution:
Solution:
Solution:
Solution:
Solution:
Solution:
Solution:
Solution:
Solution: True (follows from both premises)
Answer: 5 (post-increment prints first, then increments)
Answer: Primary Key
Answer: Bundling data and methods that operate on data within a single unit (class)
SELECT * FROM employees WHERE salary > 50000;Answer: A situation where two or more processes are waiting for each other indefinitely
Difficulty: Easy
Time: 15 minutes
Reverse a given string without using built-in functions.
Input: “hello”
Output: “olleh”
void reverseString(char str[]) { int n = strlen(str); for(int i = 0; i < n/2; i++) { char temp = str[i]; str[i] = str[n-1-i]; str[n-1-i] = temp; }}public String reverse(String s) { char[] arr = s.toCharArray(); int left = 0, right = arr.length - 1; while (left < right) { char temp = arr[left]; arr[left++] = arr[right]; arr[right--] = temp; } return new String(arr);}def reverse_string(s): chars = list(s) left, right = 0, len(chars) - 1 while left < right: chars[left], chars[right] = chars[right], chars[left] left += 1 right -= 1 return ''.join(chars)Difficulty: Easy
Time: 15 minutes
Find second largest element in an array.
Input: [12, 35, 1, 10, 34, 1]
Output: 34
int secondLargest(int arr[], int n) { int first = INT_MIN, second = INT_MIN; for(int i = 0; i < n; i++) { if(arr[i] > first) { second = first; first = arr[i]; } else if(arr[i] > second && arr[i] != first) { second = arr[i]; } } return second;}public int secondLargest(int[] arr) { int first = Integer.MIN_VALUE; int second = Integer.MIN_VALUE; for (int num : arr) { if (num > first) { second = first; first = num; } else if (num > second && num != first) { second = num; } } return second;}def second_largest(arr): first = second = float('-inf') for num in arr: if num > first: second = first first = num elif num > second and num != first: second = num return secondDifficulty: Easy
Time: 15 minutes
Check if a number is palindrome.
Input: 121
Output: true
public boolean isPalindrome(int x) { if (x < 0) return false; int original = x, reversed = 0; while (x > 0) { reversed = reversed * 10 + x % 10; x /= 10; } return original == reversed;}def is_palindrome(x): if x < 0: return False original = x reversed_num = 0 while x > 0: reversed_num = reversed_num * 10 + x % 10 x //= 10 return original == reversed_numDifficulty: Medium
Time: 20 minutes
Find two numbers in array that add up to target.
Input: nums = [2,7,11,15], target = 9
Output: [0, 1]
public int[] twoSum(int[] nums, int target) { Map<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < nums.length; i++) { int complement = target - nums[i]; if (map.containsKey(complement)) { return new int[]{map.get(complement), i}; } map.put(nums[i], i); } return new int[]{};}def two_sum(nums, target): seen = {} for i, num in enumerate(nums): complement = target - num if complement in seen: return [seen[complement], i] seen[num] = i return []Difficulty: Medium
Time: 25 minutes
Find the longest palindromic substring.
Input: “babad”
Output: “bab” or “aba”
public String longestPalindrome(String s) { if (s == null || s.length() < 1) return ""; int start = 0, end = 0; for (int i = 0; i < s.length(); i++) { int len1 = expandAroundCenter(s, i, i); int len2 = expandAroundCenter(s, i, i + 1); int len = Math.max(len1, len2); if (len > end - start) { start = i - (len - 1) / 2; end = i + len / 2; } } return s.substring(start, end + 1);}
private int expandAroundCenter(String s, int left, int right) { while (left >= 0 && right < s.length() && s.charAt(left) == s.charAt(right)) { left--; right++; } return right - left - 1;}def longest_palindrome(s): def expand_around_center(left, right): while left >= 0 and right < len(s) and s[left] == s[right]: left -= 1 right += 1 return s[left + 1:right]
result = "" for i in range(len(s)): # Odd length palindrome odd = expand_around_center(i, i) # Even length palindrome even = expand_around_center(i, i + 1) # Update result if len(odd) > len(result): result = odd if len(even) > len(result): result = even return resultDifficulty: Medium
Time: 20 minutes
Merge two sorted arrays into one sorted array.
Input: [1,3,5], [2,4,6]
Output: [1,2,3,4,5,6]
public int[] merge(int[] arr1, int[] arr2) { int[] result = new int[arr1.length + arr2.length]; int i = 0, j = 0, k = 0; while (i < arr1.length && j < arr2.length) { if (arr1[i] <= arr2[j]) { result[k++] = arr1[i++]; } else { result[k++] = arr2[j++]; } } while (i < arr1.length) result[k++] = arr1[i++]; while (j < arr2.length) result[k++] = arr2[j++]; return result;}def merge_sorted(arr1, arr2): result = [] i = j = 0 while i < len(arr1) and j < len(arr2): if arr1[i] <= arr2[j]: result.append(arr1[i]) i += 1 else: result.append(arr2[j]) j += 1 result.extend(arr1[i:]) result.extend(arr2[j:]) return resultCommon Interview Questions:
Cognizant 2025 Papers
Latest placement papers. View 2025 Papers →
Cognizant Coding Questions
25+ coding problems. View Coding →
Cognizant Interview Experience
Real experiences. Read Experiences →
Complete Guide
Full Cognizant guide. View Guide →
Practice these 2024 papers to understand the pattern!
Last updated: February 2026