29 problems · 18 Easy, 10 Medium, 1 Hard · Ranked #66 of 458
Difficulty breakdown
18 Easy
62% · avg 23%
10 Medium
34% · avg 59%
1 Hard
3% · avg 18%
Top topics
array
41.4%
math
27.6%2.2x
string
20.7%
two-pointers
20.7%1.5x
database
17.2%15.4x
sorting
13.8%
Interview profile
Based on 29 reported problems, Cognizant interviews are easier than average - only 3% Hard compared to 18% across all companies.
Compared to the industry average, Cognizant puts unusual emphasis on database (17.2% of problems, 15.4x the industry average), recursion (10.3% of problems, 2.3x the industry average), math (27.6% of problems, 2.2x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (41.4%), math (27.6%), string (20.7%), two-pointers (20.7%). Problems below are sorted by frequency, the ones at the top are asked most often.
All 29 problems
Problem
Difficulty
Frequency
Topics
Palindrome Number
Given an integer x, return true if x is a palindrome, and false otherwise.
Given an integer array nums, return the number of subarrays of length 3 such that the sum of the first and third numbers equals exactly half of the second numbe...
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin...
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1...
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then ret...
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were ins...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...
Given an integer array nums, return the number of subarrays of length 3 such that the sum of the first and third numbers equals exactly half of the second numbe...
The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin...
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1...
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then ret...
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were ins...
Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a sing...
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and num...
Write an algorithm to determine if a number n is happy.
EasyLikely
hash-tablemathtwo-pointers
How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Cognizant interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Preparing for your Cognizant coding interview
Cognizant interviews focus heavily on array, math, string problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. Cognizant interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
What coding problems does Cognizant ask in interviews?add
Cognizant has been reported to ask 29 distinct coding problems. The most common topics are array, math, string. 18 are Easy difficulty, 10 are Medium, and 1 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
How hard are Cognizant coding interviews?add
Based on 29 reported problems, Cognizant interviews are easier than average - only 3% Hard compared to 18% across all companies. 34% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
How should I prepare for a Cognizant coding interview?add
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, math, string. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real Cognizant coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.