Cognizant coding interview
questions, leaked.
29 problems reported across recent Cognizant interviews. Top patterns: array, math, two pointers. The list below is what most reported candidates actually saw, plus the honest play if you can't grind all of it.
Cognizant's coding assessment hits you with 29 problems across fundamentals, and you'll see a lot of array and math patterns. The good news: 18 of the 29 are easy, so the bar isn't meant to break you. The bad news: easy doesn't mean obvious when you're live and nervous. Two Sum, Palindrome Number, Valid Parentheses, Remove Duplicates from Sorted Array, and Fibonacci Number show up in their rotation. If you blank mid-assessment and can't recall a hash-table or two-pointer trick, StealthCoder runs invisibly during screen share and surfaces a working solution in seconds, no proctor visibility.
Top problems at Cognizant
| # | Problem | Diff | Frequency | Pass % | Patterns |
|---|---|---|---|---|---|
| 01 | Palindrome Number | EASY | 100.0 | 59% | Math |
| 02 | Count Subarrays of Length Three With a Condition | EASY | 95.6 | 62% | Array |
| 03 | Smallest Value of the Rearranged Number | MEDIUM | 95.6 | 53% | Math · Sorting |
| 04 | Two Sum | EASY | 83.2 | 56% | Array · Hash Table |
| 05 | Fibonacci Number | EASY | 78.8 | 73% | Math · Dynamic Programming · Recursion |
| 06 | Longest Palindromic Substring | MEDIUM | 73.4 | 36% | Two Pointers · String · Dynamic Programming |
| 07 | Valid Anagram | EASY | 73.4 | 67% | Hash Table · String · Sorting |
| 08 | Second Highest Salary | MEDIUM | 66.5 | 44% | Database |
| 09 | Remove Duplicates from Sorted Array | EASY | 66.5 | 60% | Array · Two Pointers |
| 10 | Longest Common Prefix | EASY | 66.5 | 45% | String · Trie |
| 11 | Managers with at Least 5 Direct Reports | MEDIUM | 66.5 | 49% | Database |
| 12 | Maximum Subarray | MEDIUM | 66.5 | 52% | Array · Divide and Conquer · Dynamic Programming |
| 13 | Reverse Integer | MEDIUM | 66.5 | 30% | Math |
| 14 | Product Sales Analysis I | EASY | 66.5 | 85% | Database |
| 15 | Valid Parentheses | EASY | 66.5 | 42% | String · Stack |
| 16 | Median of Two Sorted Arrays | HARD | 56.7 | 44% | Array · Binary Search · Divide and Conquer |
| 17 | Longest Substring Without Repeating Characters | MEDIUM | 56.7 | 37% | Hash Table · String · Sliding Window |
| 18 | Merge Sorted Array | EASY | 56.7 | 53% | Array · Two Pointers · Sorting |
| 19 | Count Primes | MEDIUM | 56.7 | 35% | Array · Math · Enumeration |
| 20 | 3Sum | MEDIUM | 56.7 | 37% | Array · Two Pointers · Sorting |
| 21 | Happy Number | EASY | 56.7 | 58% | Hash Table · Math · Two Pointers |
| 22 | Move Zeroes | EASY | 56.7 | 63% | Array · Two Pointers |
| 23 | Binary Search | EASY | 56.7 | 60% | Array · Binary Search |
| 24 | Merge Two Sorted Lists | EASY | 56.7 | 67% | Linked List · Recursion |
| 25 | Add Two Numbers | MEDIUM | 56.7 | 46% | Linked List · Math · Recursion |
| 26 | Fizz Buzz | EASY | 56.7 | 74% | Math · String · Simulation |
| 27 | Rising Temperature | EASY | 56.7 | 50% | Database |
| 28 | Students and Examinations | EASY | 56.7 | 60% | Database |
| 29 | Search Insert Position | EASY | 56.7 | 49% | Array · Binary Search |
Frequencies derived from public community-tagged interview reports. Click a row to view on LeetCode.
You have a week, maybe less. You can't out-grind the list above. StealthCoder runs invisibly during the actual Cognizant OA. The proctor cannot see it. Screen share cannot detect it. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.
Get StealthCoder- array11 · 38%
- math8 · 28%
- two pointers6 · 21%
- string6 · 21%
- database5 · 17%
- hash table4 · 14%
- sorting4 · 14%
- binary search3 · 10%
- dynamic programming3 · 10%
- recursion3 · 10%
Arrays dominate the topic distribution (11 problems), followed by math (8) and two-pointers plus string (6 each). This is a fundamentals-first signal. You don't need to grind advanced dynamic programming or graph theory. Spend your last days on array manipulation, two-pointer sweeps (Remove Duplicates, Longest Palindromic Substring), and math tricks (Palindrome Number, Reverse Integer, Fibonacci). Database problems (5 total) appear less frequently but show up enough to cost you points if you blank on a JOIN or GROUP BY. One hard problem exists in the set, so it's not a trap door. Stack, sorting, and recursion round out the tail. If you hit a wall on an unfamiliar variation of a two-pointer or array problem live, StealthCoder is your safety net, delivering a working approach when you need it most.
Companies with similar patterns
If you prepped for Cognizant, these companies recycle ~60% of the same topics.
You've seen the list.
Now make sure you pass Cognizant.
Memorizing every problem above in a week is a fantasy. StealthCoder is the hedge: an AI overlay that's invisible during screen share. It reads the problem on screen and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Cognizant interview FAQ
How many array problems should I solve before the Cognizant OA?+
Array is the top topic at 11 problems, roughly 38 percent of the assessment. Drill at least 15 to 20 array problems covering subarrays, two-pointer moves, and prefix/suffix patterns. Two Sum, Remove Duplicates, Count Subarrays of Length Three, and Maximum Subarray are anchors. Stop when you can spot the pattern in under a minute.
Is database knowledge required for Cognizant?+
Yes, but targeted. Database appears 5 times, roughly 17 percent of problems. Second Highest Salary, Managers with at Least 5 Direct Reports, and Product Sales Analysis are the types. You don't need expert SQL, but know JOINs, GROUP BY, and window functions. If SQL isn't your strength, focus on the other 24 problems first.
Should I study dynamic programming and recursion before this assessment?+
Not as a priority. Both appear only 3 times each. Fibonacci Number is the only pure recursion problem in the top rotation. If you're short on time, skip advanced DP and focus on arrays, math, and two-pointers. DP concepts will feel optional, not critical.
What math problems should I prepare for?+
Math shows up 8 times. Palindrome Number, Fibonacci Number, Reverse Integer, and Smallest Value of the Rearranged Number are the anchors. These aren't calculus. They're digit manipulation, number properties, and simple arithmetic. Spend 2 to 3 hours on math patterns and you'll own that section.
Is one hard problem enough to tank my score?+
Unlikely. Only 1 hard problem exists among 29, and the rest are easy or medium. Even if you skip it, you can hit 96 percent completion and score well. That said, if you have time after nailing the easy and medium problems, tackling one hard problem builds confidence and signals depth.