{"id":25981,"date":"2024-11-29T11:29:49","date_gmt":"2024-11-29T05:59:49","guid":{"rendered":"https:\/\/internshala.com\/blog\/?p=25981"},"modified":"2026-03-16T10:22:55","modified_gmt":"2026-03-16T04:52:55","slug":"tcs-coding-interview-questions","status":"publish","type":"post","link":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/","title":{"rendered":"Top 40 TCS Coding Interview Questions and Answers [2026]"},"content":{"rendered":"\n<p>Tata Consultancy Services (TCS) is India\u2019s leading IT services and consultancy company with offices in over 46 countries. It is widely recognized for its expertise in digital transformation, especially in AI and machine learning, cloud computing, software development, cybersecurity, and data analytics. As a result, the company seeks candidates with a solid foundation in computer science, particularly in programming skills. If you want to apply for a job role at TCS, this blog is just for you. We have compiled a list of TCS coding interview questions and answers for freshers, mid-level, and experienced candidates to help you succeed in your upcoming interview.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#TCS_Coding_Interview_Questions_and_Answers_for_Freshers\" >TCS Coding Interview Questions and Answers for Freshers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#TCS_Coding_Interview_Questions_and_Answers_for_Mid-Level_Professionals\" >TCS Coding Interview Questions and Answers for Mid-Level Professionals<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#TCS_Coding_Interview_Questions_and_Answers_for_Experienced_Candidates\" >TCS Coding Interview Questions and Answers for Experienced Candidates<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#FAQs\" >FAQs<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TCS_Coding_Interview_Questions_and_Answers_for_Freshers\"><\/span>TCS Coding Interview Questions and Answers for Freshers<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When preparing for a TCS interview, especially for entry-level positions, it is essential to focus on the basic questions that assess your academic understanding and foundational coding skills. Here are some basic TCS coding interview questions and answers for freshers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q1. How can you reverse a string in Python?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To reverse a string in Python, use the slicing method. This method allows you to create a new string that reads backward by specifying a step of -1. It is a concise and efficient way to achieve the desired result.&nbsp;<br>Here is a code to reverse a string in <a href=\"https:\/\/trainings.internshala.com\/blog\/python-projects-for-beginners\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def reverse_string(s):\n    return s&#91;::-1]\n\n# Example usage:\nprint(reverse_string(\"hello\"))  # Output: \"olleh\"\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large desktop-image\"><a href=\"https:\/\/internshala.com\/jobs\/?utm_source=is_blog&amp;utm_medium=tcs-coding-interview-questions&amp;utm_campaign=candidate-web-banner\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"203\" src=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-1024x203.jpg\" alt=\"Find and Apply Banner\" class=\"wp-image-21795\" srcset=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-1024x203.jpg 1024w, https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-672x133.jpg 672w, https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-1536x305.jpg 1536w, https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-2048x406.jpg 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full mobile-image\"><a href=\"https:\/\/internshala.com\/jobs\/?utm_source=is_blog&amp;utm_medium=tcs-coding-interview-questions&amp;utm_campaign=candidate-mobile-banner\"><img loading=\"lazy\" decoding=\"async\" width=\"356\" height=\"256\" src=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Job-Banner-for-candidates.jpg\" alt=\"Job Banner for candidates\" class=\"wp-image-21794\"\/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Q2. Write a code using the C program to check if the mentioned year is a leap year or not using command line arguments.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Use the year as the command line argument in a C program to determine whether a year is a leap year. Here\u2019s how we can check whether the mentioned year is a leap year or not.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include&lt;stdio.h&gt;\nint main(int a, char b&#91;])\n{\nint year; year=atoi(b&#91;1]);\nif(year%100==0)\n{\nif(year%400==0)\n{\nprintf(\u201cIT IS A LEAP YEAR\u201d);\n}\nelse{\nprintf(\u201cIT IS NOT A LEAP YEAR\u201d);}}\nelseif(year%4==0)\n{\nprintf(\u201cIT IS A LEAP YEAR\u201d);\n}\nelse{\nprintf(\u201cIT IS NOT A LEAP YEAR\u201d);\n}\nreturn 0; }\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q3. How can you check if a string is palindrome in Python?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>A string is classified as a palindrome if it reads the same forwards and backward. In Python, this can be easily checked by comparing the original string with its reversed version.&nbsp;<\/p>\n\n\n\n<p>Here\u2019s a code that can help you in checking if a string is palindrome:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def is_palindrome(s):\n    return s == s&#91;::-1]\n\n# Example usage:\nprint(is_palindrome(\"noon\"))  # Output: True\nprint(is_palindrome(\"monday\")) # Output: False\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q4. Write a program to start a binary search algorithm in Python.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>A binary search is an algorithm that helps find the value of a sorted array. Here\u2019s how we can do a binary search in Python.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def binary_search(arr, target):\n    low, high = 0, len(arr) - 1\n    while low &lt;= high:\n        mid = (low + high) \/\/ 2\n        if arr&#91;mid] == target:\n            return mid\n        elif arr&#91;mid] &lt; target:\n            low = mid + 1\n        else:\n            high = mid - 1\n    return -1\n\n# Example usage:\nprint(binary_search(&#91;1, 2, 3, 4, 5], 3))  # Output: 2\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q5. Write a function to check if two strings are anagrams.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>An anagram is multiple words or phrases that can give the same value despite rearranging the letters. Here is a function to check whether two strings are anagrams:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def are_anagrams(s1, s2):\n   return sorted(s1) == sorted(s2) \n\n# Test case \nprint(are_anagrams(\"cork\", \"rock\")) # Output: True \nprint(are_anagrams(\"universe\", \"paris\")) # Output: False\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q6. How can you conduct a bubble sort algorithm in Python?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The following code outlines how we can conduct a bubble sort algorithm in Python:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def bubble_sort(arr):\n    n = len(arr)\n    for i in range(n):\n        for j in range(0, n-i-1):\n            if arr&#91;j] &gt; arr&#91;j+1]:\n                arr&#91;j], arr&#91;j+1] = arr&#91;j+1], arr&#91;j]\n    return arr\n\n# Example usage:\nprint(bubble_sort(&#91;5, 3, 2, 4, 1]))  # Output: &#91;1, 2, 3, 4, 5]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q7. How can you merge two sorted arrays?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Merging two sorted arrays involves combining them into one sorted array while maintaining order. We can merge two sorted arrays into a single sorted array by following the given code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def merge_sorted_arrays(arr1, arr2): \nresult = &#91;] \ni, j = 0, 0 \nwhile i &lt; len(arr1) and j &lt; len(arr2): \n           if arr1&#91;i] &lt; arr2&#91;j]:\n              result.append(arr1&#91;i])\n                   i += 1\n                    else: \n               result.append(arr2&#91;j]) j += 1 \n               result.extend(arr1&#91;i:]) result.extend(arr2&#91;j:]) \n               return result \n\n# Test case \nprint(merge_sorted_arrays(&#91;1, 3, 5], &#91;2, 4, 6])) # Output: &#91;1, 2, 3, 4, 5, 6]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q8. How can you find the factorial of a number in Python?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>The factorial of a number represents the product of all positive integers up to that number. We can find the factorial value of a number by writing the given code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def factorial(n):\n    if n == 0:\n        return 1\n    else:\n        return n * factorial(n-1)\n\n# Example usage:\nprint(factorial(5))  # Output: 120\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q9. Write a program to count occurrences of an element.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Here\u2019s a program that can help you count the occurrences of a specific element in an array.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def count_occurrences(arr, element): \n               return arr.count(element)\n\n # Test case\n print(count_occurrences(&#91;1, 2, 2, 3, 2, 4], 2)) # Output: 3\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q10. How can you find a missing number if you are provided with a list of integers from 1 to n?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Here\u2019s a code to find the missing number in a list of integers from 1 to n.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def find_missing(arr, n):\n    expected_sum = n * (n + 1) \/\/ 2\n    actual_sum = sum(arr)\n    return expected_sum - actual_sum\n\n# Test case\nprint(find_missing(&#91;1, 2, 3, 5], 5))  # Output: 4\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q11. Write a program to remove duplicate elements from an array.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Duplicates in an array can be removed by converting it into a set, which inherently eliminates duplicates. Here\u2019s how we can remove duplicate elements from an array:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def remove_duplicates(arr): \nreturn list(set(arr)) \n\n# Test case \nprint(remove_duplicates(&#91;1, 2, 2, 3, 4, 4, 5])) # Output: &#91;1, 2, 3, 4, 5]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q12. How can you conduct a check for an Armstrong number?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>An Armstrong number is a number that equals the sum of its digits, where each digit is raised to the power of the total number of digits in the number. Here\u2019s how we can check for an Armstrong number:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def is_armstrong(n): \n     num_str = str(n) \n     power = len(num_str)\n     return n == sum(int(digit) ** power for digit in num_str)\n\n # Test case \n\nprint(is_armstrong(153)) # Output: True \nprint(is_armstrong(123)) # Output: False\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q13. Write a program to check if the mentioned number is a prime number or not.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To determine if a number is prime, you need to check for divisibility by any integer other than 1 and itself. By following the given program we can check if the number is a prime number:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def is_prime(n): \n\nif n &lt;= 1:\n   return False\n for i in range(2, int(n**0.5) + 1): \nif n % i == 0:\n    return False\n return True\n\n # Test case \n\nprint(is_prime(7)) # Output: True\n print(is_prime(10)) # Output: False\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q14. How can you find the largest number in an array?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Here is how to find the largest number in an array using Python\u2019s max () function:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def find_largest(arr): \n       return max(arr) \n\n# Test case \nprint(find_largest(&#91;1, 2, 3, 4, 5])) # Output: 5\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q15. How can you calculate the sum of digits?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Here\u2019s a function to calculate the sum of digits.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def sum_of_digits(n): \n        return sum(int(digit) for digit in str(n)) \n\n# Test case \nprint(sum_of_digits(1234)) # Output: 10\n<\/code><\/pre>\n\n\n\n<p><strong>Pro Tip:<\/strong> You can start a career with TCS through an internship. The company posts internship opportunities on its career webpage and offers training programs for young professionals. Check out our guide on <a href=\"https:\/\/internshala.com\/blog\/how-to-get-an-internship-in-tcs\/\" target=\"_blank\" rel=\"noreferrer noopener\">how to get an internship at TCS<\/a> and build your career.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TCS_Coding_Interview_Questions_and_Answers_for_Mid-Level_Professionals\"><\/span>TCS Coding Interview Questions and Answers for Mid-Level Professionals<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When interviewing for a mid-level position at TCS, you can expect coding questions that test your understanding of fundamental concepts and problem-solving skills. Here are some TCS coding interview questions and answers for mid-level professionals.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q16. How can you merge overlapping intervals in an array of intervals?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>It can be merged by grouping all the intervals by sorting them and then starting with the first interval and comparing it with the rest. Here\u2019s how you can implement it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def merge_intervals(intervals): \n     intervals.sort(key=lambda x: x&#91;0]) \n     merged = &#91;intervals&#91;0]]\n      for current in intervals&#91;1:]: \n           last = merged&#91;-1] \n           if current&#91;0] &lt;= last&#91;1]:  # Overlap\n            last&#91;1] = max(last&#91;1], current&#91;1])\n else:\n merged.append(current)\n return merged \n\n# Test case \nprint(merge_intervals(&#91;&#91;1, 3], &#91;2, 6], &#91;8, 10], &#91;15, 18]]))\n# Output: &#91;&#91;1, 6], &#91;8, 10], &#91;15, 18]]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q17. Write a program to implement a queue using stacks.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>By using one stack for input and another for output, you can manage the order of elements effectively. This approach allows you to maintain the FIFO (First In, First Out) principle of queues while using the LIFO (Last In, First Out) nature of stacks.&nbsp;<\/p>\n\n\n\n<p>We can implement a queue using stacks by following the given code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class MyQueue:\n    def __init__(self):\n        self.stack_in = &#91;]\n        self.stack_out = &#91;]\n\n    def push(self, x):\n        self.stack_in.append(x)\n\n    def pop(self):\n        self.peek()\n        return self.stack_out.pop()\n\n    def peek(self):\n        if not self.stack_out:\n            while self.stack_in:\n                self.stack_out.append(self.stack_in.pop())\n        return self.stack_out&#91;-1]\n\n    def empty(self):\n        return not self.stack_in and not self.stack_out\n\n# Example usage:\n# queue = MyQueue()\n# queue.push(1)\n# queue.push(2)\n# queue.peek()  # Output: 1\n# queue.pop()   # Output: 1\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q18. If provided an array of integers how can you find two numbers that add up to a specific target?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To find two numbers in an array that sum up to a specific target, you can use a HashMap to track the numbers you have encountered so far. This allows for efficient lookups to check if the complement (the difference between the target and the current number) exists in the map.&nbsp;<\/p>\n\n\n\n<p>Here is a code to find the specific target by using a HashMap:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def two_sum(nums, target):\n    num_map = {}\n    for i, num in enumerate(nums):\n        diff = target - num\n        if diff in num_map:\n            return &#91;num_map&#91;diff], i]\n        num_map&#91;num] = i\n    return &#91;]\n\n# Test case\nprint(two_sum(&#91;2, 7, 11, 15], 9))  # Output: &#91;0, 1]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q19. Remove the Nth Node from the end of a singly linked list in Python.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>We can remove the Nth node from the end of a singly linked list by using two pointers. Here\u2019s how you can implement it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class ListNode:\n    def __init__(self, val=0, next=None):\n        self.val = val\n        self.next = next\n\ndef remove_nth_from_end(head, n):\n    dummy = ListNode(0)\n    dummy.next = head\n    fast = slow = dummy\n    \n    for _ in range(n + 1):\n        fast = fast.next\n    \n    while fast:\n        fast = fast.next\n        slow = slow.next\n\n    slow.next = slow.next.next\n    return dummy.next\n\n# Example usage:\n# head = &#91;1, 2, 3, 4, 5], n = 2, Output: &#91;1, 2, 3, 5]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q20. Write a program to find duplicate elements in an array.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To identify duplicate elements in an array, we can iterate through each element and track the ones we have already seen using a set. If we encounter an element that&#8217;s already in the set, it means it is a duplicate. We can find duplicate elements in an array by following the given code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def find_duplicates(arr):\n    duplicates = &#91;]\n    seen = set()\n    for num in arr:\n        if num in seen:\n            duplicates.append(num)\n        else:\n            seen.add(num)\n    return duplicates\n\n# Test case\nprint(find_duplicates(&#91;1, 2, 3, 2, 4, 5, 3]))  # Output: &#91;2, 3]\n<\/code><\/pre>\n\n\n\n<p><strong>Pro Tip: <\/strong>The coding test is a part of the selection process for many job profiles at TCS. It is important to practice coding questions as per the profile requirements and expertise as needed. Check out our following guides to explore Java, Angular, and Python-related conceptual and coding job interview questions at TCS:<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/internshala.com\/blog\/tcs-java-developer-interview-questions\/\" target=\"_blank\" rel=\"noreferrer noopener\">Java Developer Interview Questions at TCS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/internshala.com\/blog\/tcs-angular-interview-questions\/\" target=\"_blank\" rel=\"noreferrer noopener\">Angular Interview Questions at TCS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/internshala.com\/blog\/tcs-python-interview-questions\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python Interview Questions at TCS<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Q21. How can you check if a string containing parentheses is balanced?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To check if a string containing parentheses is balanced, we use a stack. We push opening parentheses onto the stack, and for each closing parenthesis, we check if it matches the last opened parenthesis by popping the stack. If everything matches correctly, the string is balanced. Here&#8217;s the code to check whether a parenthesis is balanced or not.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def is_balanced(s):\n    stack = &#91;]\n    mapping = {')': '(', '}': '{', ']': '&#91;'}\n    for char in s:\n        if char in mapping:\n            top_element = stack.pop() if stack else '#'\n            if mapping&#91;char] != top_element:\n                return False\n        else:\n            stack.append(char)\n    return not stack\n\n# Test case\nprint(is_balanced(\"()&#91;]{}\"))  # Output: True\nprint(is_balanced(\"(]\"))      # Output: False\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q22. How can you implement a binary search on a sorted array of integers?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>You can conduct a binary search on a sorted array of integers by repeatedly dividing the search interval in half. Here&#8217;s the code to implement a binary search on a sorted array of integers:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def binary_search(arr, target):\n    left, right = 0, len(arr) - 1\n    while left &lt;= right:\n        mid = (left + right) \/\/ 2\n        if arr&#91;mid] == target:\n            return mid\n        elif arr&#91;mid] &lt; target:\n            left = mid + 1\n        else:\n            right = mid - 1\n    return -1\n\n# Test case\nprint(binary_search(&#91;1, 2, 3, 4, 5], 3))  # Output: 2\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q23. Write a code to rotate an array by <em>k <\/em>positions.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To rotate an array by k positions, we can use slicing to rearrange the elements. The key is to split the array into two parts: the last k elements and the first n-k elements, and then concatenate them. The following code illustrates how can we rotate an array by <em>k <\/em>positions.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def rotate_array(arr, k):\n    k %= len(arr)\n    return arr&#91;-k:] + arr&#91;:-k]\n\n# Test case\nprint(rotate_array(&#91;1, 2, 3, 4, 5, 6, 7], 3))  # Output: &#91;5, 6, 7, 1, 2, 3, 4]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q24. Write a program to find the length of the longest substring without repeating characters in a given string.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To find the length of the longest substring without repeating characters, we use the sliding window technique with two pointers (left and right). This helps efficiently track the longest substring as we move through the string. <strong>&nbsp;<\/strong>Here\u2019s how we can find the length of the longest substring without repeating any characters.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def longest_unique_substring(s):\n    char_map = {}\n    left = max_length = 0\n    for right, char in enumerate(s):\n        if char in char_map and char_map&#91;char] &gt;= left:\n            left = char_map&#91;char] + 1\n        char_map&#91;char] = right\n        max_length = max(max_length, right - left + 1)\n    return max_length\n\n# Test case\nprint(longest_unique_substring(\"abcabcbb\"))  # Output: 3\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q25. How can you conduct a basic string compression?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>String compression replaces repeated characters with the character followed by the number of times it appears. For example, &#8220;aabcccccaaa&#8221; becomes &#8220;a2b1c5a3&#8221;. The following code demonstrates how can a string compression be carried out.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def compress_string(s):\n    compressed = &#91;]\n    count = 1\n    for i in range(1, len(s)):\n        if s&#91;i] == s&#91;i - 1]:\n            count += 1\n        else:\n            compressed.append(s&#91;i - 1] + str(count))\n            count = 1\n    compressed.append(s&#91;-1] + str(count))\n    return ''.join(compressed)\n\n# Test case\nprint(compress_string(\"aabcccccaaa\"))  # Output: \"a2b1c5a3\"\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q26. Create a code to find the common elements between two arrays.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>The common elements between two arrays can be found by employing Python\u2019s set operations. Here&#8217;s the code to find the common elements between two arrays:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def intersection(arr1, arr2):\n    return list(set(arr1) &amp; set(arr2))\n\n# Test case\nprint(intersection(&#91;1, 2, 2, 3], &#91;2, 3, 4]))  # Output: &#91;2, 3]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q27. Write a program to detect if a linked list contains a cycle.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To detect whether a linked list contains a cycle, we can use Floyd&#8217;s Cycle-Finding Algorithm. This algorithm uses two pointers, one moving slowly (one step at a time) and one moving quickly (two steps at a time). If there is a cycle, the two-pointers will eventually meet. Here\u2019s how we can detect a cycle in a linked list.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class ListNode:\n    def __init__(self, x):\n        self.val = x\n        self.next = None\n\ndef has_cycle(head):\n    slow = fast = head\n    while fast and fast.next:\n        slow = slow.next\n        fast = fast.next.next\n        if slow == fast:\n            return True\n    return False\n\n# Example usage:\n# head = &#91;3, 2, 0, -4] with a cycle; Output: True\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q28. How can you return the first unique character in a string?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To find the first unique character in a string, we can use the Counter class from Python&#8217;s collections module to count the occurrences of each character. Then, we can iterate through the string to find the first character with a count of 1. We can return the first unique character in a string by following the code written in the table below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from collections import Counter\n\ndef first_unique_char(s):\n    counts = Counter(s)\n    for i, char in enumerate(s):\n        if counts&#91;char] == 1:\n            return i\n    return -1\n\n# Test case\nprint(first_unique_char(\"leetcode\"))  # Output: 0\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q29. Write a program to find the element that appears more than n\/2 times in an array.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To find the element that appears more than n\/2 times in an array, we can use the Boyer-Moore Voting Algorithm. This algorithm works by maintaining a candidate and a count. As we iterate through the array:<\/p>\n\n\n\n<ul>\n<li>If the count is 0, we set the current element as the new candidate.<\/li>\n\n\n\n<li>If the current element matches the candidate, we increase the count.<\/li>\n\n\n\n<li>If it doesn\u2019t, we decrease the count.<\/li>\n<\/ul>\n\n\n\n<p>Here is the code to demonstrate this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def majority_element(nums):\n    count = 0\n    candidate = None\n    for num in nums:\n        if count == 0:\n            candidate = num\n        count += (1 if num == candidate else -1)\n    return candidate\n\n# Test case\nprint(majority_element(&#91;3, 2, 3]))  # Output: 3\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q30. How can you reverse words in a given string?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To reverse the words in a string, we can split the string into a list of words, reverse the list, and then join the words back together with spaces. Here is the code for this task:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def reverse_words(s):\n    return ' '.join(s.split()&#91;::-1])\n\n# Test case\nprint(reverse_words(\"hello world\"))  # Output: \"world hello\"\n<\/code><\/pre>\n\n\n\n<p><strong>Also Read: <a href=\"https:\/\/internshala.com\/blog\/tcs-hr-interview-questions-and-answers\/\" target=\"_blank\" rel=\"noreferrer noopener\">TCS HR Interview Questions<\/a><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TCS_Coding_Interview_Questions_and_Answers_for_Experienced_Candidates\"><\/span>TCS Coding Interview Questions and Answers for Experienced Candidates<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For higher roles at TCS, interviewers usually look for experienced candidates who have an advanced understanding of technical principles, problem-solving abilities, and leadership skills. Here are some of the advanced TCS coding interview questions and answers for experienced candidates:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q31. Write a code to design and implement a Least Recently Used (LRU) cache.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>An LRU (Least Recently Used) Cache stores a fixed number of items. When the cache reaches its capacity, it removes the least recently used item to make room for new data. In this implementation, we use Python&#8217;s OrderedDict from the collections module to maintain the order of insertion. The move_to_end() method allows us to efficiently update the order when items are accessed. The following code illustrates how to design and implement a LRU cache.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from collections import OrderedDict\n\nclass LRUCache:\n    def __init__(self, capacity: int):\n        self.cache = OrderedDict()\n        self.capacity = capacity\n\n    def get(self, key: int) -&gt; int:\n        if key not in self.cache:\n            return -1\n        self.cache.move_to_end(key)\n        return self.cache&#91;key]\n\n    def put(self, key: int, value: int) -&gt; None:\n        if key in self.cache:\n            self.cache.move_to_end(key)\n        self.cache&#91;key] = value\n        if len(self.cache) &gt; self.capacity:\n            self.cache.popitem(last=False)\n\n# Example usage:\n# cache = LRUCache(2)\n# cache.put(1, 1)\n# cache.put(2, 2)\n# cache.get(1)       # Returns 1\n# cache.put(3, 3)    # Evicts key 2\n# cache.get(2)       # Returns -1\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q32. How can you find the Kth largest element in an unsorted array?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To find the kth largest element in an unsorted array, we can use Python&#8217;s heapq library. The heapq.nlargest(k, nums) function returns the k largest elements from the list in sorted order. We can simply return the last element of this list to get the kth largest element. Here\u2019s how we can find the Kth largest element in an unsorted array.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import heapq\n\ndef kth_largest(nums, k):\n    return heapq.nlargest(k, nums)&#91;-1]\n\n# Test case\nprint(kth_largest(&#91;3, 2, 1, 5, 6, 4], 2))  # Output: 5\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q33. Write a program to implement trie data structure.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>A Trie is a tree-like data structure used to store strings, often used for tasks like autocomplete or spell checking. Each node represents a character, and the edges between nodes represent the sequence of characters in a string. Here is the code to implement a trie data structure:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class TrieNode:\n    def __init__(self):\n        self.children = {}\n        self.is_end_of_word = False\n\nclass Trie:\n    def __init__(self):\n        self.root = TrieNode()\n\n    def insert(self, word: str) -&gt; None:\n        node = self.root\n        for char in word:\n            if char not in node.children:\n                node.children&#91;char] = TrieNode()\n            node = node.children&#91;char]\n        node.is_end_of_word = True\n\n    def search(self, word: str) -&gt; bool:\n        node = self.root\n        for char in word:\n            if char not in node.children:\n                return False\n            node = node.children&#91;char]\n        return node.is_end_of_word\n\n    def starts_with(self, prefix: str) -&gt; bool:\n        node = self.root\n        for char in prefix:\n            if char not in node.children:\n                return False\n            node = node.children&#91;char]\n        return True\n\n# Example usage:\n# trie = Trie()\n# trie.insert(\"apple\")\n# trie.search(\"apple\")    # Returns True\n# trie.starts_with(\"app\") # Returns True\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q34. Write a program to implement Dijkstra\u2019s algorithm to find the shortest path in a graph.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Dijkstra&#8217;s algorithm finds the shortest paths between nodes in a graph. It starts with the source node and repeatedly updates the shortest distance to its neighboring nodes. Here\u2019s how we can implement Dijkstra\u2019s algorithm to find the shortest path in a graph.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import heapq\n\ndef dijkstra(graph, start):\n    distances = {node: float('inf') for node in graph}\n    distances&#91;start] = 0\n    priority_queue = &#91;(0, start)]\n    \n    while priority_queue:\n        current_distance, current_node = heapq.heappop(priority_queue)\n        \n        if current_distance &gt; distances&#91;current_node]:\n            continue\n        \n        for neighbor, weight in graph&#91;current_node].items():\n            distance = current_distance + weight\n            if distance &lt; distances&#91;neighbor]:\n                distances&#91;neighbor] = distance\n                heapq.heappush(priority_queue, (distance, neighbor))\n                \n    return distances\n\n# Test case\n# graph = {'A': {'B': 1, 'C': 4}, 'B': {'A': 1, 'C': 2, 'D': 5}, 'C': {'A': 4, 'B': 2, 'D': 1}, 'D': {'B': 5, 'C': 1}}\n# print(dijkstra(graph, 'A')) # Output: shortest paths from 'A' to all nodes\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q35. Write functions to serialize and deserialize a binary tree.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>Serialization converts a binary tree into a string format, which can be stored or transmitted. Deserialization converts the string back into a binary tree. The approach used in the sample involves Depth-First Search (DFS) to traverse the tree and capture the node values. The following function illustrates how we can serialize and deserialize a binary tree.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class TreeNode:\n    def __init__(self, val=0, left=None, right=None):\n        self.val = val\n        self.left = left\n        self.right = right\n\ndef serialize(root):\n    result = &#91;]\n    def dfs(node):\n        if not node:\n            result.append(\"None\")\n            return\n        result.append(str(node.val))\n        dfs(node.left)\n        dfs(node.right)\n    \n    dfs(root)\n    return ','.join(result)\n\ndef deserialize(data):\n    values = iter(data.split(','))\n    def dfs():\n        val = next(values)\n        if val == \"None\":\n            return None\n        node = TreeNode(int(val))\n        node.left = dfs()\n        node.right = dfs()\n        return node\n    \n    return dfs()\n\n# Example usage:\n# tree = TreeNode(1, TreeNode(2), TreeNode(3, TreeNode(4), TreeNode(5)))\n# serialized = serialize(tree)\n# deserialized = deserialize(serialized)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q36. How can you find the median of two sorted arrays of different sizes?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>To find the median of two sorted arrays, we can merge them and then find the median of the combined array. This approach assumes merging is acceptable for simplicity. Here is the code to implement this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def find_median_sorted_arrays(nums1, nums2):\n    nums = sorted(nums1 + nums2)\n    mid = len(nums) \/\/ 2\n    return (nums&#91;mid] + nums&#91;~mid]) \/ 2\n\n# Test case\nprint(find_median_sorted_arrays(&#91;1, 3], &#91;2]))         # Output: 2.0\nprint(find_median_sorted_arrays(&#91;1, 2], &#91;3, 4]))      # Output: 2.5\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q37. Create a code to find all possible paths between two nodes in a graph.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>This problem is about finding all paths from a start node to an end node in an undirected graph, which is represented using an adjacency list. The following code demonstrates the possible paths between two nodes in a graph.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>def all_paths(graph, start, end, path=&#91;]):\n    path = path + &#91;start]\n    if start == end:\n        return &#91;path]\n    paths = &#91;]\n    for node in graph&#91;start]:\n        if node not in path:\n            new_paths = all_paths(graph, node, end, path)\n            for new_path in new_paths:\n                paths.append(new_path)\n    return paths\n\n# Test case\n# graph = {'A': &#91;'B', 'C'], 'B': &#91;'D'], 'C': &#91;'D'], 'D': &#91;]}\n# print(all_paths(graph, 'A', 'D')) # Output: &#91;&#91;'A', 'B', 'D'], &#91;'A', 'C', 'D']]\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q38. Given two words and a dictionary, find the shortest transformation sequence from start to end.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>In this problem, we need to find the shortest transformation sequence from a start word to an end word. Here, each word in the sequence must differ by exactly one letter, and each intermediate word must be in the given word list. Here\u2019s how we can find the shortest transformation sequence from start to end.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from collections import deque\n\ndef word_ladder(beginWord, endWord, wordList):\n    word_set = set(wordList)\n    queue = deque(&#91;(beginWord, 1)])\n    \n    while queue:\n        word, length = queue.popleft()\n        if word == endWord:\n            return length\n        for i in range(len(word)):\n            for char in 'abcdefghijklmnopqrstuvwxyz':\n                next_word = word&#91;:i] + char + word&#91;i+1:]\n                if next_word in word_set:\n                    word_set.remove(next_word)\n                    queue.append((next_word, length + 1))\n    \n    return 0\n\n# Test case\n# wordList = &#91;\"hot\", \"dot\", \"dog\", \"lot\", \"log\", \"cog\"]\n# print(word_ladder(\"hit\", \"cog\", wordList))  # Output: 5\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q39. Write a program to find the kth smallest element in a Binary Search Tree.<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>The BST property ensures that in an inorder traversal, the elements will be visited in ascending order. By performing an inorder traversal, we can find the kth smallest element. Here is the code to find the kth smallest element in a Binary Search Tree.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class TreeNode:\n    def __init__(self, val=0, left=None, right=None):\n        self.val = val\n        self.left = left\n        self.right = right\n\ndef kth_smallest(root, k):\n    def inorder(node):\n        return inorder(node.left) + &#91;node.val] + inorder(node.right) if node else &#91;]\n    \n    return inorder(root)&#91;k - 1]\n\n# Example usage:\n# root = TreeNode(3, TreeNode(1, None, TreeNode(2)), TreeNode(4))\n# print(kth_smallest(root, 1)) # Output: 1\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Q40. How can you implement a Min-Heap data structure from scratch?<\/h3>\n\n\n\n<p><strong>Sample Answer: <\/strong>A Min-Heap is a binary heap where the parent node is smaller than its children. The heap property ensures that the smallest element is always at the root. Here\u2019s how we implement a Min-Heap data structure from scratch.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class MinHeap:\n    def __init__(self):\n        self.heap = &#91;]\n\n    def insert(self, val):\n        self.heap.append(val)\n        self._heapify_up(len(self.heap) - 1)\n\n    def extract_min(self):\n        if len(self.heap) == 0:\n            return None\n        if len(self.heap) == 1:\n            return self.heap.pop()\n        root = self.heap&#91;0]\n        self.heap&#91;0] = self.heap.pop()\n        self._heapify_down(0)\n        return root\n\n    def _heapify_up(self, index):\n        parent = (index - 1) \/\/ 2\n        if index &gt; 0 and self.heap&#91;index] &lt; self.heap&#91;parent]:\n            self.heap&#91;index], self.heap&#91;parent] = self.heap&#91;parent], self.heap&#91;index]\n            self._\n<\/code><\/pre>\n\n\n\n<p><strong>Pro Tip: <\/strong>Aside from the technical roles, TCS also offer jobs in the business process services domain. Check out our guide on <a href=\"https:\/\/internshala.com\/blog\/tcs-bps-interview-questions-and-answers\/\" target=\"_blank\" rel=\"noreferrer noopener\">BPS job interview questions at TCS<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large desktop-image\"><a href=\"https:\/\/internshala.com\/jobs\/?utm_source=is_blog&amp;utm_medium=tcs-coding-interview-questions&amp;utm_campaign=candidate-web-banner\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"203\" src=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-1024x203.jpg\" alt=\"Find and Apply Banner\" class=\"wp-image-21795\" srcset=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-1024x203.jpg 1024w, https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-672x133.jpg 672w, https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-1536x305.jpg 1536w, https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Find-and-Apply-Banner-2048x406.jpg 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full mobile-image\"><a href=\"https:\/\/internshala.com\/jobs\/?utm_source=is_blog&amp;utm_medium=tcs-coding-interview-questions&amp;utm_campaign=candidate-mobile-banner\"><img loading=\"lazy\" decoding=\"async\" width=\"356\" height=\"256\" src=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Job-Banner-for-candidates.jpg\" alt=\"Job Banner for candidates\" class=\"wp-image-21794\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To secure a position at Tata Consultancy Services, candidates should focus on building a strong foundation in coding. For different coding jobs like Java developer, Python developer, or Angular developer, a different set of coding questions are asked depending on the expertise level needed for the role. The sample TCS coding interview questions and answers will help you enhance your technical skills whether you are a fresher, mid-level candidate, or an advanced professional.\u00a0Furthermore, consider checking out our comprehensive guide on <a href=\"https:\/\/internshala.com\/blog\/tcs-interview-questions\/\" target=\"_blank\" rel=\"noreferrer noopener\">TCS interview questions with answers<\/a> to help you ace your interview.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1732858453307\"><strong class=\"schema-faq-question\">Q1. <strong>What is the test format for a TCS NQT?<\/strong><\/strong> <p class=\"schema-faq-answer\"><strong>Answer:<\/strong> The TCS NQT exam is divided into four main sections: programming concepts, verbal ability, quantitative aptitude, and coding.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1732858473192\"><strong class=\"schema-faq-question\">Q2. <strong>What is the estimated fresher job salary package at TCS?<\/strong><\/strong> <p class=\"schema-faq-answer\"><strong>Answer:<\/strong> The salary can vary anywhere from \u20b9 3.5 LPA to \u20b9 8 LPA based on the job role and hierarchy.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1732858494193\"><strong class=\"schema-faq-question\">Q3. <strong>What are the best ways to prepare for a coding interview?<\/strong><\/strong> <p class=\"schema-faq-answer\"><strong>Answer:<\/strong> Here are some of the best ways to prepare for an upcoming coding interview:<br\/>&#8211; Regularly solve problems on platforms like LeetCode or HackerRank to improve your problem-solving skills.<br\/>&#8211; Familiarize yourself with frequently asked coding questions and practice them extensively.<br\/>&#8211; Take up a Python course to learn advanced concepts.\u00a0<br\/>&#8211; You can also take up a course on how to ace coding interviews to learn the strategies and techniques to answer programming questions.<\/p> <\/div> <\/div>\n<aside class=\"mashsb-container mashsb-main \"><div class=\"mashsb-box\"><div class=\"mashsb-count mash-medium\" style=\"float:left\"><div class=\"counts mashsbcount\">0<\/div><span class=\"mashsb-sharetext\">SHARES<\/span><\/div><div class=\"mashsb-buttons\"><a class=\"mashicon-facebook mash-medium mashsb-noshadow\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Finternshala.com%2Fblog%2Ftcs-coding-interview-questions%2F\" target=\"_top\" rel=\"nofollow\"><span class=\"icon\"><\/span><span class=\"text\">Share&nbsp;on&nbsp;Facebook<\/span><\/a><a class=\"mashicon-subscribe mash-medium mashsb-noshadow\" href=\"#\" target=\"_top\" rel=\"nofollow\"><span class=\"icon\"><\/span><span class=\"text\">Get&nbsp;Your&nbsp;Dream&nbsp;Internship<\/span><\/a><div class=\"onoffswitch2 mash-medium mashsb-noshadow\" style=\"display:none\"><\/div><\/div>\n            <\/div>\n                <div style=\"clear:both\"><\/div><\/aside>\n            <!-- Share buttons by mashshare.net - Version: 4.0.42-->","protected":false},"excerpt":{"rendered":"<p>Tata Consultancy Services (TCS) is India\u2019s leading IT services and consultancy company with offices in over 46 countries. It is widely recognized for its expertise in digital transformation, especially in<\/p>\n","protected":false},"author":6475,"featured_media":25982,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":true,"footnotes":""},"categories":[4316],"tags":[9137,9136],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Top 40 TCS Coding Interview Questions and Answers [2026]<\/title>\n<meta name=\"description\" content=\"Looking for TCS coding interview questions? Here are the top 40 interview questions with answers for freshers &amp; experienced professionals to ace your interview!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 40 TCS Coding Interview Questions and Answers [2026]\" \/>\n<meta property=\"og:description\" content=\"Looking for TCS coding interview questions? Here are the top 40 interview questions with answers for freshers &amp; experienced professionals to ace your interview!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/\" \/>\n<meta property=\"og:site_name\" content=\"Internshala blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-29T05:59:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-16T04:52:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/11\/tcs-interview-coding-questions_new.png\" \/>\n\t<meta property=\"og:image:width\" content=\"390\" \/>\n\t<meta property=\"og:image:height\" content=\"255\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Aseem\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aseem\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/\"},\"author\":{\"name\":\"Aseem\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/9de1169b484c83702910ef75aebdeab3\"},\"headline\":\"Top 40 TCS Coding Interview Questions and Answers [2026]\",\"datePublished\":\"2024-11-29T05:59:49+00:00\",\"dateModified\":\"2026-03-16T04:52:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/\"},\"wordCount\":2919,\"publisher\":{\"@id\":\"https:\/\/internshala.com\/blog\/#organization\"},\"keywords\":[\"coding questions asked in tcs\",\"tcs interview coding questions\"],\"articleSection\":[\"Interview Guide\"],\"inLanguage\":\"en-US\"},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/\",\"url\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/\",\"name\":\"Top 40 TCS Coding Interview Questions and Answers [2026]\",\"isPartOf\":{\"@id\":\"https:\/\/internshala.com\/blog\/#website\"},\"datePublished\":\"2024-11-29T05:59:49+00:00\",\"dateModified\":\"2026-03-16T04:52:55+00:00\",\"description\":\"Looking for TCS coding interview questions? Here are the top 40 interview questions with answers for freshers & experienced professionals to ace your interview!\",\"breadcrumb\":{\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858453307\"},{\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858473192\"},{\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858494193\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/internshala.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Job Tips\",\"item\":\"https:\/\/internshala.com\/blog\/job-tips\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Interview Guide\",\"item\":\"https:\/\/internshala.com\/blog\/job-tips\/interview-guide\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"TCS Coding Interview Questions and Answers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/internshala.com\/blog\/#website\",\"url\":\"https:\/\/internshala.com\/blog\/\",\"name\":\"Internshala blog\",\"description\":\"Your favourite senior outside college\",\"publisher\":{\"@id\":\"https:\/\/internshala.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/internshala.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/internshala.com\/blog\/#organization\",\"name\":\"Internshala blog\",\"url\":\"https:\/\/internshala.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png\",\"contentUrl\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png\",\"width\":112,\"height\":31,\"caption\":\"Internshala blog\"},\"image\":{\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/9de1169b484c83702910ef75aebdeab3\",\"name\":\"Aseem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/internshala.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Aseem-96x96.jpg\",\"contentUrl\":\"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Aseem-96x96.jpg\",\"caption\":\"Aseem\"},\"description\":\"A seasoned tech professional, Aseem Garg is Internshala\u2019s Vice President of Engineering. A Full Stack Web Engineer and Android Engineer, he is responsible for leading and driving innovative technology at Internshala. With nine years of rich experience, he is an innovator - passionate about creating seamless web and mobile experiences while implementing efficient DevOps practices.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/aseem-garg-46ab4a59\/\"],\"url\":\"https:\/\/internshala.com\/blog\/author\/aseem\/\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858453307\",\"position\":1,\"url\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858453307\",\"name\":\"Q1. What is the test format for a TCS NQT?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<strong>Answer:<\/strong> The TCS NQT exam is divided into four main sections: programming concepts, verbal ability, quantitative aptitude, and coding.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858473192\",\"position\":2,\"url\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858473192\",\"name\":\"Q2. What is the estimated fresher job salary package at TCS?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<strong>Answer:<\/strong> The salary can vary anywhere from \u20b9 3.5 LPA to \u20b9 8 LPA based on the job role and hierarchy.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Question\",\"@id\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858494193\",\"position\":3,\"url\":\"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858494193\",\"name\":\"Q3. What are the best ways to prepare for a coding interview?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"<strong>Answer:<\/strong> Here are some of the best ways to prepare for an upcoming coding interview:<br\/>- Regularly solve problems on platforms like LeetCode or HackerRank to improve your problem-solving skills.<br\/>- Familiarize yourself with frequently asked coding questions and practice them extensively.<br\/>- Take up a Python course to learn advanced concepts.\u00a0<br\/>- You can also take up a course on how to ace coding interviews to learn the strategies and techniques to answer programming questions.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Top 40 TCS Coding Interview Questions and Answers [2026]","description":"Looking for TCS coding interview questions? Here are the top 40 interview questions with answers for freshers & experienced professionals to ace your interview!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/","og_locale":"en_US","og_type":"article","og_title":"Top 40 TCS Coding Interview Questions and Answers [2026]","og_description":"Looking for TCS coding interview questions? Here are the top 40 interview questions with answers for freshers & experienced professionals to ace your interview!","og_url":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/","og_site_name":"Internshala blog","article_published_time":"2024-11-29T05:59:49+00:00","article_modified_time":"2026-03-16T04:52:55+00:00","og_image":[{"width":390,"height":255,"url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/11\/tcs-interview-coding-questions_new.png","type":"image\/png"}],"author":"Aseem","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Aseem","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#article","isPartOf":{"@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/"},"author":{"name":"Aseem","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/9de1169b484c83702910ef75aebdeab3"},"headline":"Top 40 TCS Coding Interview Questions and Answers [2026]","datePublished":"2024-11-29T05:59:49+00:00","dateModified":"2026-03-16T04:52:55+00:00","mainEntityOfPage":{"@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/"},"wordCount":2919,"publisher":{"@id":"https:\/\/internshala.com\/blog\/#organization"},"keywords":["coding questions asked in tcs","tcs interview coding questions"],"articleSection":["Interview Guide"],"inLanguage":"en-US"},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/","url":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/","name":"Top 40 TCS Coding Interview Questions and Answers [2026]","isPartOf":{"@id":"https:\/\/internshala.com\/blog\/#website"},"datePublished":"2024-11-29T05:59:49+00:00","dateModified":"2026-03-16T04:52:55+00:00","description":"Looking for TCS coding interview questions? Here are the top 40 interview questions with answers for freshers & experienced professionals to ace your interview!","breadcrumb":{"@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858453307"},{"@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858473192"},{"@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858494193"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/internshala.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Job Tips","item":"https:\/\/internshala.com\/blog\/job-tips\/"},{"@type":"ListItem","position":3,"name":"Interview Guide","item":"https:\/\/internshala.com\/blog\/job-tips\/interview-guide\/"},{"@type":"ListItem","position":4,"name":"TCS Coding Interview Questions and Answers"}]},{"@type":"WebSite","@id":"https:\/\/internshala.com\/blog\/#website","url":"https:\/\/internshala.com\/blog\/","name":"Internshala blog","description":"Your favourite senior outside college","publisher":{"@id":"https:\/\/internshala.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/internshala.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/internshala.com\/blog\/#organization","name":"Internshala blog","url":"https:\/\/internshala.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png","contentUrl":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2023\/08\/LOGO-1.png","width":112,"height":31,"caption":"Internshala blog"},"image":{"@id":"https:\/\/internshala.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/9de1169b484c83702910ef75aebdeab3","name":"Aseem","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/internshala.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Aseem-96x96.jpg","contentUrl":"https:\/\/internshala.com\/blog\/wp-content\/uploads\/2024\/01\/Aseem-96x96.jpg","caption":"Aseem"},"description":"A seasoned tech professional, Aseem Garg is Internshala\u2019s Vice President of Engineering. A Full Stack Web Engineer and Android Engineer, he is responsible for leading and driving innovative technology at Internshala. With nine years of rich experience, he is an innovator - passionate about creating seamless web and mobile experiences while implementing efficient DevOps practices.","sameAs":["https:\/\/www.linkedin.com\/in\/aseem-garg-46ab4a59\/"],"url":"https:\/\/internshala.com\/blog\/author\/aseem\/"},{"@type":"Question","@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858453307","position":1,"url":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858453307","name":"Q1. What is the test format for a TCS NQT?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"<strong>Answer:<\/strong> The TCS NQT exam is divided into four main sections: programming concepts, verbal ability, quantitative aptitude, and coding.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858473192","position":2,"url":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858473192","name":"Q2. What is the estimated fresher job salary package at TCS?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"<strong>Answer:<\/strong> The salary can vary anywhere from \u20b9 3.5 LPA to \u20b9 8 LPA based on the job role and hierarchy.","inLanguage":"en-US"},"inLanguage":"en-US"},{"@type":"Question","@id":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858494193","position":3,"url":"https:\/\/internshala.com\/blog\/tcs-coding-interview-questions\/#faq-question-1732858494193","name":"Q3. What are the best ways to prepare for a coding interview?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"<strong>Answer:<\/strong> Here are some of the best ways to prepare for an upcoming coding interview:<br\/>- Regularly solve problems on platforms like LeetCode or HackerRank to improve your problem-solving skills.<br\/>- Familiarize yourself with frequently asked coding questions and practice them extensively.<br\/>- Take up a Python course to learn advanced concepts.\u00a0<br\/>- You can also take up a course on how to ace coding interviews to learn the strategies and techniques to answer programming questions.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts\/25981"}],"collection":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/users\/6475"}],"replies":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/comments?post=25981"}],"version-history":[{"count":0,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/posts\/25981\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/media\/25982"}],"wp:attachment":[{"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/media?parent=25981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/categories?post=25981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/internshala.com\/blog\/wp-json\/wp\/v2\/tags?post=25981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}