Problem database last updated: June 20, 2025

CCapgemini logo

Capgemini Coding Interview Questions

25 problems · 13 Easy, 10 Medium, 2 Hard · Ranked #77 of 458

Difficulty breakdown

13 Easy

52% · avg 23%

10 Medium

40% · avg 59%

2 Hard

8% · avg 18%

Top topics

array
48%
two-pointers
24%1.8x
string
24%
hash-table
16%
dynamic-programming
16%
math
16%

Interview profile

Based on 25 reported problems, Capgemini interviews are in line with industry averages - 8% Hard vs 18% overall.

Compared to the industry average, Capgemini puts unusual emphasis on database (12% of problems, 10.7x the industry average), two-pointers (24% of problems, 1.8x the industry average), recursion (8% of problems, 1.8x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (48%), two-pointers (24%), string (24%), hash-table (16%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 25 problems

Two Sum

Solve

Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target.

EasyVery Likely
arrayhash-map

Number of Unique Subjects Taught by Each Teacher

Solve

Table: Teacher

EasyVery Likely
database

Reverse Degree Of A String

Solve

Given a string s, calculate its reverse degree. For each character, multiply its position in the reversed alphabet ('a' = 26, 'b' = 25, ..., 'z' = 1) with its 1...

EasyVery Likely

Remove Duplicates from Sorted Array

Solve

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...

EasyVery Likely
arraytwo-pointers

Count Elements With Maximum Frequency

Solve

You are given an array nums consisting of positive integers.

EasyVery Likely
arrayhash-tablecounting

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasyLikely
arraydynamic-programming

Add Two Numbers

Solve

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...

MediumLikely
linked-listmathrecursion

Longest Common Prefix

Solve

Write a function to find the longest common prefix string amongst an array of strings.

EasyLikely
arraystringtrie

Palindrome Number

Solve

Given an integer x, return true if x is a palindrome, and false otherwise.

EasyLikely
math

Valid Palindrome

Solve

A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forwa...

EasyLikely
two-pointersstring

Median of Two Sorted Arrays

Solve

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

HardLikely
arraybinary-searchdivide-and-conquer

Trapping Rain Water

Solve

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.

HardLikely
arraytwo-pointersdynamic-programming

Balanced Binary Tree

Solve

Given a binary tree, determine if it is height-balanced.

EasyLikely
treedepth-first-searchbinary-tree

Move Zeroes

Solve

Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.

EasyLikely
arraytwo-pointers

Nth Highest Salary

Solve

Table: Employee

MediumLikely
database

Exchange Seats

Solve

Table: Seat

MediumLikely
database

Longest Happy String

Solve

A string s is called happy if it satisfies the following conditions:

MediumLikely
stringgreedyheap-priority-queue

Longest Substring Without Repeating Characters

Solve

Given a string s, find the length of the longest substring without duplicate characters.

MediumLikely
hash-tablestringsliding-window

Subarray Sum Equals K

Solve

Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k.

MediumLikely
arrayhash-tableprefix-sum

Rotate Array

Solve

Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.

MediumLikely
arraymathtwo-pointers

Reverse Words in a String

Solve

Given an input string s, reverse the order of the words.

MediumLikely
two-pointersstring

Valid Anagram

Solve

Given two strings s and t, return true if t is an anagram of s, and false otherwise.

EasyLikely
hash-tablestringsorting

Fibonacci Number

Solve

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...

EasyLikely
mathdynamic-programmingrecursion

Find First and Last Position of Element in Sorted Array

Solve

Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.

MediumLikely
arraybinary-search

Coin Change

Solve

You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.

MediumLikely
arraydynamic-programmingbreadth-first-search

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 Capgemini interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Capgemini coding interview

Capgemini interviews focus heavily on array, two-pointers, 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. Capgemini 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.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Capgemini ask in interviews?add

Capgemini has been reported to ask 25 distinct coding problems. The most common topics are array, two-pointers, string. 13 are Easy difficulty, 10 are Medium, and 2 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Capgemini coding interviews?add

Based on 25 reported problems, Capgemini interviews are in line with industry averages - 8% Hard vs 18% overall. 40% 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 Capgemini coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, two-pointers, string. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Capgemini interview?

Simulate a real Capgemini coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Capgemini interview with AIarrow_forward