Algorithm - Interview Questions and Answers for 'Sorting' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Algorithm - Interview Questions and Answers for 'Sorting' - 11 question(s) found - Order By Rating

 Q1. Explain In place sorting algorithm ?Algorithm
 This question was recently asked at 'Reddit,ServiceNow'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     sorting algorithm   in place sorting algorithm     Asked in 2 Companies


 Q2. How to sort objects based on one of the field ?Core Java
Ans. Using comparable and comparator and sorted collections like TreeSet or TreeMap.

or

use stream api from java 8 onwards which internally refers to comparable and comparator through lambda expressions

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     sort  sorting  comprator  comparable  treeset  treemap  sorting collections     Asked in 1 Companies      Basic        frequent


  Q3. Write code to sort an array.Algorithm
Ans. https://www.geeksforgeeks.org/arrays-sort-in-java-with-examples/

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     array  sorting     Asked in 16 Companies      basic        frequent


 Q4. Explain bubble sort.Algorithm
Ans. array is traversed from first element to last element. Here current element is compared with next element. If current element is greater than next element it is swapped.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     sorting  bubble sort     Asked in 1 Companies


 Q5. Write any sorting algorithm.Algorithm
Ans. https://javasearch.buggybread.com/InterviewQuestions/questionSearch.php?searchOption=label'

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Algorithm  Sorting Algorithm     Asked in 4 Companies      basic        frequent


 Q6. Write an algorithm / java program for Heap Sort ?Algorithm
Ans. https://www.geeksforgeeks.org/heap-sort/

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     sorting  heap sort     Asked in 1 Companies        frequent


 Q7. Explain various Searching and Sorting Algorithms ?Algorithm
 This question was recently asked at 'HeadStrong,ServiceNow'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Search Algorithm  Sorting Algorithm     Asked in 2 Companies      basic        frequent


 Q8. If I try to add Enum constants to a TreeSet, What sorting order will it use ?
Ans. Tree Set will sort the Values in the order in which Enum constants are declared.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   collections   set   treeset   enum   sorting   technical lead


 Q9. Which sorting algorithm is used by Collections.sort() in Java ?Core Java
Ans. The sorting algorithm is a modified mergesort. This algorithm offers guaranteed n log(n) performance.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   algorithm   collections   collections.sort   sorting algorithm      expert

Try 1 Question(s) Test


 Q10. Collections.sort can only be performed on ..

a. Set
b. List
c. Map
d. Any Collection implementation
Core Java
Ans. List

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     collections   java   sorting

Try 2 Question(s) Test


 Q11. Write code to sort elements of a set
Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?&category=code&searchOption&keyword=952

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     set  collections  sorting  treeset  code  coding



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: