{"id":3449,"date":"2021-11-09T17:30:33","date_gmt":"2021-11-09T12:00:33","guid":{"rendered":"https:\/\/www.interviewbit.com\/blog\/?p=3449"},"modified":"2021-11-09T17:30:34","modified_gmt":"2021-11-09T12:00:34","slug":"count-inversions-of-an-array","status":"publish","type":"post","link":"https:\/\/www.interviewbit.com\/blog\/count-inversions-of-an-array\/","title":{"rendered":"Count Inversions of an Array"},"content":{"rendered":"\n<div class=\"gutentoc tocactive nostyle\" style=\"max-width:400px\"><div class=\"gutentoc-toc-wrap\"><div class=\"gutentoc-toc-title-wrap\"><div class=\"gutentoc-toc-title\">Table Of Contents<\/div><div id=\"open\" class=\"toggletwo\">show<\/div><\/div><div id=\"toclist\"><div class=\"gutentoc-toc__list-wrap\"><ul class=\"gutentoc-toc__list\"><li><a href=\"#problem-statement\">Problem Statement<\/a><\/li><li><a href=\"#approach-1-brute-force\">Approach 1: Brute Force<\/a><\/li><ul class=\"gutentoc-toc__list\"><li><a href=\"#c-implementation\">C++ Implementation<\/a><\/li><li><a href=\"#java-implemenation\">Java Implemenation<\/a><\/li><li><a href=\"#python-implementation\">Python Implementation<\/a><\/li><\/ul><li><a href=\"#approach-2-merge-sort\">Approach 2: Merge Sort<\/a><\/li><ul class=\"gutentoc-toc__list\"><li><a href=\"#c-implementation\">C++ Implementation<\/a><\/li><li><a href=\"#java-implementation\">Java Implementation<\/a><\/li><li><a href=\"#python-implementation\">Python Implementation<\/a><\/li><\/ul><li><a href=\"#practice-question\">Practice Question<\/a><\/li><li><a href=\"#faqs\">FAQs<\/a><\/li><\/ul><\/div><\/div><\/div><\/div>\n\n\n\n<h2 id=\"problem-statement\">Problem Statement<\/h2>\n\n\n\n<p>Given an array <strong>A<\/strong> of size <strong>N<\/strong>. The task is to count the total number of <strong>inversions<\/strong> of the array.<\/p>\n\n\n\n<p><strong>Inversions: <\/strong>A pair (A[i], A[j]) is said to be in <strong>inversion if:<\/strong><\/p>\n\n\n\n<ul><li><strong>A[i] > A[j]<\/strong><\/li><li><strong>i &lt; j<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Examples:<\/strong><\/p>\n\n\n\n<p><strong>Input: <\/strong>A[] = [3, 2, 1]<br><strong>Output: <\/strong>3<br><strong>Explanation:<\/strong><\/p>\n\n\n\n<p>The three pairs of inversions are &#8211; (3, 2) , (3, 1), (2, 1)<\/p>\n\n\n\n<p><strong>Input: <\/strong>\u00a0A[] = {6, 3, 5 ,2, 7}<br><strong>Output:<\/strong> 5<br><strong>Explanation:<\/strong><\/p>\n\n\n\n<p>The five pairs of inversions are &#8211; (6, 3) , (6, 5), (6, 2), (3, 2), (5, 2)<\/p>\n\n\n\n<h2 id=\"approach-1-brute-force\">Approach 1: Brute Force<\/h2>\n\n\n\n<p>A simple approach is to consider every possible pair of the array and check if the pair satisfies the given condition. If true, increment count.<\/p>\n\n\n\n<p><strong>Algorithm:<\/strong><\/p>\n\n\n\n<ul><li>Initialise <strong>count = 0<\/strong>.<\/li><li>Run a loop <strong>i<\/strong> from 0 to <strong>N<\/strong> and a nested loop <strong>j<\/strong> from <strong>i + 1<\/strong> till <strong>N<\/strong>.<ul><li>If <strong>A[i]<\/strong> > <strong>A[j], <\/strong>increment count<\/li><\/ul><\/li><li>Return count.<\/li><\/ul>\n\n\n\n<h3 id=\"c-implementation\"><span id=\"c-implementation-2\">C++ Implementation<\/span><\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int getInversions(int * A, int n) {\n  int count = 0;\n  for (int i = 0; i &lt; n; ++i) {\n    for (int j = i + 1; j &lt; n; ++j) {\n      if (A[i] > a[j]) {\n        ++count;\n      }\n    }\n  }\n  return count;\n}<\/pre>\n\n\n\n<h3 id=\"java-implemenation\">Java Implemenation<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public static int getInversions(int[] A, int n) {\n  int count = 0;\n \n  for (int i = 0; i &lt; n; i++) {\n    for (int j = i + 1; j &lt; n; j++) {\n      if (A[i] > A[j]) {\n        count += 1;\n      }\n \n    }\n  }\n  return count;\n}<\/pre>\n\n\n\n<h3 id=\"python-implementation\"><span id=\"python-implementation-2\">Python Implementation<\/span><\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def getInversions(A, n):\n    count = 0\n    for i in range(n):\n        for j in range(i + 1, n):\n            if A[i] > A[j]:\n                count += 1\n \n    return count<\/pre>\n\n\n\n<p><strong>Time Complexity:<\/strong>O(N^2), where N is the total size of the array<br><strong>Space Complexity:<\/strong>O(1), as no extra space has been used.<\/p>\n\n\n\n<h2 id=\"approach-2-merge-sort\">Approach 2: Merge Sort<\/h2>\n\n\n\n<p>The idea is to use a method similar to the <strong>merge sort <\/strong>algorithm. Like merge sort, divide the given array into two parts. For each left and right half, count the inversions, and at the end, sum up the inversions from both halves to get the resultant inversions.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img  loading=\"lazy\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  class=\"wp-image-3489 pk-lazyload\"  width=\"556\"  height=\"674\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"(max-width: 556px) 100vw, 556px\"  data-pk-src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-5-844x1024.png\"  data-pk-srcset=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-5-844x1024.png 844w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-5-247x300.png 247w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-5-768x931.png 768w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-5-380x461.png 380w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-5-550x667.png 550w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-5-800x970.png 800w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-5.png 1025w\" ><\/figure><\/div>\n\n\n\n<p><strong>Dry run of the above approach with an example:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img  loading=\"lazy\"  width=\"1024\"  height=\"577\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  class=\"wp-image-3491 pk-lazyload\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"(max-width: 1024px) 100vw, 1024px\"  data-pk-src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-4.png\"  data-pk-srcset=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-4.png 1024w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-4-300x169.png 300w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-4-768x433.png 768w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-4-380x214.png 380w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-4-550x310.png 550w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-4-800x451.png 800w\" ><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img  loading=\"lazy\"  width=\"1024\"  height=\"577\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  class=\"wp-image-3492 pk-lazyload\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"(max-width: 1024px) 100vw, 1024px\"  data-pk-src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-3-1.png\"  data-pk-srcset=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-3-1.png 1024w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-3-1-300x169.png 300w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-3-1-768x433.png 768w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-3-1-380x214.png 380w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-3-1-550x310.png 550w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-3-1-800x451.png 800w\" ><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img  loading=\"lazy\"  width=\"1024\"  height=\"577\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  class=\"wp-image-3493 pk-lazyload\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"(max-width: 1024px) 100vw, 1024px\"  data-pk-src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-1-4.png\"  data-pk-srcset=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-1-4.png 1024w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-1-4-300x169.png 300w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-1-4-768x433.png 768w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-1-4-380x214.png 380w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-1-4-550x310.png 550w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-1-4-800x451.png 800w\" ><\/figure>\n\n\n\n<p>The total inversion count of the above array is 6.<\/p>\n\n\n\n<p>The overall algorithm can be briefed as such :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img  loading=\"lazy\"  width=\"817\"  height=\"1024\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  class=\"wp-image-3494 pk-lazyload\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"(max-width: 817px) 100vw, 817px\"  data-pk-src=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-2-2-817x1024.png\"  data-pk-srcset=\"https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-2-2-817x1024.png 817w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-2-2-239x300.png 239w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-2-2-768x963.png 768w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-2-2-380x476.png 380w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-2-2-550x690.png 550w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-2-2-800x1003.png 800w, https:\/\/www.interviewbit.com\/blog\/wp-content\/uploads\/2021\/11\/Image-2-2.png 1024w\" ><\/figure>\n\n\n\n<p id=\"algorithm\"><strong>Algorithm<\/strong><\/p>\n\n\n\n<ul><li>Split the given input array into two halves, <strong>left<\/strong> and <strong>right<\/strong> similar to <strong>merge sort<\/strong> recursively.<\/li><li>Count the number of inversions in the <strong>left<\/strong> half and <strong>right <\/strong>half along with the inversions found during the merging of the two halves.<\/li><li>Stop the recursion, only when 1 element is left in both halves.<\/li><li>To count the number of inversions, we will use a <strong>two pointers<\/strong> approach. Let us consider two pointers <strong>i<\/strong> and <strong>j<\/strong>, one pointing to the left half and the other pointing towards the right half.<\/li><li>While iterating through both the halves, if the current element <strong>A[i]<\/strong> is less than <strong>A[j], <\/strong>add it to the sorted list, else increment the count by <strong>mid &#8211; i<\/strong>.<\/li><\/ul>\n\n\n\n<h3 id=\"c-implementation\">C++ Implementation<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">long long merge(long long arr[], int left, int mid, int right) {\n  int i = left, j = mid, k = 0;\n  long long invCount = 0;\n  int temp[(right - left + 1)];\n \n  while ((i &lt; mid) &amp;&amp; (j &lt;= right)) {\n    if (arr[i] &lt;= arr[j]) {\n      temp[k] = arr[i];\n      ++k;\n      ++i;\n    } else {\n      temp[k] = arr[j];\n      invCount += (mid - i);\n      ++k;\n      ++j;\n    }\n  }\n \n  while (i &lt; mid) {\n    temp[k] = arr[i];\n    ++k;\n    ++i;\n  }\n \n  while (j &lt;= right) {\n    temp[k] = arr[j];\n    ++k;\n    ++j;\n  }\n \n  for (i = left, k = 0; i &lt;= right; i++, k++) {\n    arr[i] = temp[k];\n  }\n \n  return invCount;\n}\nlong long mergeSort(long long arr[], int left, int right) {\n  long long invCount = 0;\n \n  if (right > left) {\n    int mid = (right + left) \/ 2;\n    invCount = mergeSort(arr, left, mid);\n    invCount += mergeSort(arr, mid + 1, right);\n    invCount += merge(arr, left, mid + 1, right);\n  }\n  return invCount;\n}\n \nlong long getInversions(long long arr[], int n) {\n  return mergeSort(arr, 0, n - 1);\n}<\/pre>\n\n\n\n<h3 id=\"java-implementation\">Java Implementation<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">private static long merge(long arr[], int left, int mid, int right) {\n        int i = left, j = mid, k = 0;\n        long invCount = 0;\n        long temp[] = new long[(right - left + 1)];\n \n        while ((i &lt; mid) &amp;&amp; (j &lt;= right)) {\n            if (arr[i] &lt;= arr[j]) {\n                temp[k] = arr[i];\n                ++k;\n                ++i;\n            } \n            else {\n                temp[k] = arr[j];\n                invCount += (mid - i);\n                ++k;\n                ++j;\n            }\n        }\n \n        while (i &lt; mid) {\n            temp[k] = arr[i];\n            ++k;\n            ++i;\n        }\n \n        while (j &lt;= right) {\n            temp[k] = arr[j];\n            ++k;\n            ++j;\n        }\n \n        for (i = left, k = 0; i &lt;= right; i++, k++) {\n            arr[i] = temp[k];\n        }\n \n        return invCount;\n    }\n    private static long mergeSort(long arr[], int left, int right) {\n        long invCount = 0;\n \n        if (right > left) {\n            int mid = (right + left) \/ 2;\n \n            invCount = mergeSort(arr, left, mid);\n            invCount += mergeSort(arr, mid + 1, right);\n            invCount += merge(arr, left, mid + 1, right);\n        }\n        return invCount;\n    }\n \n    public static long getInversions(long arr[], int n) {\n        return mergeSort(arr, 0, n - 1);\n    }<\/pre>\n\n\n\n<h3 id=\"python-implementation\">Python Implementation<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def merge(arr, left, mid, right):\n    i = left\n    j = mid\n    k = 0\n    invCount = 0\n    temp = [0 for x in range(right - left + 1)]\n \n    while (i &lt; mid) and (j &lt;= right):\n        if arr[i] &lt;= arr[j]:\n            temp[k] = arr[i]\n            k += 1\n            i += 1\n \n        else:\n            temp[k] = arr[j]\n            invCount += mid - i\n            k += 1\n            j += 1\n \n    while i &lt; mid:\n        temp[k] = arr[i]\n        k += 1\n        i += 1\n \n    while j &lt;= right:\n        temp[k] = arr[j]\n        k += 1\n        j += 1\n \n    k = 0\n    for i in range(left, right + 1):\n        arr[i] = temp[k]\n        k += 1\n \n    return invCount\n \n \ndef mergeSort(arr, left, right):\n    invCount = 0\n \n    if right > left:\n        mid = (right + left) \/\/ 2\n \n        invCount = mergeSort(arr, left, mid)\n        invCount += mergeSort(arr, mid + 1, right)\n        invCount += merge(arr, left, mid + 1, right)\n \n    return invCount\n \n \ndef getInversions(arr, n):\n    return mergeSort(arr, 0, n - 1)<\/pre>\n\n\n\n<p><strong>Time Complexity:<\/strong>O(NlogN), where N is the total size of the array<br>Space Complexity:O(N), where N is the total size of the array<\/p>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-background has-black-background-color has-black-color is-style-wide\"\/>\n\n\n\n<h2 id=\"practice-question\">Practice Question<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.interviewbit.com\/problems\/inversions\/\" target=\"_blank\" rel=\"noreferrer noopener\">Inversions<\/a><\/p>\n\n\n\n<h2 id=\"faqs\">FAQs<\/h2>\n\n\n\n<p><strong>What does the count of inversions indicate in an array?<br><\/strong>The count of inversion of an array indicates, how far the array is from being sorted in increasing order.<\/p>\n\n\n\n<p><strong>What is the most efficient approach to counting the number of inversions?<br><\/strong>The merge sort approach is the most efficient approach to count the number of inversions. The time complexity is O(NlogN)<\/p>\n","protected":false},"excerpt":{"rendered":"Problem Statement Given an array A of size N. The task is to count the total number of&hellip;\n","protected":false},"author":5,"featured_media":3495,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_daextam_enable_autolinks":"","csco_singular_sidebar":"","csco_page_header_type":"","csco_appearance_grid":"","csco_page_load_nextpost":"","csco_post_video_location":[],"csco_post_video_location_hash":"","csco_post_video_url":"","csco_post_video_bg_start_time":0,"csco_post_video_bg_end_time":0},"categories":[145],"tags":[542],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/posts\/3449"}],"collection":[{"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/comments?post=3449"}],"version-history":[{"count":4,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/posts\/3449\/revisions"}],"predecessor-version":[{"id":3496,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/posts\/3449\/revisions\/3496"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/media\/3495"}],"wp:attachment":[{"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/media?parent=3449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/categories?post=3449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.interviewbit.com\/blog\/wp-json\/wp\/v2\/tags?post=3449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}