HackerRank Data Structures Quiz -1

Question 1

Time: 00:00:00
What is the worst case time complexity of mergesort?

O(n ^ 2)

O(n ^ 2)

O(nlogn)

O(nlogn)

O(n ^ 3)

O(n ^ 3)

O(n)

O(n)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
What is the output of the following code?

Will print odd numbers

Will print odd numbers

Will print squares of natural numbers

Will print squares of natural numbers

Will print Fibonacci series

Will print Fibonacci series

Will print even numbers

Will print even numbers

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
What will be the position of the array after 2 iterations of insertion sort?
arr - {5,4,3,2,1}

1 2 3 4 5

1 2 3 4 5

2 3 4 5 1

2 3 4 5 1

3 4 5 2 1

3 4 5 2 1

4 5 3 2 1

4 5 3 2 1

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
A linked list 1 -> 2 -> 3 > 4. What will be the position of the linked list after the head of the linked list is passed to the function?

Ques 4. Hackerrank Quiz-1 Data structures

1 3 2 4

1 3 2 4

1 2 3 4

1 2 3 4

4 3 2 1

4 3 2 1

4 2 3 1

4 2 3 1

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
The following elements are inserted in a set - {1,8,9,2,3,2,3,4,5}.
After adding the elements in the set, the size function is called. What is the output of the size function?

 

9

9

8

8

7

7

6

6

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
Quicksort is applied to an array. The position of the array after the iteration is - 4 1 5 10 9 8. Which of the following statements is true?

4 is the pivot

4 is the pivot

10 is the pivot

10 is the pivot

1 is the pivot

1 is the pivot

5 is the pivot

5 is the pivot

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
The following linked list is given - 1 -> 2 -> 3. The head is at 1. What is the output of the following code?

Data structures ques 7- hackeerrank (quiz-1)

'0'

'0'

Runtime Error

Runtime Error

NULL

NULL

Garbage Value

Garbage Value

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
What will be the position of the array after 2 iterations of bubble sort?
arr - {5,4,3,2,1}

1 2 3 4 5

1 2 3 4 5

4 3 2 1 5

4 3 2 1 5

3 2 1 4 5

3 2 1 4 5

2 1 3 4 5

2 1 3 4 5

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
Average Time Complexity of Quicksort with the first element as the pivot?

O(n ^ 2)

O(n ^ 2)

O(n)

O(n)

O(nlogn)

O(nlogn)

O(n ^ 2logn)

O(n ^ 2logn)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
What is the avg time complexity of Binary Search?

O(n)

O(n)

O(n ^ 2)

O(n ^ 2)

O(nlogn)

O(nlogn)

O(logn)

O(logn)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/10

Accuracy

0%

Prime

Prime Mock

Complete Mock Subscription for HackerRank

For HackerRank
Get Prime Mock
Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects

Comments