Become a GOLD member of Deccansoft and get access to 40+ courses!!
NewBatches/Webinars
Packages
Gold Membership
Bestseller
Microsoft Azure Suite & Suite Plus
Power Platform Acadamy
New
Azure DevOps Expert & Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Courses
MS.NET Courses (Includes Live Project)
Complete C#, OOPs and Windows Programing
ASP.NET MVC Online Training
ASP.NET WebForms
ASP.NET Core
WCF incl. Web Services and Remoting
WPF incl. MVVM and Prism
LINQ and Entity Framework
Live Project Training for Developing Enterprise Application
Live Project using Ntier Arch (.NET5 + EF Core + Angular)
Microservices using .NET Core
Gold Membership
CareerStep IT Program
Client-side UI Technologies
Building Static Web Pages using HTML and CSS
JavaScript and HTML DOM
jQuery, AJAX and JSON
Building Interactive Web Pages using HTML5 and CSS3
BootStrap + Live Examples
AngularJS + Live Project
Angular + Typescript
ReactJS
KnockoutJS
Xamarin
SQL Server + MSBI
SQL Server 2017
Querying Data with Transact-SQL(70-761)
SQL Server Integration Service (SSIS)
SQL Server Reporting Service (SSRS)
SQL Service Analysis Service (SSAS)
Cloud Computing / Azure / AWS
AZ-900: Microsoft Azure Fundamentals
Azure Suite (AZ-104+AZ-204+AZ-305+ AZ-500)
AZ-104: Microsoft Azure Administrator
AZ-204: Developing Solutions for Microsoft Azure
AZ-305: Microsoft Azure Architect Technologies and Design
DP-203: Data Engineering on Microsoft Azure
Amazon Web Services (AWS)
DevOps Expert
AZ-400: Microsoft Azure DevOps
Docker by Sandeep Soni
Kubernetes by Sandeep Soni
Docker & Kubernetes by Rahul Rampurkar
IaC Using Terraform
Powershell
Microsoft Power Platform
Microsoft Power Platform
Data Analytics using PowerBI (DA-100)
Testing Tools
Manual Testing
Selenium Testing with Java(Live Training)
Others
Python Programming
C and Data Structure
Core Java
OOPs and C++
Advance Java
Complete Azure Training
Pricing
Videos
Testimonials
Azure Certification
Contact Us
Login
Login or Register
×
Sign In
Register
Forgot Password?
How did you find us
WhatsApp
YouTube
LinkedIn
Facebook
Telegram
Twitter
Google
Referred by Friend
Refresh
Input symbols
By clicking Register, you accept to the
terms and conditions
and that you have read our
privacy policy.
Recover Password
×
Submit
Enquiry Now
Where did you come to know about us
WhatsApp
YouTube
LinkedIn
Facebook
LinkedIn Ad
Email
Twitter
Google
Referred
Other
Refresh
Input symbols
Searching and Sorting
Interview Questions and Answer
1. What is the Worst-case time for serial search finding a single item in an array?
Options:
a. Constant time
b. Quadratic time
c. Logarithmic time
d. Linear time
Reveal Answer
2. What is the worst-case time for binary search finding a single item in an array?
Options:
a. Constant time
b. Quadratic time
c. Logarithmic times
d. Linear time
Reveal Answer
3. What additional requirement is placed on an array, so that binary search may be used to locate an entry?
Options:
a. The array elements must form a heap.
b. The array must have at least 2 entries
c. The array must be stored
d. The array’s size must be a power of two.
Reveal Answer
4. Which searching can be performed recursively?
Options:
a. Linear Search
b. Binary Search
c. Both
d. None
Reveal Answer
5. Which searching can be performed iteratively?
Options:
a. Linear Search
b. Binary Search
c. Both
d. None
Reveal Answer
6. In a selection sort of n element, how many times is the swap function called in the complete execution of the algorithms?
Options:
a. 1
b. n2
c. n-1
d. logn
Reveal Answer
7. Selection sort and quick sort fall into the same category of sorting algorithms. What is the category?
Options:
a. O(n log n)sorts
b. Interchange Sorts
c. Divide-and-conquer sorts
d. Average time is quadratic
Reveal Answer
8. Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again)?
Options:
a. 21
b. 41
c. 42
d. 43
Reveal Answer
9. When is insertion sort a good choice for sorting an array?
Options:
a. Each component of the array requires a large amount of memory
b. The array has only a few items out of place
c. Each component of the array requires a small amount of memory
d. The processor speed is fast
Reveal Answer
10. What is the worst case time for quick sort to sort an array of n elements?
Options:
a. O(log n)
b. O(n)
c. O(n log n)
d. O(n2)
Reveal Answer
11. Suppose we are sorting an array of eight integers using quick sort, and we have just finished the first partitioning with an array looking like this: 2 5 1 7 9 12 11 10 which statement is correct?
Options:
a. The pivot could be either the 7 or the 9
b. The pivot is not the 7,but it could be the 9
c. The pivot could be the 7,but it is not the 9
d. Neither the 7 nor the 9 is the pivot
Reveal Answer
12. What is the worst case time for heap sort to sort an array of n elements?
Options:
a. O(log n)
b. O(n)
c. O(n log n)
d. O(n2)
Reveal Answer
13. Suppose we are sorting an array of eight integers using heap sort, and we have just finished one of the reheapifications downward. The array now look like this: 6 4 5 1 2 7 8
Options:
a. 1
b. 2
c. 3 or 4
d. 5 or 6
Reveal Answer
14. Time complexity of inserting an element to heap of n elements is of the order of
Options:
a. Log2 n
b. n2
c. n log2n
d. n
Reveal Answer
15. A min heap is the tree structure where smallest element is available at the
Options:
a. Leaf
b. Root
c. Intermediate parent
d. Any where
Reveal Answer
16. In the quick sort method, a desirable choice for the portioning element will be
Options:
a. First element of list
b. Last element of list
c. Median of list
d. Any element of list
Reveal Answer
17. Quick sort is also known as
Options:
a. Merge sort
b. Bubble sort
c. Heap sort
d. None
Reveal Answer
18. Which design algorithm techniques is used for quick sort
Options:
a. Divide and Conqueror
b. Greedy
c. Backtrack
d. Dynamic programming
Reveal Answer
19. Which among the following is fastest sorting technique(for unordered data)
Options:
a. Heap sort
b. Selection sort
c. Quick Sort
d. Bubble Sort
Reveal Answer
20. In which searching technique elements are eliminated by half in each pass
Options:
a. Linear Search
b. Both
c. Binary Search
d. None
Reveal Answer
21. Running time of heap sort algorithm is…………..
Options:
a. O(log2 n)
b. O(n log2 n)
c. O(n)
d. O(n2)
Reveal Answer
22. Running time of Bubble sort algorithm is…………….
Options:
a. O(log2 n)
b. O(n log2 n)
c. O(n)
d. O(n2)
Reveal Answer
23. Running time of selection sort algorithm is….
Options:
a. O(log2 n)
b. O(n log2 n)
c. O(n)
d. O(n2)
Reveal Answer
24. The Max heap constructed from the list of numbers 30,10,80,60,15,55 is
Options:
a. 60,80,55,30,10,15
b. 80,55,60,15,10,30
c. 80,60,55,30,10,15
d. None
Reveal Answer
25. The number of swapping needed to sort the numbers 8,22,7,9,31,19,5,13 is ascending order using bubble sort is
Options:
a. 11
b. 12
c. 13
d. 14
Reveal Answer
26. Time complexity of insertion sort algorithm in best case is
Options:
a. O(log2 n)
b. O(n log2 n)
c. O(n)
d. O(n2)
Reveal Answer
27. Binary Search algorithm performs efficiently on a
Options:
a. Linked list
b. Array
c. Both
d. None
Reveal Answer
28. Which is stable sort?
Options:
a. Bubble sort
b. Selection sort
c. Quick sort
d. None
Reveal Answer
29. Heap is a good data structure to implement
Options:
a. Priority Queue
b. Deque
c. Linear Queue
d. None
Reveal Answer
30. Always Heap is a
Options:
a. Complete binary tree
b. Binary Search Tree
c. Full Binary Tree
d. None
Reveal Answer
Packages
Gold Membership
Microsoft Azure Suite &Suite Plus
Azure DevOps Expert &Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Resources
Blog
Deccansoft
AzureA2Z
Wall of Fame
On-Job Tech Support
About
About BestDotNetTraining
About Trainer
Testimonials
FAQ
Other links
About Us
Contact Us
Leave us a feedback
Sitemap
Privacy Policy
Terms & Conditions
Proudly Powered by