Capgemini Analyst Star - Coding
Practice Sheet (2025 Updated)
Array & Matrix
1. Find the second largest element in an array
2. Remove duplicates from a sorted array
3. Left rotate the array by k positions
4. Check if two arrays are equal or not
5. Count the frequency of elements in an array
6. Spiral traversal of a matrix
7. Print matrix diagonals
8. Find the missing number in the array (1 to N)
9. Subarray with given sum
10. Sort an array of 0s, 1s, and 2s (Dutch National Flag)
String
11. Check if a string is a palindrome
12. Reverse words in a given string
13. Remove vowels from a string
14. Print duplicate characters in a string
15. Anagram check
16. Count vowels and consonants
17. Convert a string to title case
18. Frequency of each character
19. Replace spaces with %20 (URLify)
20. Longest word in a sentence
Number Theory
21. Check if a number is prime
22. Find LCM and GCD
23. Count number of digits
24. Reverse a number
25. Armstrong number check
26. Print Fibonacci series
27. Sum of digits of a number
28. Factorial using recursion
29. Palindrome number check
30. Check for power of 2
31. Count trailing zeroes in factorial
Data Structures (Basic)
32. Implement Stack using List
33. Implement Queue using List
34. Check for balanced parentheses
35. Infix to Postfix conversion
36. Find duplicate in array using HashMap
37. Binary Search
38. Linear Search
39. Bubble Sort / Insertion Sort
40. Merge two sorted arrays