{"id":15714,"date":"2022-04-27T08:09:17","date_gmt":"2022-04-27T08:09:17","guid":{"rendered":"https:\/\/exceptionly.com\/?p=15714"},"modified":"2022-06-29T16:35:50","modified_gmt":"2022-06-29T16:35:50","slug":"technical-interview-questions-understanding-quicksort-algorithm","status":"publish","type":"post","link":"https:\/\/exceptionly.com\/ar\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/","title":{"rendered":"Technical Interview Questions: Understanding Quicksort Algorithm"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"15714\" class=\"elementor elementor-15714\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-24ff637 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"24ff637\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7a719ff\" data-id=\"7a719ff\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4e3da02 elementor-widget elementor-widget-text-editor\" data-id=\"4e3da02\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>The third round of interview questions wouldn&#8217;t be fair if we didn&#8217;t mention a sorting algorithm! So, in this tutorial, I decided to go through one of the most efficient sorting algorithms: The Quicksort Algorithm!<\/p><h2>What is the Quicksort Algorithm?<\/h2><p>Quicksort is one of the most efficient sorting algorithms and an excellent question for an interview.\u00a0<\/p><p>The best-case time complexity of Quicksort is O(n log n), average-case complexity is O(n log n), and O(n^2) in the worst case. So, of course, the dataset plays a significant role in the complexity of any sorting algorithm. But there is no harm in mentioning that Quicksort is considered the fastest sorting algorithm most of the time.<\/p><h2>How Does Quicksort work?\u00a0<\/h2><p>The Quicksort algorithm works on the principle of repeatedly dividing and conquering. It always picks an element as a pivot, splits the array of data into smaller chunks, sorts sub-arrays, and then combines them.\u00a0<\/p><p>Three steps of Quicksort;<\/p><p><strong>Choose the pivot:<\/strong><\/p><p>Quicksort algorithm has different implementations for pivot selection, but the aim is to choose the middle element as the pivot. Various algorithms determine the first or last item as a pivot.<\/p><p><strong>Divide and conquer the data:<\/strong><\/p><p>Based on the chosen pivot pointer, the array of items smaller than the pivot will be placed on the left side, and the array of items bigger than the pivot will be placed on the right side of the pivot.\u00a0<\/p><p><strong>Combine (if needed):<\/strong><\/p><p>Repeat the steps until all data is sorted, and then combine the sorted sub-arrays.<\/p><h2>Quicksort Implementation in Java<\/h2><p>The below implementation is from <a href=\"https:\/\/www.programcreek.com\/\">programcreek.com<\/a> and uses the middle element of the array as a pivot and orders based on that.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-039e396 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"039e396\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3b623b8\" data-id=\"3b623b8\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6dfdc70 elementor-widget elementor-widget-code-highlight\" data-id=\"6dfdc70\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-tomorrow copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-java \">\n\t\t\t\t<code readonly=\"true\" class=\"language-java\">\n\t\t\t\t\t<xmp>public static void quickSort(int[] arr, int low, int high) {\n\t\tif (arr == null || arr.length == 0)\n\t\t\treturn;\n \n\t\tif (low >= high)\n\t\t\treturn;\n \n\t\t\/\/ pick the pivot\n\t\tint middle = low + (high - low) \/ 2;\n\t\tint pivot = arr[middle];\n \n\t\t\/\/ make left < pivot and right > pivot\n\t\tint i = low, j = high;\n\t\twhile (i <= j) {\n\t\t\twhile (arr[i] < pivot) {\n\t\t\t\ti++;\n\t\t\t}\n \n\t\t\twhile (arr[j] > pivot) {\n\t\t\t\tj--;\n\t\t\t}\n \n\t\t\tif (i <= j) {\n\t\t\t\tint temp = arr[i];\n\t\t\t\tarr[i] = arr[j];\n\t\t\t\tarr[j] = temp;\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n \n\t\t\/\/ recursively sort two sub parts\n\t\tif (low < j)\n\t\t\tquickSort(arr, low, j);\n \n\t\tif (high > i)\n\t\t\tquickSort(arr, i, high);\n\t}<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-294eeec elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"294eeec\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-8504ba6\" data-id=\"8504ba6\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-aff5969 elementor-widget elementor-widget-text-editor\" data-id=\"aff5969\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Quicksort Algorithm Iteration for a pre-defined dataset;<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-289ef5f elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"289ef5f\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4ec0599\" data-id=\"4ec0599\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1ba708a elementor-widget elementor-widget-image\" data-id=\"1ba708a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"438\" src=\"https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/quicksort-1024x560.png\" class=\"attachment-large size-large wp-image-15750\" alt=\"\" srcset=\"https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/quicksort-1024x560.png 1024w, https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/quicksort-300x164.png 300w, https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/quicksort-768x420.png 768w, https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/quicksort-1536x840.png 1536w, https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/quicksort-2048x1119.png 2048w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-04c2ade elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"04c2ade\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5bd3cb5\" data-id=\"5bd3cb5\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9d40354 elementor-widget elementor-widget-text-editor\" data-id=\"9d40354\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2 class=\"LC20lb MBeuO DKV0Md\">Conclusion<\/h2><p>Quicksort algorithm gives instructions about sorting a dataset in a few steps but does not restrict you with the step details. There might be different implementations for pivot selection and different swap algorithms, and even the way you combine data might be different.\u00a0 In that sense feel free to check out different implementations of Quicksort.\u00a0<\/p><p>Exceptionly Tech Blog is a great source to keep yourself up to date as it challenges tools, best practices, and methodologies.<\/p><p>Check out some of my other posts that might help you with your interview preparation!<\/p><p><a href=\"https:\/\/exceptionly.com\/2021\/08\/17\/technical-interview-questions-sliding-window-technique\/\">Technical Interview Questions: Sliding Window Technique<\/a><\/p><p><a href=\"https:\/\/exceptionly.com\/2022\/02\/27\/technical-interview-questions-binary-search-algorithm\/\">Technical Interview Questions: Binary Search Algorithm<\/a><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>The third round of interview questions wouldn&#8217;t be fair if we didn&#8217;t mention a sorting algorithm! So, in this tutorial, I decided to go through one of the most efficient sorting algorithms: The Quicksort Algorithm! What is the Quicksort Algorithm? Quicksort is one of the most efficient sorting algorithms and an excellent question for an [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":15932,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[206,179,208,200,143,139,210,91,198,207,209,182,199],"class_list":["post-15714","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-backend","tag-binary-search","tag-c","tag-interview-questions","tag-java","tag-node-js","tag-php","tag-python","tag-quicksort","tag-ruby","tag-scala","tag-sliding-window","tag-sorting-algorithms"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v18.5 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Technical Interview Questions: Understanding Quicksort Algorithm - Exceptionly<\/title>\n<meta name=\"description\" content=\"The Quicksort algorithm is working on the principle of repeatedly dividing and conquering. It always picks an element as a pivot, splits the array of data into smaller chunks, sorts sub-arrays, and then combines them back.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/exceptionly.com\/ar\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/\" \/>\n<meta property=\"og:locale\" content=\"ar_AR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Technical Interview Questions: Understanding Quicksort Algorithm\" \/>\n<meta property=\"og:description\" content=\"The third round of interview questions wouldn&#039;t be fair if we didn&#039;t mention a sorting algorithm! So, in this tutorial, I decided to go through one of the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceptionly.com\/ar\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/\" \/>\n<meta property=\"og:site_name\" content=\"Exceptionly\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/exceptionly\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-27T08:09:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-29T16:35:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/technical-interview-questions-understanding-quicksort-algorithms.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1930\" \/>\n\t<meta property=\"og:image:height\" content=\"766\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fatma Elverir\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@exceptionly\" \/>\n<meta name=\"twitter:site\" content=\"@exceptionly\" \/>\n<meta name=\"twitter:label1\" content=\"\u0643\u064f\u062a\u0628 \u0628\u0648\u0627\u0633\u0637\u0629\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fatma Elverir\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u0648\u0642\u062a \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u064f\u0642\u062f\u0651\u0631\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u062f\u0642\u0627\u0626\u0642\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/\"},\"author\":{\"name\":\"Fatma Elverir\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/person\\\/a2600170dfb4513350affede916c0ccf\"},\"headline\":\"Technical Interview Questions: Understanding Quicksort Algorithm\",\"datePublished\":\"2022-04-27T08:09:17+00:00\",\"dateModified\":\"2022-06-29T16:35:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/\"},\"wordCount\":404,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/technical-interview-questions-understanding-quicksort-algorithms.jpg\",\"keywords\":[\"Backend\",\"Binary Search\",\"C#\",\"interview questions\",\"Java\",\"Node.js\",\"PHP\",\"Python\",\"Quicksort\",\"Ruby\",\"Scala\",\"Sliding Window\",\"sorting algorithms\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/\",\"name\":\"Technical Interview Questions: Understanding Quicksort Algorithm - Exceptionly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/technical-interview-questions-understanding-quicksort-algorithms.jpg\",\"datePublished\":\"2022-04-27T08:09:17+00:00\",\"dateModified\":\"2022-06-29T16:35:50+00:00\",\"description\":\"The Quicksort algorithm is working on the principle of repeatedly dividing and conquering. It always picks an element as a pivot, splits the array of data into smaller chunks, sorts sub-arrays, and then combines them back.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/#breadcrumb\"},\"inLanguage\":\"ar\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/#primaryimage\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/technical-interview-questions-understanding-quicksort-algorithms.jpg\",\"contentUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/technical-interview-questions-understanding-quicksort-algorithms.jpg\",\"width\":1930,\"height\":766,\"caption\":\"Technical Interview Questions: Understanding Quicksort Algorithms\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/2022\\\/04\\\/27\\\/technical-interview-questions-understanding-quicksort-algorithm\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/exceptionly.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Technical Interview Questions: Understanding Quicksort Algorithm\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#website\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/\",\"name\":\"Exceptionly\",\"description\":\"Remote software talent acquisition at scale\",\"publisher\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/exceptionly.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ar\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#organization\",\"name\":\"Exceptionly\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/exceptionly-search-logo.png\",\"contentUrl\":\"https:\\\/\\\/exceptionly.com\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/exceptionly-search-logo.png\",\"width\":400,\"height\":400,\"caption\":\"Exceptionly\"},\"image\":{\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/exceptionly\\\/\",\"https:\\\/\\\/x.com\\\/exceptionly\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/exceptionly\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCet5wATTyif6knI0h4vUkNA\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/exceptionly.com\\\/#\\\/schema\\\/person\\\/a2600170dfb4513350affede916c0ccf\",\"name\":\"Fatma Elverir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ar\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g\",\"caption\":\"Fatma Elverir\"},\"sameAs\":[\"https:\\\/\\\/exceptionly.com\"],\"url\":\"https:\\\/\\\/exceptionly.com\\\/ar\\\/author\\\/fatmaelverir\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Technical Interview Questions: Understanding Quicksort Algorithm - Exceptionly","description":"The Quicksort algorithm is working on the principle of repeatedly dividing and conquering. It always picks an element as a pivot, splits the array of data into smaller chunks, sorts sub-arrays, and then combines them back.","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:\/\/exceptionly.com\/ar\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/","og_locale":"ar_AR","og_type":"article","og_title":"Technical Interview Questions: Understanding Quicksort Algorithm","og_description":"The third round of interview questions wouldn't be fair if we didn't mention a sorting algorithm! So, in this tutorial, I decided to go through one of the","og_url":"https:\/\/exceptionly.com\/ar\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/","og_site_name":"Exceptionly","article_publisher":"https:\/\/www.facebook.com\/exceptionly\/","article_published_time":"2022-04-27T08:09:17+00:00","article_modified_time":"2022-06-29T16:35:50+00:00","og_image":[{"width":1930,"height":766,"url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/technical-interview-questions-understanding-quicksort-algorithms.jpg","type":"image\/jpeg"}],"author":"Fatma Elverir","twitter_card":"summary_large_image","twitter_creator":"@exceptionly","twitter_site":"@exceptionly","twitter_misc":{"\u0643\u064f\u062a\u0628 \u0628\u0648\u0627\u0633\u0637\u0629":"Fatma Elverir","\u0648\u0642\u062a \u0627\u0644\u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u064f\u0642\u062f\u0651\u0631":"3 \u062f\u0642\u0627\u0626\u0642"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/#article","isPartOf":{"@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/"},"author":{"name":"Fatma Elverir","@id":"https:\/\/exceptionly.com\/#\/schema\/person\/a2600170dfb4513350affede916c0ccf"},"headline":"Technical Interview Questions: Understanding Quicksort Algorithm","datePublished":"2022-04-27T08:09:17+00:00","dateModified":"2022-06-29T16:35:50+00:00","mainEntityOfPage":{"@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/"},"wordCount":404,"commentCount":0,"publisher":{"@id":"https:\/\/exceptionly.com\/#organization"},"image":{"@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/#primaryimage"},"thumbnailUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/technical-interview-questions-understanding-quicksort-algorithms.jpg","keywords":["Backend","Binary Search","C#","interview questions","Java","Node.js","PHP","Python","Quicksort","Ruby","Scala","Sliding Window","sorting algorithms"],"articleSection":["Tutorials"],"inLanguage":"ar","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/","url":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/","name":"Technical Interview Questions: Understanding Quicksort Algorithm - Exceptionly","isPartOf":{"@id":"https:\/\/exceptionly.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/#primaryimage"},"image":{"@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/#primaryimage"},"thumbnailUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/technical-interview-questions-understanding-quicksort-algorithms.jpg","datePublished":"2022-04-27T08:09:17+00:00","dateModified":"2022-06-29T16:35:50+00:00","description":"The Quicksort algorithm is working on the principle of repeatedly dividing and conquering. It always picks an element as a pivot, splits the array of data into smaller chunks, sorts sub-arrays, and then combines them back.","breadcrumb":{"@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/#breadcrumb"},"inLanguage":"ar","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/"]}]},{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/#primaryimage","url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/technical-interview-questions-understanding-quicksort-algorithms.jpg","contentUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2022\/04\/technical-interview-questions-understanding-quicksort-algorithms.jpg","width":1930,"height":766,"caption":"Technical Interview Questions: Understanding Quicksort Algorithms"},{"@type":"BreadcrumbList","@id":"https:\/\/exceptionly.com\/2022\/04\/27\/technical-interview-questions-understanding-quicksort-algorithm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/exceptionly.com\/"},{"@type":"ListItem","position":2,"name":"Technical Interview Questions: Understanding Quicksort Algorithm"}]},{"@type":"WebSite","@id":"https:\/\/exceptionly.com\/#website","url":"https:\/\/exceptionly.com\/","name":"Exceptionly","description":"Remote software talent acquisition at scale","publisher":{"@id":"https:\/\/exceptionly.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceptionly.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ar"},{"@type":"Organization","@id":"https:\/\/exceptionly.com\/#organization","name":"Exceptionly","url":"https:\/\/exceptionly.com\/","logo":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/exceptionly.com\/#\/schema\/logo\/image\/","url":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/05\/exceptionly-search-logo.png","contentUrl":"https:\/\/exceptionly.com\/wp-content\/uploads\/2021\/05\/exceptionly-search-logo.png","width":400,"height":400,"caption":"Exceptionly"},"image":{"@id":"https:\/\/exceptionly.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/exceptionly\/","https:\/\/x.com\/exceptionly","https:\/\/www.linkedin.com\/company\/exceptionly\/","https:\/\/www.youtube.com\/channel\/UCet5wATTyif6knI0h4vUkNA"]},{"@type":"Person","@id":"https:\/\/exceptionly.com\/#\/schema\/person\/a2600170dfb4513350affede916c0ccf","name":"Fatma Elverir","image":{"@type":"ImageObject","inLanguage":"ar","@id":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93179e5b3e943c5bcda6ea20d6b37723c01dedb150ab7724bb4fb9af22eb3de6?s=96&d=mm&r=g","caption":"Fatma Elverir"},"sameAs":["https:\/\/exceptionly.com"],"url":"https:\/\/exceptionly.com\/ar\/author\/fatmaelverir\/"}]}},"_links":{"self":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts\/15714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/comments?post=15714"}],"version-history":[{"count":0,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/posts\/15714\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/media\/15932"}],"wp:attachment":[{"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/media?parent=15714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/categories?post=15714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exceptionly.com\/ar\/wp-json\/wp\/v2\/tags?post=15714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}