# TCS Coding Interview Questions

> 217 DSA problems asked in TCS coding interviews and online assessments, sorted easiest first with hints. Free practice for placements on InternHack.

Canonical: https://www.internhack.in/learn/dsa/companies/tcs
Last updated: 2026-11-28

217 DSA problems tagged as asked in TCS coding interviews and online assessments. Below are the first 100 of 217: 94 easy, 0 medium and 6 hard. Start with the easy ones, then move to medium. Practise free on InternHack and track your progress.

## TCS DSA problems, easiest first

1. [Add Binary](https://www.internhack.in/learn/dsa/problem/add-binary) (Easy)
2. [Article Views I](https://www.internhack.in/learn/dsa/problem/article-views-i) (Easy)
3. [Assign Cookies](https://www.internhack.in/learn/dsa/problem/assign-cookies) (Easy)
4. [Best Time to Buy and Sell Stock](https://www.internhack.in/learn/dsa/problem/best-time-to-buy-and-sell-stock) (Easy)
5. [Big Countries](https://www.internhack.in/learn/dsa/problem/big-countries) (Easy)
6. [Binary Search](https://www.internhack.in/learn/dsa/problem/binary-search) (Easy)
7. [Binary Tree Inorder Traversal](https://www.internhack.in/learn/dsa/problem/binary-tree-inorder-traversal) (Easy)
8. [Check If a Word Occurs As a Prefix of Any Word in a Sentence](https://www.internhack.in/learn/dsa/problem/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence) (Easy)
9. [Check if Array Is Sorted and Rotated](https://www.internhack.in/learn/dsa/problem/check-if-array-is-sorted-and-rotated) (Easy)
10. [Climbing Stairs](https://www.internhack.in/learn/dsa/problem/climbing-stairs) (Easy)
11. [Contains Duplicate](https://www.internhack.in/learn/dsa/problem/contains-duplicate) (Easy)
12. [Contains Duplicate II](https://www.internhack.in/learn/dsa/problem/contains-duplicate-ii) (Easy)
13. [Convert a Number to Hexadecimal](https://www.internhack.in/learn/dsa/problem/convert-a-number-to-hexadecimal) (Easy)
14. [Count Number of Pairs With Absolute Difference K](https://www.internhack.in/learn/dsa/problem/count-number-of-pairs-with-absolute-difference-k) (Easy)
15. [Count the Digits That Divide a Number](https://www.internhack.in/learn/dsa/problem/count-the-digits-that-divide-a-number) (Easy)
16. [Create Hello World Function](https://www.internhack.in/learn/dsa/problem/create-hello-world-function) (Easy)
17. [Delete Duplicate Emails](https://www.internhack.in/learn/dsa/problem/delete-duplicate-emails) (Easy)
18. [Diameter of Binary Tree](https://www.internhack.in/learn/dsa/problem/diameter-of-binary-tree) (Easy)
19. [Divisor Game](https://www.internhack.in/learn/dsa/problem/divisor-game) (Easy)
20. [Duplicate Emails](https://www.internhack.in/learn/dsa/problem/duplicate-emails) (Easy)
21. [Employee Bonus](https://www.internhack.in/learn/dsa/problem/employee-bonus) (Easy)
22. [Employees Earning More Than Their Managers](https://www.internhack.in/learn/dsa/problem/employees-earning-more-than-their-managers) (Easy)
23. [Fibonacci Number](https://www.internhack.in/learn/dsa/problem/fibonacci-number) (Easy)
24. [Find Customer Referee](https://www.internhack.in/learn/dsa/problem/find-customer-referee) (Easy)
25. [Find Minimum Operations to Make All Elements Divisible by Three](https://www.internhack.in/learn/dsa/problem/find-minimum-operations-to-make-all-elements-divisible-by-three) (Easy)
26. [Find Subsequence of Length K With the Largest Sum](https://www.internhack.in/learn/dsa/problem/find-subsequence-of-length-k-with-the-largest-sum) (Easy)
27. [Find the Highest Altitude](https://www.internhack.in/learn/dsa/problem/find-the-highest-altitude) (Easy)
28. [Find the Index of the First Occurrence in a String](https://www.internhack.in/learn/dsa/problem/find-the-index-of-the-first-occurrence-in-a-string) (Easy)
29. [Find the Original Typed String I](https://www.internhack.in/learn/dsa/problem/find-the-original-typed-string-i) (Easy)
30. [First Unique Character in a String](https://www.internhack.in/learn/dsa/problem/first-unique-character-in-a-string) (Easy)
31. [Fizz Buzz](https://www.internhack.in/learn/dsa/problem/fizz-buzz) (Easy)
32. [Flipping an Image](https://www.internhack.in/learn/dsa/problem/flipping-an-image) (Easy)
33. [Guess Number Higher or Lower](https://www.internhack.in/learn/dsa/problem/guess-number-higher-or-lower) (Easy)
34. [Happy Number](https://www.internhack.in/learn/dsa/problem/happy-number) (Easy)
35. [How Many Numbers Are Smaller Than the Current Number](https://www.internhack.in/learn/dsa/problem/how-many-numbers-are-smaller-than-the-current-number) (Easy)
36. [Intersection of Two Arrays](https://www.internhack.in/learn/dsa/problem/intersection-of-two-arrays) (Easy)
37. [Intersection of Two Arrays II](https://www.internhack.in/learn/dsa/problem/intersection-of-two-arrays-ii) (Easy)
38. [Length of Last Word](https://www.internhack.in/learn/dsa/problem/length-of-last-word) (Easy)
39. [Linked List Cycle](https://www.internhack.in/learn/dsa/problem/linked-list-cycle) (Easy)
40. [Longest Common Prefix](https://www.internhack.in/learn/dsa/problem/longest-common-prefix) (Easy)
41. [Majority Element](https://www.internhack.in/learn/dsa/problem/majority-element) (Easy)
42. [Matrix Diagonal Sum](https://www.internhack.in/learn/dsa/problem/matrix-diagonal-sum) (Easy)
43. [Max Consecutive Ones](https://www.internhack.in/learn/dsa/problem/max-consecutive-ones) (Easy)
44. [Maximum Ascending Subarray Sum](https://www.internhack.in/learn/dsa/problem/maximum-ascending-subarray-sum) (Easy)
45. [Maximum Average Subarray I](https://www.internhack.in/learn/dsa/problem/maximum-average-subarray-i) (Easy)
46. [Maximum Nesting Depth of the Parentheses](https://www.internhack.in/learn/dsa/problem/maximum-nesting-depth-of-the-parentheses) (Easy)
47. [Maximum Product of Three Numbers](https://www.internhack.in/learn/dsa/problem/maximum-product-of-three-numbers) (Easy)
48. [Merge Sorted Array](https://www.internhack.in/learn/dsa/problem/merge-sorted-array) (Easy)
49. [Merge Two Sorted Lists](https://www.internhack.in/learn/dsa/problem/merge-two-sorted-lists) (Easy)
50. [Middle of the Linked List](https://www.internhack.in/learn/dsa/problem/middle-of-the-linked-list) (Easy)
51. [Minimum Cuts to Divide a Circle](https://www.internhack.in/learn/dsa/problem/minimum-cuts-to-divide-a-circle) (Easy)
52. [Minimum Operations to Exceed Threshold Value I](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-exceed-threshold-value-i) (Easy)
53. [Missing Number](https://www.internhack.in/learn/dsa/problem/missing-number) (Easy)
54. [Move Zeroes](https://www.internhack.in/learn/dsa/problem/move-zeroes) (Easy)
55. [N-th Tribonacci Number](https://www.internhack.in/learn/dsa/problem/n-th-tribonacci-number) (Easy)
56. [Next Greater Element I](https://www.internhack.in/learn/dsa/problem/next-greater-element-i) (Easy)
57. [Number of Good Pairs](https://www.internhack.in/learn/dsa/problem/number-of-good-pairs) (Easy)
58. [Palindrome Number](https://www.internhack.in/learn/dsa/problem/palindrome-number) (Easy)
59. [Pascal's Triangle](https://www.internhack.in/learn/dsa/problem/pascals-triangle) (Easy)
60. [Plus One](https://www.internhack.in/learn/dsa/problem/plus-one) (Easy)
61. [Power of Two](https://www.internhack.in/learn/dsa/problem/power-of-two) (Easy)
62. [Product Sales Analysis I](https://www.internhack.in/learn/dsa/problem/product-sales-analysis-i) (Easy)
63. [Project Employees I](https://www.internhack.in/learn/dsa/problem/project-employees-i) (Easy)
64. [Range Sum Query - Immutable](https://www.internhack.in/learn/dsa/problem/range-sum-query-immutable) (Easy)
65. [Recyclable and Low Fat Products](https://www.internhack.in/learn/dsa/problem/recyclable-and-low-fat-products) (Easy)
66. [Remove Duplicates from Sorted Array](https://www.internhack.in/learn/dsa/problem/remove-duplicates-from-sorted-array) (Easy)
67. [Remove Duplicates from Sorted List](https://www.internhack.in/learn/dsa/problem/remove-duplicates-from-sorted-list) (Easy)
68. [Remove Element](https://www.internhack.in/learn/dsa/problem/remove-element) (Easy)
69. [Remove Letter To Equalize Frequency](https://www.internhack.in/learn/dsa/problem/remove-letter-to-equalize-frequency) (Easy)
70. [Repeated Substring Pattern](https://www.internhack.in/learn/dsa/problem/repeated-substring-pattern) (Easy)
71. [Replace Employee ID With The Unique Identifier](https://www.internhack.in/learn/dsa/problem/replace-employee-id-with-the-unique-identifier) (Easy)
72. [Return Length of Arguments Passed](https://www.internhack.in/learn/dsa/problem/return-length-of-arguments-passed) (Easy)
73. [Reverse Linked List](https://www.internhack.in/learn/dsa/problem/reverse-linked-list) (Easy)
74. [Reverse String](https://www.internhack.in/learn/dsa/problem/reverse-string) (Easy)
75. [Roman to Integer](https://www.internhack.in/learn/dsa/problem/roman-to-integer) (Easy)
76. [Running Sum of 1d Array](https://www.internhack.in/learn/dsa/problem/running-sum-of-1d-array) (Easy)
77. [Search Insert Position](https://www.internhack.in/learn/dsa/problem/search-insert-position) (Easy)
78. [Single Number](https://www.internhack.in/learn/dsa/problem/single-number) (Easy)
79. [Sort Array by Increasing Frequency](https://www.internhack.in/learn/dsa/problem/sort-array-by-increasing-frequency) (Easy)
80. [Sqrt(x)](https://www.internhack.in/learn/dsa/problem/sqrtx) (Easy)
81. [Squares of a Sorted Array](https://www.internhack.in/learn/dsa/problem/squares-of-a-sorted-array) (Easy)
82. [Sum of Unique Elements](https://www.internhack.in/learn/dsa/problem/sum-of-unique-elements) (Easy)
83. [Teemo Attacking](https://www.internhack.in/learn/dsa/problem/teemo-attacking) (Easy)
84. [Third Maximum Number](https://www.internhack.in/learn/dsa/problem/third-maximum-number) (Easy)
85. [To Be Or Not To Be](https://www.internhack.in/learn/dsa/problem/to-be-or-not-to-be) (Easy)
86. [Toeplitz Matrix](https://www.internhack.in/learn/dsa/problem/toeplitz-matrix) (Easy)
87. [Two Sum](https://www.internhack.in/learn/dsa/problem/two-sum) (Easy)
88. [Ugly Number](https://www.internhack.in/learn/dsa/problem/ugly-number) (Easy)
89. [Valid Anagram](https://www.internhack.in/learn/dsa/problem/valid-anagram) (Easy)
90. [Valid Palindrome](https://www.internhack.in/learn/dsa/problem/valid-palindrome) (Easy)
91. [Valid Parentheses](https://www.internhack.in/learn/dsa/problem/valid-parentheses) (Easy)
92. [Valid Word](https://www.internhack.in/learn/dsa/problem/valid-word) (Easy)
93. [Water Bottles](https://www.internhack.in/learn/dsa/problem/water-bottles) (Easy)
94. [Zigzag Grid Traversal With Skip](https://www.internhack.in/learn/dsa/problem/zigzag-grid-traversal-with-skip) (Easy)
95. [Largest Rectangle in Histogram](https://www.internhack.in/learn/dsa/problem/largest-rectangle-in-histogram) (Hard)
96. [Maximal Rectangle](https://www.internhack.in/learn/dsa/problem/maximal-rectangle) (Hard)
97. [Maximum Number of Events That Can Be Attended II](https://www.internhack.in/learn/dsa/problem/maximum-number-of-events-that-can-be-attended-ii) (Hard)
98. [Merge k Sorted Lists](https://www.internhack.in/learn/dsa/problem/merge-k-sorted-lists) (Hard)
99. [Minimum Cost to Make at Least One Valid Path in a Grid](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-make-at-least-one-valid-path-in-a-grid) (Hard)
100. [Palindrome Partitioning IV](https://www.internhack.in/learn/dsa/problem/palindrome-partitioning-iv) (Hard)

## Prepare for the rest of the TCS process

- [Aptitude questions by company](https://www.internhack.in/learn/aptitude/companies)
- [Technical interview questions](https://www.internhack.in/learn/interview)
- [Free ATS resume check](https://www.internhack.in/ats-score/try), no signup

## Other companies

- [Google](https://www.internhack.in/learn/dsa/companies/google) (2217)
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon) (1938)
- [Meta](https://www.internhack.in/learn/dsa/companies/meta) (1387)
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft) (1352)
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg) (1173)
- [Tiktok](https://www.internhack.in/learn/dsa/companies/tiktok) (383)
- [Uber](https://www.internhack.in/learn/dsa/companies/uber) (381)
- [Apple](https://www.internhack.in/learn/dsa/companies/apple) (356)
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle) (340)
- [Goldman Sachs](https://www.internhack.in/learn/dsa/companies/goldman-sachs) (270)
- [Adobe](https://www.internhack.in/learn/dsa/companies/adobe) (227)
- [Salesforce](https://www.internhack.in/learn/dsa/companies/salesforce) (189)
- [Linkedin](https://www.internhack.in/learn/dsa/companies/linkedin) (180)
- [Zoho](https://www.internhack.in/learn/dsa/companies/zoho) (179)
- [IBM](https://www.internhack.in/learn/dsa/companies/ibm) (170)
- [Infosys](https://www.internhack.in/learn/dsa/companies/infosys) (158)
- [Walmart Labs](https://www.internhack.in/learn/dsa/companies/walmart-labs) (152)
- [Accenture](https://www.internhack.in/learn/dsa/companies/accenture) (144)
- [Nvidia](https://www.internhack.in/learn/dsa/companies/nvidia) (137)
- [Yandex](https://www.internhack.in/learn/dsa/companies/yandex) (134)
- [DE Shaw](https://www.internhack.in/learn/dsa/companies/de-shaw) (124)
- [Visa](https://www.internhack.in/learn/dsa/companies/visa) (124)
- [Flipkart](https://www.internhack.in/learn/dsa/companies/flipkart) (117)
- [Paypal](https://www.internhack.in/learn/dsa/companies/paypal) (106)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA by company](https://www.internhack.in/learn/dsa/companies)
