
- DSA - Home
- DSA - Overview
- DSA - Environment Setup
- DSA - Algorithms Basics
- DSA - Asymptotic Analysis
- Data Structures
- DSA - Data Structure Basics
- DSA - Data Structures and Types
- DSA - Array Data Structure
- DSA - Skip List Data Structure
- Linked Lists
- DSA - Linked List Data Structure
- DSA - Doubly Linked List Data Structure
- DSA - Circular Linked List Data Structure
- Stack & Queue
- DSA - Stack Data Structure
- DSA - Expression Parsing
- DSA - Queue Data Structure
- DSA - Circular Queue Data Structure
- DSA - Priority Queue Data Structure
- DSA - Deque Data Structure
- Searching Algorithms
- DSA - Searching Algorithms
- DSA - Linear Search Algorithm
- DSA - Binary Search Algorithm
- DSA - Interpolation Search
- DSA - Jump Search Algorithm
- DSA - Exponential Search
- DSA - Fibonacci Search
- DSA - Sublist Search
- DSA - Hash Table
- Sorting Algorithms
- DSA - Sorting Algorithms
- DSA - Bubble Sort Algorithm
- DSA - Insertion Sort Algorithm
- DSA - Selection Sort Algorithm
- DSA - Merge Sort Algorithm
- DSA - Shell Sort Algorithm
- DSA - Heap Sort Algorithm
- DSA - Bucket Sort Algorithm
- DSA - Counting Sort Algorithm
- DSA - Radix Sort Algorithm
- DSA - Quick Sort Algorithm
- Matrices Data Structure
- DSA - Matrices Data Structure
- DSA - Lup Decomposition In Matrices
- DSA - Lu Decomposition In Matrices
- Graph Data Structure
- DSA - Graph Data Structure
- DSA - Depth First Traversal
- DSA - Breadth First Traversal
- DSA - Spanning Tree
- DSA - Topological Sorting
- DSA - Strongly Connected Components
- DSA - Biconnected Components
- DSA - Augmenting Path
- DSA - Network Flow Problems
- DSA - Flow Networks In Data Structures
- DSA - Edmonds Blossom Algorithm
- DSA - Maxflow Mincut Theorem
- Tree Data Structure
- DSA - Tree Data Structure
- DSA - Tree Traversal
- DSA - Binary Search Tree
- DSA - AVL Tree
- DSA - Red Black Trees
- DSA - B Trees
- DSA - B+ Trees
- DSA - Splay Trees
- DSA - Range Queries
- DSA - Segment Trees
- DSA - Fenwick Tree
- DSA - Fusion Tree
- DSA - Hashed Array Tree
- DSA - K-Ary Tree
- DSA - Kd Trees
- DSA - Priority Search Tree Data Structure
- Recursion
- DSA - Recursion Algorithms
- DSA - Tower of Hanoi Using Recursion
- DSA - Fibonacci Series Using Recursion
- Divide and Conquer
- DSA - Divide and Conquer
- DSA - Max-Min Problem
- DSA - Strassen's Matrix Multiplication
- DSA - Karatsuba Algorithm
- Greedy Algorithms
- DSA - Greedy Algorithms
- DSA - Travelling Salesman Problem (Greedy Approach)
- DSA - Prim's Minimal Spanning Tree
- DSA - Kruskal's Minimal Spanning Tree
- DSA - Dijkstra's Shortest Path Algorithm
- DSA - Map Colouring Algorithm
- DSA - Fractional Knapsack Problem
- DSA - Job Sequencing with Deadline
- DSA - Optimal Merge Pattern Algorithm
- Dynamic Programming
- DSA - Dynamic Programming
- DSA - Matrix Chain Multiplication
- DSA - Floyd Warshall Algorithm
- DSA - 0-1 Knapsack Problem
- DSA - Longest Common Sub-sequence Algorithm
- DSA - Travelling Salesman Problem (Dynamic Approach)
- Hashing
- DSA - Hashing Data Structure
- DSA - Collision In Hashing
- Disjoint Set
- DSA - Disjoint Set
- DSA - Path Compression And Union By Rank
- Heap
- DSA - Heap Data Structure
- DSA - Binary Heap
- DSA - Binomial Heap
- DSA - Fibonacci Heap
- Tries Data Structure
- DSA - Tries
- DSA - Standard Tries
- DSA - Compressed Tries
- DSA - Suffix Tries
- Treaps
- DSA - Treaps Data Structure
- Bit Mask
- DSA - Bit Mask In Data Structures
- Bloom Filter
- DSA - Bloom Filter Data Structure
- Approximation Algorithms
- DSA - Approximation Algorithms
- DSA - Vertex Cover Algorithm
- DSA - Set Cover Problem
- DSA - Travelling Salesman Problem (Approximation Approach)
- Randomized Algorithms
- DSA - Randomized Algorithms
- DSA - Randomized Quick Sort Algorithm
- DSA - Karger’s Minimum Cut Algorithm
- DSA - Fisher-Yates Shuffle Algorithm
- Miscellaneous
- DSA - Infix to Postfix
- DSA - Bellmon Ford Shortest Path
- DSA - Maximum Bipartite Matching
- DSA Useful Resources
- DSA - Questions and Answers
- DSA - Selection Sort Interview Questions
- DSA - Merge Sort Interview Questions
- DSA - Insertion Sort Interview Questions
- DSA - Heap Sort Interview Questions
- DSA - Bubble Sort Interview Questions
- DSA - Bucket Sort Interview Questions
- DSA - Radix Sort Interview Questions
- DSA - Cycle Sort Interview Questions
- DSA - Quick Guide
- DSA - Useful Resources
- DSA - Discussion
Selection Sort Interview Questions and Answers
Selection Sort is a sorting technique that compares every array element to find the least element and shifts it into the first index. It repeats this process until the whole array is sorted. This set of questions will provide you with deep learning of Selection Sort. It covers the most important and asked interview questions and answers from basic to advanced level.

Selection Sort Interview Questions and Answers
Following are the top interview questions on Selection Sort:
1. What is the Selection Sort?
Selection Sort is used to select the lowest element from an unsorted array and swap it with the starting element of an array. By placing one element into its correct location, it completes the one pass. It will take a maximum of n-1 passes to sort the array.
2. What is the use of Selection Sort?
Selection Sort is used to divide the given array into two sections, which are a sorted subarray and an unsorted subarray. After that, it iterates the unsorted subarray to find the minimum element and swaps it with the first element in that unsorted section. It will continue this process until the entire array is sorted.
3. What is the time and space complexity of Selection Sort?
- Worst and average case: O(n) (It is slow for large datasets)
- Best case: O(n) (It is already sorted)
- Space complexity: O(1) (It doesn't need extra memory)
4. How is Selection Sort different from other sorting algorithms like Bubble Sort and Insertion Sort?
Feature | Selection Sort | Bubble Sort | Insertion Sort |
---|---|---|---|
Process | It searches for the smallest or largest element and swaps it with the first element of the array. | It swaps every adjacent element if they are out of order. | It places every element into its correct position in the sorted part. |
Complexity | It needs only O(n) even if sorted. | It takes O(n) in the worst case and O(n) in the best case. | It takes O(n) is the worst case, but O(n) is the best case. |
Swaps | It takes swaps up to O(n). | It takes swaps up to O(n). | It takes swaps up to O(n). But it is less than Bubble Sort. |
Stability | It is not stable | It is Stable | It is Stable |
In-place | It is an in-place algorithm | It is an in-place algorithm | It is an in-place algorithm |
5. Is Selection Sort stable or unstable?
Selection Sort is known as an unstable algorithm since it does not preserve the original order of equal elements.
6. Is Selection Sort Adaptive?
No, the Selection Sort is not adaptive because it fails to preserve the existing arrangement of elements in the array.
7. How does Selection Sort conduct duplicate elements in the array?
Selection Sort leaves the duplicate elements in the same position where it found them.
Selection Sort does not maintain the relative order of duplicate values. There are the possibilities of swapping the elements while sorting.
8. Is Selection Sort suitable for large sets of data?
Selection Sort is not suitable for large sets of data because it has O(N) time complexity, particularly when contrasted with more optimized algorithms such as Merge Sort or Quick Sort.
9. How is Selection Sort optimized?
One optimization that is possible is to minimize the number of swaps by doing them only when needed and not on each iteration.
10. Is Selection Sort possible recursively?
Yes, Selection Sort can be done recursively, but it's not usually done due to a function call overhead and the possibility of stack overflow with large lists.
11. Does Selection Sort perform well with almost sorted arrays?
No, Selection Sort is of constant behavior irrespective of the initial order of the elements and thus becomes less efficient for almost sorted arrays.
12. What is the best-case time complexity of Selection Sort?
The best-case time complexity of the Selection Sort is (N).
13. Can we use Selection Sort to sort linked lists?
Yes, Selection Sort can be used to sort linked lists by changing the pointers instead of swapping actual elements.
14. What is the process of maintaining the stability of Selection Sort?
Selection Sort is stable when we change the style of swapping the elements. Instead of swapping elements, we can shift elements and insert the minimum element in its correct position to keep the order of equal elements. For choosing the stable algorithm, we generally choose other sorting methods like Merge Sort and Insertion Sort.
15. Why is it called Selection Sort?
It's called Selection Sort because it selects the smallest element from the unsorted part and moves it to the correct position.
16. Is Selection Sort efficient?
No, It works fine for small lists but is too slow for large datasets.
17. What are the characteristics of Selection Sort?
- It is unstable and non-adaptive.
- It is in place and doesn't need extra space for the sorting process.
- It takes O(N) comparisons and O(N) swaps.
18. Can Selection Sort be improved?
We can make a small improvement in it by selecting both the smallest and largest elements at once. By doing this, the time complexity remains O(N), so it's still slow.
19. Is Selection Sort a greedy algorithm?
Yes, because it always picks the smallest or largest element in each step.
20. How many swaps happen in Selection Sort?
We can make maximum O(N) swaps in the worst case.
21. What is the biggest advantage of Selection Sort?
It's simple and takes fewer swaps, which is useful when swapping is costly.
22. What is the biggest drawback of Selection Sort?
It's too slow because its time complexity is O(N) and doesn't work well on nearly sorted data.
23. Can Selection Sort be used to sort strings?
Yes, we can use it with the strings by comparing them alphabetically, just like with numbers.
24. How does Selection Sort compare to Quick Sort?
Quick Sort is the faster on average datasets O(N log N), while Selection Sort is simpler but much slower for large datasets.
25. What does the outer loop do in Selection Sort?
The outer loop iterates through all the elements of an array. After that, it selects the smallest element and puts it in the correct place.