TCS Coding Interview Questions

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 (Easy)
  2. Article Views I (Easy)
  3. Assign Cookies (Easy)
  4. Best Time to Buy and Sell Stock (Easy)
  5. Big Countries (Easy)
  6. Binary Search (Easy)
  7. Binary Tree Inorder Traversal (Easy)
  8. Check If a Word Occurs As a Prefix of Any Word in a Sentence (Easy)
  9. Check if Array Is Sorted and Rotated (Easy)
  10. Climbing Stairs (Easy)
  11. Contains Duplicate (Easy)
  12. Contains Duplicate II (Easy)
  13. Convert a Number to Hexadecimal (Easy)
  14. Count Number of Pairs With Absolute Difference K (Easy)
  15. Count the Digits That Divide a Number (Easy)
  16. Create Hello World Function (Easy)
  17. Delete Duplicate Emails (Easy)
  18. Diameter of Binary Tree (Easy)
  19. Divisor Game (Easy)
  20. Duplicate Emails (Easy)
  21. Employee Bonus (Easy)
  22. Employees Earning More Than Their Managers (Easy)
  23. Fibonacci Number (Easy)
  24. Find Customer Referee (Easy)
  25. Find Minimum Operations to Make All Elements Divisible by Three (Easy)
  26. Find Subsequence of Length K With the Largest Sum (Easy)
  27. Find the Highest Altitude (Easy)
  28. Find the Index of the First Occurrence in a String (Easy)
  29. Find the Original Typed String I (Easy)
  30. First Unique Character in a String (Easy)
  31. Fizz Buzz (Easy)
  32. Flipping an Image (Easy)
  33. Guess Number Higher or Lower (Easy)
  34. Happy Number (Easy)
  35. How Many Numbers Are Smaller Than the Current Number (Easy)
  36. Intersection of Two Arrays (Easy)
  37. Intersection of Two Arrays II (Easy)
  38. Length of Last Word (Easy)
  39. Linked List Cycle (Easy)
  40. Longest Common Prefix (Easy)
  41. Majority Element (Easy)
  42. Matrix Diagonal Sum (Easy)
  43. Max Consecutive Ones (Easy)
  44. Maximum Ascending Subarray Sum (Easy)
  45. Maximum Average Subarray I (Easy)
  46. Maximum Nesting Depth of the Parentheses (Easy)
  47. Maximum Product of Three Numbers (Easy)
  48. Merge Sorted Array (Easy)
  49. Merge Two Sorted Lists (Easy)
  50. Middle of the Linked List (Easy)
  51. Minimum Cuts to Divide a Circle (Easy)
  52. Minimum Operations to Exceed Threshold Value I (Easy)
  53. Missing Number (Easy)
  54. Move Zeroes (Easy)
  55. N-th Tribonacci Number (Easy)
  56. Next Greater Element I (Easy)
  57. Number of Good Pairs (Easy)
  58. Palindrome Number (Easy)
  59. Pascal's Triangle (Easy)
  60. Plus One (Easy)
  61. Power of Two (Easy)
  62. Product Sales Analysis I (Easy)
  63. Project Employees I (Easy)
  64. Range Sum Query - Immutable (Easy)
  65. Recyclable and Low Fat Products (Easy)
  66. Remove Duplicates from Sorted Array (Easy)
  67. Remove Duplicates from Sorted List (Easy)
  68. Remove Element (Easy)
  69. Remove Letter To Equalize Frequency (Easy)
  70. Repeated Substring Pattern (Easy)
  71. Replace Employee ID With The Unique Identifier (Easy)
  72. Return Length of Arguments Passed (Easy)
  73. Reverse Linked List (Easy)
  74. Reverse String (Easy)
  75. Roman to Integer (Easy)
  76. Running Sum of 1d Array (Easy)
  77. Search Insert Position (Easy)
  78. Single Number (Easy)
  79. Sort Array by Increasing Frequency (Easy)
  80. Sqrt(x) (Easy)
  81. Squares of a Sorted Array (Easy)
  82. Sum of Unique Elements (Easy)
  83. Teemo Attacking (Easy)
  84. Third Maximum Number (Easy)
  85. To Be Or Not To Be (Easy)
  86. Toeplitz Matrix (Easy)
  87. Two Sum (Easy)
  88. Ugly Number (Easy)
  89. Valid Anagram (Easy)
  90. Valid Palindrome (Easy)
  91. Valid Parentheses (Easy)
  92. Valid Word (Easy)
  93. Water Bottles (Easy)
  94. Zigzag Grid Traversal With Skip (Easy)
  95. Largest Rectangle in Histogram (Hard)
  96. Maximal Rectangle (Hard)
  97. Maximum Number of Events That Can Be Attended II (Hard)
  98. Merge k Sorted Lists (Hard)
  99. Minimum Cost to Make at Least One Valid Path in a Grid (Hard)
  100. Palindrome Partitioning IV (Hard)

Prepare for the rest of the TCS process

Other companies