{"id":11653,"date":"2024-06-21T11:40:03","date_gmt":"2024-06-21T11:40:03","guid":{"rendered":"https:\/\/www.skillvertex.com\/blog\/?p=11653"},"modified":"2024-06-21T11:40:03","modified_gmt":"2024-06-21T11:40:03","slug":"tech-mahindra-coding-questions","status":"publish","type":"post","link":"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-coding-questions\/","title":{"rendered":"Top 15 Tech Mahindra Coding Questions and Answers 2024"},"content":{"rendered":"\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><p><strong>Table of Contents<\/strong><\/p><nav><ul><li class=\"\"><a href=\"#tech-mahindra-coding-questions-2024\">Tech Mahindra Coding Questions 2024<\/a><\/li><li class=\"\"><a href=\"#15-tech-mahindra-coding-questions-and-answers-2024\">15 Tech Mahindra Coding Questions and Answers 2024<\/a><\/li><li class=\"\"><a href=\"#important-links-tech-mahindra-coding-questions-2024\">Important Links &#8211; Tech Mahindra Coding Questions 2024<\/a><\/li><li class=\"\"><a href=\"#tech-mahindra-coding-question-fa-qs\">Tech Mahindra Coding Question -FAQs<\/a><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tech-mahindra-coding-questions-2024\">Tech Mahindra Coding Questions 2024<\/h2>\n\n\n\n<p>By practicing the Tech Mahindra Coding Questions prepared by experts in 2024, graduates attempting the Tech Mahindra online exam can ace the first attempt. These Tech Mahindra Coding Questions consist of complex coding questions with answers. Read this blog on Tech Mahindra Coding questions and prepare well for the exam 2024. This includes Top 15 Tech Mahindra Coding questions and answers for your reference.<\/p>\n\n\n\n<p>This blog on  Tech Mahindra Coding Questions and Answers will equip you with the essential knowledge and skills to excel in the coding rounds, covering topics from data structures and algorithms to problem-solving techniques. These questions are beneficial if you&#8217;re a fresher or an experienced professional. This blog is about Tech Mahindra Coding questions and answers for 2024. The programming language used by Tech Mahindra is Python, C++or Java. <\/p>\n\n\n\n<p>Furthermore, a strong knowledge of programming languages such as Python, Java, or C++ and an understanding of the NLP libraries including the NLTK, SpaCy, and TensorFlow is necessary to apply for the job in Tech Mahindra.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"15-tech-mahindra-coding-questions-and-answers-2024\">15 Tech Mahindra Coding Questions and Answers 2024<\/h2>\n\n\n\n<p>Graduates and experienced can practice and brush up their coding skills with the Tech Mahindra Coding Questions and Answers of 2024 given here. These are repeatedly asked coding questions and answers. So, check out these to solve these coding questions in the Tech Mahindra exam within the time frame.<\/p>\n\n\n\n<p><strong>1. Write a program to calculate and return the sum of the absolute difference between the adjacent number in an array of positive integers from the position entered by the user.<\/strong><\/p>\n\n\n\n<p><strong>Note: You are expected to write code in the&nbsp;findTotalSum&nbsp;function only which receives three positional arguments: number of elements in the array2nd: array3rd: position from where the sum is to be calculated<\/strong><\/p>\n\n\n\n<p><strong>Example<\/strong><\/p>\n\n\n\n<p><strong>Input<br><\/strong>input 1: 7<br>input 2: 11 22 12 24 13 26 14<br>input 3: 5<\/p>\n\n\n\n<p><strong>Output<br><\/strong>25<\/p>\n\n\n\n<p><strong>Explanation<\/strong><\/p>\n\n\n\n<p>The first parameter 7 is the size of the array. Next is an array of integers, input 5 is the position from which to calculate the Total Sum. The output is 25 as per the calculation below.&nbsp;<br>| 26-13 | = 13<br>| 14-26 | =&nbsp; 12<br>Total Sum = 13 + 12 = 25<\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\nint findTotalSum(int n, int arr&#91;], int start)\n{\n    int difference, sum=0;\n    for(int i=start-1; i&lt;n-1; i++)\n    {\n        difference = abs(arr&#91;i]-arr&#91;i+1]);\n        sum = sum + difference;\n    }\n    return sum;\n}\nint main()\n{\n    int n;\n    int start;\n    scanf(\"%d\",&amp;n);\n    int array&#91;n];\n    for(int i=0; i&lt;n; i++)\n{\n        scanf(\"%d\",&amp;array&#91;i]);\n    }\n    scanf(\"%d\",&amp;start);\n    int result = findTotalSum(n, array, start);\n    printf(\"\\n%d\",result);\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Input:\n7\n11 22 12 24 13 26 14\n5\n\nOutput:\n25<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def countOddEvenDifference(n, arr):\n    odd_count = 0\n    even_count = 0\n\n    for num in arr:\n        if num % 2 == 0:\n            even_count += 1\n        else:\n            odd_count += 1\n\n    return odd_count - even_count\n\n# Example usage:\nn = 6\narr = &#91;1, 2, 3, 4, 5, 6]\nresult = countOddEvenDifference(n, arr)\nprint(\"Difference between count of odd and even numbers:\", result)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Input:\n7\n11 22 12 24 13 26 14\n5\n\nOutput:\n25<\/code><\/pre>\n\n\n\n<p><strong>2. Write a program to return the difference between the count of odd numbers and even numbers.<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\n\nint differenceOddEvenCount(const std::vector&lt;int&gt;&amp; numbers) {\n    int oddCount = 0, evenCount = 0;\n\n    for (int num : numbers) {\n        if (num % 2 == 0) {\n            evenCount++;\n        } else {\n            oddCount++;\n        }\n    }\n\n    return oddCount - evenCount;\n}\n\nint main() {\n    std::vector&lt;int&gt; numbers = {1, 2, 3, 4, 5, 6}; \/\/ Example list\n\n    int difference = differenceOddEvenCount(numbers);\n\n    std::cout &lt;&lt; \"Difference between count of odd and even numbers: \" &lt;&lt; difference &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Difference between count of odd and even numbers: -2<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python-program\">Python Program<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def difference_odd_even_count(numbers):\n    odd_count = 0\n    even_count = 0\n\n    for num in numbers:\n        if num % 2 == 0:\n            even_count += 1\n        else:\n            odd_count += 1\n\n    return odd_count - even_count\n\nnumbers = &#91;1, 2, 3, 4, 5, 6]  # Example list\n\ndifference = difference_odd_even_count(numbers)\n\nprint(\"Difference between count of odd and even numbers:\", difference)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Difference between count of odd and even numbers: -2<\/code><\/pre>\n\n\n\n<p><strong>3. Write a program to find the difference between the elements at the odd index and index.<\/strong><\/p>\n\n\n\n<p><strong>Note: You are expected to write code in the&nbsp;findDifference&nbsp;function that only receives the first parameter as the number of items in the array and the second parameter as the array itself. You are not required to take the input from the console.<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\n\nint differenceOddEvenIndex(const std::vector&lt;int&gt;&amp; numbers) {\n    int oddIndexSum = 0, evenIndexSum = 0;\n\n    for (size_t i = 0; i &lt; numbers.size(); ++i) {\n        if (i % 2 == 0) {\n            evenIndexSum += numbers&#91;i];\n        } else {\n            oddIndexSum += numbers&#91;i];\n        }\n    }\n\n    return oddIndexSum - evenIndexSum;\n}\n\nint main() {\n    std::vector&lt;int&gt; numbers = {1, 2, 3, 4, 5, 6}; \/\/ Example list\n\n    int difference = differenceOddEvenIndex(numbers);\n\n    std::cout &lt;&lt; \"Difference between sum of elements at odd indices and even indices: \" &lt;&lt; difference &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Difference between sum of elements at odd indices and even indices: -3\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def difference_odd_even_index(arr):\n    odd_index_sum = 0\n    even_index_sum = 0\n\n    for i in range(len(arr)):\n        if i % 2 == 0:\n            even_index_sum += arr&#91;i]\n        else:\n            odd_index_sum += arr&#91;i]\n\n    return odd_index_sum - even_index_sum\n\n# Example usage:\narr = &#91;1, 2, 3, 4, 5, 6]  # Example list\nresult = difference_odd_even_index(arr)\nprint(\"Difference between sum of elements at odd indices and even indices:\", result)\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Difference between sum of elements at odd indices and even indices: -3<\/code><\/pre>\n\n\n\n<p><strong>4. A Cloth merchant has some pieces of cloth of different lengths. He has an order of curtains of 12 feet. He has to find how many curtains can be made from these pieces. The lengths of pieces of cloth are recorded in feet.<\/strong><\/p>\n\n\n\n<p><strong>Note: You are expected to write code in the&nbsp;findTotalCurtains&nbsp;function only to receive the first parameter as the number of items in the array and the second parameter as the array itself. You are not required to take the input from the console.<\/strong><\/p>\n\n\n\n<p>Ans.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\n\nint findTotalCurtains(int n, const std::vector&lt;int&gt;&amp; lengths) {\n    const int curtain_length = 12;\n    int totalCurtains = 0;\n\n    for (int length : lengths) {\n        totalCurtains += length \/ curtain_length;\n    }\n\n    return totalCurtains;\n}\n\nint main() {\n    std::vector&lt;int&gt; lengths = {24, 30, 18, 12, 36}; \/\/ Example list of lengths\n    int n = lengths.size();\n\n    int totalCurtains = findTotalCurtains(n, lengths);\n\n    std::cout &lt;&lt; \"Total number of curtains that can be made: \" &lt;&lt; totalCurtains &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Total number of curtains that can be made: 7<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def find_total_curtains(n, lengths):\n    curtain_length = 12\n    total_curtains = 0\n\n    for length in lengths:\n        total_curtains += length \/\/ curtain_length\n\n    return total_curtains\n\n# Example usage:\nlengths = &#91;24, 30, 18, 12, 36]  # Example list of lengths\nn = len(lengths)\n\ntotal_curtains = find_total_curtains(n, lengths)\nprint(\"Total number of curtains that can be made:\", total_curtains)<\/code><\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Total number of curtains that can be made: 7<\/code><\/pre>\n\n\n\n<p><strong>5.&nbsp;Find a pair with the maximum product in an array of Integers.<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\n#include &lt;limits.h&gt;\n\nstd::pair&lt;int, int&gt; findMaxProductPair(const std::vector&lt;int&gt;&amp; arr) {\n    if (arr.size() &lt; 2) {\n        throw std::invalid_argument(\"Array should contain at least two elements.\");\n    }\n\n    int max1 = INT_MIN, max2 = INT_MIN;\n    int min1 = INT_MAX, min2 = INT_MAX;\n\n    for (int num : arr) {\n        if (num &gt; max1) {\n            max2 = max1;\n            max1 = num;\n        } else if (num &gt; max2) {\n            max2 = num;\n        }\n\n        if (num &lt; min1) {\n            min2 = min1;\n            min1 = num;\n        } else if (num &lt; min2) {\n            min2 = num;\n        }\n    }\n\n    int maxProduct = std::max(max1 * max2, min1 * min2);\n    if (maxProduct == max1 * max2) {\n        return {max1, max2};\n    } else {\n        return {min1, min2};\n    }\n}\n\nint main() {\n    std::vector&lt;int&gt; arr = {1, 20, -10, -30, 50, 2, 60}; \/\/ Example array\n\n    try {\n        auto result = findMaxProductPair(arr);\n        std::cout &lt;&lt; \"Pair with maximum product: (\" &lt;&lt; result.first &lt;&lt; \", \" &lt;&lt; result.second &lt;&lt; \")\\n\";\n    } catch (const std::invalid_argument&amp; e) {\n        std::cerr &lt;&lt; e.what() &lt;&lt; '\\n';\n    }\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Pair with maximum product: (60, 50)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def find_max_product_pair(arr):\n    if len(arr) &lt; 2:\n        raise ValueError(\"Array should contain at least two elements.\")\n    \n    max1 = max2 = float('-inf')\n    min1 = min2 = float('inf')\n    \n    for num in arr:\n        if num &gt; max1:\n            max2 = max1\n            max1 = num\n        elif num &gt; max2:\n            max2 = num\n        \n        if num &lt; min1:\n            min2 = min1\n            min1 = num\n        elif num &lt; min2:\n            min2 = num\n\n    max_product = max(max1 * max2, min1 * min2)\n    if max_product == max1 * max2:\n        return (max1, max2)\n    else:\n        return (min1, min2)\n\n# Example usage:\narr = &#91;1, 20, -10, -30, 50, 2, 60]  # Example array\n\ntry:\n    result = find_max_product_pair(arr)\n    print(f\"Pair with maximum product: {result}\")\nexcept ValueError as e:\n    print(e)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Pair with maximum product: (60, 50)\n<\/code><\/pre>\n\n\n\n<p><strong>6. Write a program for Decimal to Binary Conversion.<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;string&gt;\n\nstd::string decimalToBinary(int num) {\n    if (num == 0) return \"0\";\n    std::string binary = \"\";\n    while (num &gt; 0) {\n        binary = (num % 2 == 0 ? \"0\" : \"1\") + binary;\n        num \/= 2;\n    }\n    return binary;\n}\n\nint main() {\n    int num = 25; \/\/ Example decimal number\n\n    std::string binary = decimalToBinary(num);\n    std::cout &lt;&lt; \"Binary representation of \" &lt;&lt; num &lt;&lt; \" is: \" &lt;&lt; binary &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Binary representation of 25 is: 11001<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def decimal_to_binary(num):\n    if num == 0:\n        return \"0\"\n    binary = \"\"\n    while num &gt; 0:\n        binary = (\"0\" if num % 2 == 0 else \"1\") + binary\n        num \/\/= 2\n    return binary\n\n# Example usage:\nnum = 25  # Example decimal number\nbinary = decimal_to_binary(num)\nprint(f\"Binary representation of {num} is: {binary}\")<\/code><\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Binary representation of 25 is: 11001<\/code><\/pre>\n\n\n\n<p><strong>7. You are given an array, You have to choose a contiguous subarray of length \u2018k\u2019, find the minimum of that segment, and return the maximum of those minimums.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Input:&nbsp;&nbsp;<\/h4>\n\n\n\n<p>1 \u2192 Length of segment x =1<br>5 \u2192 size of space n = 5<br>1 \u2192 space = [ 1,2,3,1,2]<br>2<br>3<br>1<br>2<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<p>3<\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\n#include &lt;deque&gt;\n#include &lt;limits.h&gt;\n\nint maxOfMinSegments(int k, const std::vector&lt;int&gt;&amp; arr) {\n    int n = arr.size();\n    std::deque&lt;int&gt; dq;\n    std::vector&lt;int&gt; minValues;\n\n    for (int i = 0; i &lt; n; ++i) {\n        while (!dq.empty() &amp;&amp; dq.front() &lt;= i - k) {\n            dq.pop_front();\n        }\n        while (!dq.empty() &amp;&amp; arr&#91;dq.back()] &gt;= arr&#91;i]) {\n            dq.pop_back();\n        }\n        dq.push_back(i);\n        if (i &gt;= k - 1) {\n            minValues.push_back(arr&#91;dq.front()]);\n        }\n    }\n\n    int maxOfMin = INT_MIN;\n    for (int val : minValues) {\n        if (val &gt; maxOfMin) {\n            maxOfMin = val;\n        }\n    }\n\n    return maxOfMin;\n}\n\nint main() {\n    int k = 1;\n    std::vector&lt;int&gt; arr = {1, 2, 3, 1, 2};\n\n    int result = maxOfMinSegments(k, arr);\n    std::cout &lt;&lt; \"Maximum of minimums of all contiguous subarrays of length \" &lt;&lt; k &lt;&lt; \": \" &lt;&lt; result &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Maximum of minimums of all contiguous subarrays of length 1: 3<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def max_of_min_segments(k, arr):\n    from collections import deque\n    n = len(arr)\n    dq = deque()\n    min_values = &#91;]\n\n    for i in range(n):\n        while dq and dq&#91;0] &lt;= i - k:\n            dq.popleft()\n        while dq and arr&#91;dq&#91;-1]] &gt;= arr&#91;i]:\n            dq.pop()\n        dq.append(i)\n        if i &gt;= k - 1:\n            min_values.append(arr&#91;dq&#91;0]])\n\n    return max(min_values)\n\n# Example usage:\nk = 1\narr = &#91;1, 2, 3, 1, 2]\n\nresult = max_of_min_segments(k, arr)\nprint(f\"Maximum of minimums of all contiguous subarrays of length {k}: {result}\")<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Maximum of minimums of all contiguous subarrays of length 1: 3<\/code><\/pre>\n\n\n\n<p><strong>8. Given an array of integers representing measurements in inches, write a program to calculate the total of measurements in feet. Ignore the measurements that are less than a foot (eg. 10).<\/strong><\/p>\n\n\n\n<p><strong>Note:&nbsp;You are expected to write code in the findTotalFeet function only which will receive the first parameter as the number of items in the array and the second parameter as the array itself. You are not required to take input from the console<\/strong><\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Example:<\/strong><\/h5>\n\n\n\n<p>Finding the total measurements in feet from a list of 5 numbers<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Input:&nbsp;&nbsp;<\/h4>\n\n\n\n<p>18 11 27 12 14<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Output:<\/h4>\n\n\n\n<p><strong>5<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\n\nint findTotalFeet(int n, const std::vector&lt;int&gt;&amp; measurements) {\n    int totalFeet = 0;\n\n    for (int measurement : measurements) {\n        if (measurement &gt;= 12) {\n            totalFeet += measurement \/ 12;\n        }\n    }\n\n    return totalFeet;\n}\n\nint main() {\n    int n = 5;\n    std::vector&lt;int&gt; measurements = {18, 11, 27, 12, 14}; \/\/ Example list\n\n    int result = findTotalFeet(n, measurements);\n    std::cout &lt;&lt; \"Total measurements in feet: \" &lt;&lt; result &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Total measurements in feet: 4<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def find_total_feet(n, measurements):\n    total_feet = 0\n\n    for measurement in measurements:\n        if measurement &gt;= 12:\n            total_feet += measurement \/\/ 12\n\n    return total_feet\n\n# Example usage:\nn = 5\nmeasurements = &#91;18, 11, 27, 12, 14]  # Example list\n\nresult = find_total_feet(n, measurements)\nprint(f\"Total measurements in feet: {result}\")<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Total measurements in feet: 4<\/code><\/pre>\n\n\n\n<p><strong>9. &nbsp;Write a program to calculate and return the sum of absolute differences between the adjacent numbers in an array.<\/strong><\/p>\n\n\n\n<p><strong>Ans.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\n#include &lt;cmath&gt;\n\nint sumOfAbsoluteDifferences(const std::vector&lt;int&gt;&amp; nums) {\n    int sum = 0;\n    for (int i = 1; i &lt; nums.size(); ++i) {\n        sum += std::abs(nums&#91;i] - nums&#91;i - 1]);\n    }\n    return sum;\n}\n\nint main() {\n    std::vector&lt;int&gt; nums = {3, 5, 2, 8, 4}; \/\/ Example array\n\n    int result = sumOfAbsoluteDifferences(nums);\n    std::cout &lt;&lt; \"Sum of absolute differences between adjacent numbers: \" &lt;&lt; result &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Sum of absolute differences between adjacent numbers: 10<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def sum_of_absolute_differences(nums):\n    return sum(abs(nums&#91;i] - nums&#91;i - 1]) for i in range(1, len(nums)))\n\n# Example usage:\nnums = &#91;3, 5, 2, 8, 4]  # Example array\n\nresult = sum_of_absolute_differences(nums)\nprint(\"Sum of absolute differences between adjacent numbers:\", result)<\/code><\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Sum of absolute differences between adjacent numbers: 10<\/code><\/pre>\n\n\n\n<p><strong>10. Write a program to calculate the total bill tax amount for a list of billing amounts passed as an array of long integers.<\/strong><\/p>\n\n\n\n<p><strong>Up to 1000, there is no tax applicable, subsequently, a flat tax of 10% for the remaining amount as per the tax rate.<\/strong><\/p>\n\n\n\n<p><strong>Note:&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>All calculations and results should be integer-based ignoring fractions<\/strong><\/p>\n\n\n\n<p><strong>You are expected to write code in the calcTotalTax function only which will receive the first parameter as the number of items in the array and the second parameter is the array itself. You are not required to take input from the console.<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\n\nlong calcTotalTax(int n, const std::vector&lt;long&gt;&amp; billingAmounts) {\n    long totalTax = 0;\n    for (long amount : billingAmounts) {\n        if (amount &gt; 1000) {\n            totalTax += (amount - 1000) * 10 \/ 100; \/\/ Flat tax of 10% for amounts above 1000\n        }\n    }\n    return totalTax;\n}\n\nint main() {\n    int n = 5;\n    std::vector&lt;long&gt; billingAmounts = {800, 1200, 1500, 500, 2000}; \/\/ Example list of billing amounts\n\n    long result = calcTotalTax(n, billingAmounts);\n    std::cout &lt;&lt; \"Total bill tax amount: \" &lt;&lt; result &lt;&lt; std::endl;\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Total bill tax amount: 120<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>def calc_total_tax(n, billing_amounts):\n    total_tax = 0\n    for amount in billing_amounts:\n        if amount &gt; 1000:\n            total_tax += (amount - 1000) * 10 \/\/ 100  # Flat tax of 10% for amounts above 1000\n    return total_tax\n\n# Example usage:\nn = 5\nbilling_amounts = &#91;800, 1200, 1500, 500, 2000]  # Example list of billing amounts\n\nresult = calc_total_tax(n, billing_amounts)\nprint(\"Total bill tax amount:\", result)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Total bill tax amount: 120<\/code><\/pre>\n\n\n\n<p><strong>11. Write a program to reverse a given string without using built-in library functions.<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n<div class=\"gb-container gb-container-0093709b\">\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program<\/h4>\n\n<\/div>\n\n\n<pre class=\"wp-block-code\"><code>   #include &lt;stdio.h&gt;\n   #include &lt;string.h&gt;\n\n   void reverseString(char *str) {\n       int length = strlen(str);\n       for (int i = 0; i &lt; length \/ 2; i++) {\n           char temp = str&#91;i];\n           str&#91;i] = str&#91;length - i - 1];\n           str&#91;length - i - 1] = temp;\n       }\n   }\n\n   int main() {\n       char str&#91;] = \"Tech Mahindra\";\n       reverseString(str);\n       printf(\"Reversed string: %s\\n\", str);\n       return 0;\n   }<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Reversed string: ardnihaM hceT<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>   def reverse_string(s):\n       return s&#91;::-1]\n\n   s = \"Tech Mahindra\"\n   reversed_str = reverse_string(s)\n   print(\"Reversed string:\", reversed_str)<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Reversed string: ardnihaM hceT<\/code><\/pre>\n\n\n\n<p><strong>12. Write a program to print the Fibonacci series to a given number.<\/strong><\/p>\n\n\n\n<p><strong>Ans.<\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>   #include &lt;stdio.h&gt;\n\n   void fibonacci(int n) {\n       int first = 0, second = 1, next;\n       printf(\"Fibonacci Series: \");\n       for (int i = 0; i &lt; n; i++) {\n           printf(\"%d \", first);\n           next = first + second;\n           first = second;\n           second = next;\n       }\n   }\n\n   int main() {\n       int n = 10; \/\/ Number of terms\n       fibonacci(n);\n       return 0;\n   }<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Fibonacci Series: 0 1 1 2 3 5 8 13 21 34 <\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>   def fibonacci(n):\n       first, second = 0, 1\n       fib_series = &#91;]\n       for _ in range(n):\n           fib_series.append(first)\n           first, second = second, first + second\n       return fib_series\n\n   n = 10  # Number of terms\n   print(\"Fibonacci Series:\", fibonacci(n))\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Fibonacci Series: &#91;0, 1, 1, 2, 3, 5, 8, 13, 21, 34]<\/code><\/pre>\n\n\n\n<p><strong>13. Write a program to calculate the factorial of a given number.<\/strong><\/p>\n\n\n\n<p><strong>Ans. <\/strong><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\"> C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>   #include &lt;stdio.h&gt;\n\n   int factorial(int n) {\n       if (n == 0)\n           return 1;\n       else\n           return n * factorial(n - 1);\n   }\n\n   int main() {\n       int num = 5; \/\/ Number for factorial calculation\n       printf(\"Factorial of %d is %d\\n\", num, factorial(num));\n       return 0;\n   }<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Factorial of 5 is 120<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\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   num = 5  # Number for factorial calculation\n   print(\"Factorial of\", num, \"is\", factorial(num))<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Factorial of 5 is 120<\/code><\/pre>\n\n\n\n<p><strong>14. Write a program to check whether a given string is a palindrome.<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>   #include &lt;stdio.h&gt;\n   #include &lt;string.h&gt;\n   #include &lt;stdbool.h&gt;\n\n   bool isPalindrome(char *str) {\n       int length = strlen(str);\n       for (int i = 0; i &lt; length \/ 2; i++) {\n           if (str&#91;i] != str&#91;length - i - 1])\n               return false;\n       }\n       return true;\n   }\n\n   int main() {\n       char str&#91;] = \"radar\";\n       if (isPalindrome(str))\n           printf(\"%s is a palindrome\\n\", str);\n       else\n           printf(\"%s is not a palindrome\\n\", str);\n       return 0;\n   }<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>radar is a palindrome<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>   def is_palindrome(s):\n       return s == s&#91;::-1]\n\n   s = \"radar\"\n   if is_palindrome(s):\n       print(s, \"is a palindrome\")\n   else:\n       print(s, \"is not a palindrome\")<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>radar is a palindrome<\/code><\/pre>\n\n\n\n<p><strong>15. Write a program to check if a given number is prime.<\/strong><\/p>\n\n\n\n<p><strong>Ans<\/strong>. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"c-program\">C++ Program <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>   #include &lt;stdio.h&gt;\n   #include &lt;stdbool.h&gt;\n\n   bool isPrime(int n) {\n       if (n &lt;= 1)\n           return false;\n       for (int i = 2; i * i &lt;= n; i++) {\n           if (n % i == 0)\n               return false;\n       }\n       return true;\n   }\n\n   int main() {\n       int num = 17;\n       if (isPrime(num))\n           printf(\"%d is a prime number\\n\", num);\n       else\n           printf(\"%d is not a prime number\\n\", num);\n       return 0;\n   }<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"output\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>17 is a prime number<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"python\">Python<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>   def is_prime(n):\n       if n &lt;= 1:\n           return False\n       for i in range(2, int(n**0.5) + 1):\n           if n % i == 0:\n               return False\n       return True\n\n   num = 17\n   if is_prime(num):\n       print(num, \"is a prime number\")\n   else:\n       print(num, \"is not a prime number\")<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Output<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>17 is a prime number<\/code><\/pre>\n\n\n\n<p>These questions cover a range of fundamental programming concepts and are commonly asked in technical interviews.<\/p>\n\n\n\n<p>In conclusion, Tech Mahindra&#8217;s coding questions are structured to assess a candidate&#8217;s problem-solving abilities and programming skills. While these questions may seem challenging, they can be tackled logically, and a strong understanding of programming concepts. By practicing regularly and familiarizing yourself with common coding patterns and data structures, you can improve your chances of success. <\/p>\n\n\n\n<p>Remember, the goal is to find the correct solution but demonstrate your thought process and coding style. Along with dedication and perseverance, you can excel in Tech Mahindra&#8217;s coding assessments and take a step closer to your dream job.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"important-links-tech-mahindra-coding-questions-2024\">Important Links &#8211; Tech Mahindra Coding Questions 2024<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-eligibility-criteria\/\">Tech Mahindra Eligibility Criteria For Freshers 2024<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-application-form\/\">Tech Mahindra Application Form 2024- Apply Now<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-previous-year-paper\/\">Tech Mahindra Previous Year Paper- PDF Download<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-interview-questions\/\">Tech Mahindra Interview Question 2024<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-recruitment-process\/\">Tech Mahindra Recruitment Process 2024 For Freshers<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-syllabus\/\">Tech Mahindra Syllabus and Exam Pattern 2024- Download PDF<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra\/\">Tech Mahindra 2024: Overview, Benefits and Interview Process<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-salary\/\">Tech Mahindra Salary In India 2024 \u2013 Freshers and Experienced<\/a><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tech-mahindra-coding-question-fa-qs\">Tech Mahindra Coding Question -FAQs<\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1717399297280\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q1. <strong>What type of coding questions can I expect in Tech Mahindra interviews?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. Tech Mahindra coding questions typically cover topics, data structures, algorithms, problem-solving, and sometimes specific technologies or domains relevant to the position you are applying for.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399311085\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q2. <strong>Are the coding questions in Tech Mahindra interviews language-specific?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. No, Tech Mahindra coding questions are generally not language-specific. You can choose a programming language, such as C++, Java, or Python to solve the coding problems.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399320461\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q3.<strong>How difficult are the coding questions in Tech Mahindra interviews?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. The difficulty level of coding questions in Tech Mahindra interviews can vary depending on the role and level you are applying for. Generally, you can expect a mix of easy, medium, and sometimes hard coding problems.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399328025\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q4.<strong>What are some common coding topics I should prepare for Tech Mahindra interviews?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. Some common coding topics to prepare for Tech Mahindra interviews include:<br \/>Arrays and Strings<br \/>Linked Lists<br \/>Trees and Graphs<br \/>Sorting and Searching Algorithms<br \/>Dynamic Programming<br \/>Recursion and Backtracking<br \/>Hashing and Maps<br \/>Bit Manipulation<br \/>Object-Oriented Programming (OOP) concepts<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399335614\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q5. <strong>Which programming languages or tools to focus on for Tech Mahindra interviews?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. While Tech Mahindra does not typically require proficiency in any specific programming language or tool for interviews, it&#8217;s a good idea to be comfortable with at least one programming language and its associated libraries or frameworks. Additionally, knowledge of SQL, databases, and web technologies can be beneficial depending on the role.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399341960\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q6.<strong>How can I prepare effectively for coding questions in Tech Mahindra interviews?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. To prepare for coding questions in Tech Mahindra interviews, you should:<br \/>Practice solving coding problems from online platforms like Tech Mahindra Mock Test by Skillvertex<br \/>Review fundamental data structures and algorithms.<br \/>Understand the time and space complexity of your solutions.<br \/>Solve previous years&#8217; Tech Mahindra placement papers or interview questions.<br \/>Participate in mock interviews to simulate the interview experience.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399349524\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q7.<strong>How important are problem-solving and coding skills in Tech Mahindra interviews?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. Problem-solving and coding skills are crucial in Tech Mahindra interviews, as they assess your ability to think logically, approach problems systematically, and write efficient and correct code. Strong problem-solving skills demonstrate your readiness to tackle real-world challenges in software development.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399357954\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q8.<strong>Do you know any additional resources or tips to help me prepare for Tech Mahindra coding questions?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. Utilize online resources like tutorials, articles, and videos to strengthen your understanding of coding concepts.<br \/>Join coding communities or forums to discuss problems and learn from others.<br \/>Practice solving coding problems under time constraints to improve your speed and accuracy.<br \/>Stay updated with industry trends and technology relevant to your field of interest.<br \/>Remember to stay calm and confident during the interview process. Preparation and practice will boost your confidence and increase your chances of success in Tech Mahindra interviews.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399367541\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q9. <strong>How does Tech Mahindra evaluate coding skills during the interview process?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. Tech Mahindra evaluates coding skills through various stages of the interview process. This may include an initial screening round, candidates are asked to solve coding problems online or on a coding platform. In subsequent interview rounds, candidates may be given more complex coding challenges to solve either on a whiteboard, in a shared coding environment, or on paper. Interviewers assess candidates based on their problem-solving approach, coding style, efficiency of solutions, and ability to handle edge cases and exceptions.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1717399375063\" class=\"rank-math-list-item\">\n<h4 class=\"rank-math-question \">Q10. <strong>Can I use external resources or ask for help during Tech Mahindra coding interviews?<\/strong><br><\/h4>\n<div class=\"rank-math-answer \">\n\n<p>Ans. During Tech Mahindra coding interviews, candidates are expected to solve problems independently without referring to external resources or asking for help. While interviewers may allow clarifications on problem statements or provide hints if a candidate is stuck, relying heavily on external resources or seeking excessive help may reflect on the candidate&#8217;s problem-solving abilities. It&#8217;s important to demonstrate self-reliance and critical thinking skills during coding interviews.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Tech Mahindra Coding Questions 2024 By practicing the Tech Mahindra Coding Questions prepared by experts in 2024, graduates attempting the Tech Mahindra online exam can ace the first attempt. These Tech Mahindra Coding Questions consist of complex coding questions with answers. Read this blog on Tech Mahindra Coding questions and prepare well for the exam &#8230; <a title=\"Top 15 Tech Mahindra Coding Questions and Answers 2024\" class=\"read-more\" href=\"https:\/\/www.skillvertex.com\/blog\/tech-mahindra-coding-questions\/\" aria-label=\"More on Top 15 Tech Mahindra Coding Questions and Answers 2024\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":11658,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,1065],"tags":[1085,1086],"class_list":["post-11653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interview-prep","category-tech-mahindra","tag-tech-mahindra-coding-questions","tag-tech-mahindra-coding-questions-and-answers","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"_links":{"self":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/11653","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/comments?post=11653"}],"version-history":[{"count":35,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/11653\/revisions"}],"predecessor-version":[{"id":12307,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/posts\/11653\/revisions\/12307"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/media\/11658"}],"wp:attachment":[{"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/media?parent=11653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/categories?post=11653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skillvertex.com\/blog\/wp-json\/wp\/v2\/tags?post=11653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}