3.7 of 5 817 reviews San Francisco, CA 5000+ Employees Software QA Engineer Intern Interview Question

I interviewed in San Francisco, CA and was asked:
"Was asked to program quick-sort in Java."
Tags: java, sorting algorithm
Add Tags [?]
Answer Flag Question

Part of a Software QA Engineer Intern Interview Review - one of 379 Interview Reviews

Answers & Comments

of 0
void QuickSort(int[] arr, int low, int high)
     while (low < high)
         int pivot = (low+high)/2;
         int partition = Partition(arr, low, high, pivot);
         QuickSort(arr, low, partition);
         QuickSort(arr, partition+1, high);

 void Partition(int[] arr, int low, int high, int pivot)
     // take pivot element to end
     swap(arr[pivot], arr[high]);

     int pivotElement = arr[high];
     int finalPosition = 0;

     for (int i = low; i < high - 1; ++i)
         if (arr[i] < pivotElement)

     // put pivot element in its "final position"
- Jigargosha on Jul 10, 2012 Flag Response

To comment on this question, Sign In with Facebook or Sign Up – Why Work for Us?'s social and mobile cloud technologies are helping companies connect with their customers, partners and employees in entirely new ways and revolutionizing the way businesses sell, service, market, and… Full Overview

Provided by employer [?]

Tags are like keywords, helping to categorise interview questions that have something in common.

Glassdoor is your free inside look at interview questions and advice. All interview reviews are posted anonymously by employees and interview candidates.