# SP Contest 4

• Last Updated : 06 Sep, 2019

 Question 1
A is running @ 20 m / s on a circular track of 400 m and B is running on the same track @ 16 m / s in opposite direction. After 5 minutes from starting how many times they have crossed each other on starting point?
 A One time B Two times C Three times D Four times
SP Contest 4
Discuss it

Question 1 Explanation:
Meeting for the first time on a circular track = LCM (circumference / speed of A, circumference / speed of B ) = LCM( 400 / 20, 400 / 16) = LCM( 20, 25) = 100 sec. In 100 second they will meet for the first time on starting point. Similarly 2 time in 200 sec and after 300 sec(i.e. 5 minute) they had crossed each other on starting point 3 times. So, option (C) is correct.
 Question 2
There are m multiples of 6 in range [0, 100] and n multiples of 6 in [-6, 35]. Find out the value of X, if X = m - n. Where X, m, and n are positive integer.
 A 9 B 10 C 11 D 12
SP Contest 4
Discuss it

Question 2 Explanation:
There are 17 multiple of 6 in between 0 and 100. So, m = 17. There 7 multiple of 6 in between -6 and 35. So, n = 7. X = m - n = 17 - 7 = 10.
 Question 3
A card is drawn from a well shuffled deck of 52 cards. What is the probability of getting a jack of spade or a queen of heart? (Considering replacement)
 A 2 / 13 B 1 / 2 C 1 / 13 D 1 / 26
SP Contest 4
Discuss it

Question 3 Explanation:
Probability = favorable outcome / total outcome Total outcome = 52 Probability of getting a jack of spade = 1 / 52. Since, there is only one jack of spade. Similarly, probability of of getting a queen of heart = 1 / 52. Since, there is only one queen of heart. Probability of getting a jack of spade or a queen of heart = 1 / 52 + 1 / 52 = 2 / 52 = 1 / 26.
 Question 4
Default collision handling in hashing with chaining is done through singly linked lists. Which data structure can be used to improve the default collision handling where there are many collisions happening with some keys?
 A Doubly Linked Lists B Circular Linked Lists C Circular Doubly Linked List D Red Black Trees
SP Contest 4
Discuss it

Question 4 Explanation:
If chain becomes big, we end-up with linear time searching for node in chain. Red Black Trees can improve this time to O(Log n)
 Question 5
What is the corresponding time complexity for different operations like insert at head, insert at tail, delete tail, searching for an element on circular doubly linked list?
 A O(n), O(1), O(n), O(n) B O(1), O(1), O(1), O(n) C O(1), O(1), O(1), O(1) D None of the above
SP Contest 4
Discuss it

Question 5 Explanation:
 Question 6
Which node is at 6th position in level order traversal of a BST which is constructed using below keys in given order. Keys : 15, 10, 5, 25, 20, 22, 19, 18, 30
 A 20 B 30 C 19 D 22
SP Contest 4
Discuss it

Question 6 Explanation:
Level Order Traversal after constructing BST is as follows : 15, 10, 25, 5, 20, 30, 19, 22, 18. Where, 6th element is 30.
 Question 7
Maximum height of AVL tree with n nodes is closest to ?
 A log(n) B Catalan number C 1.44 * log(n) D log(n) + 1
SP Contest 4
Discuss it

Question 7 Explanation:
Refer : https://www.geeksforgeeks.org/practice-questions-height-balancedavl-tree/
 Question 8
What are the inorder successors of 8, 10 and 14?
 A 10, 12, 20 B 10, 14, 22 C 12, 12, 20 D 20, 12, 20
SP Contest 4
Discuss it

Question 8 Explanation:
Refer : https://www.geeksforgeeks.org/inorder-successor-in-binary-search-tree/
 Question 9
What should you strive for with reference to cohesion and coupling while designing software?
 A High Coupling with High Cohesion B Low coupling with Low Cohesion C High Cohesion with Low Coupling D Low Cohesion with High Coupling
SP Contest 4
Discuss it

Question 9 Explanation:
Coupling refers to the relationship of a module with another module. A module is said to be highly coupled with another module if changes to it will result to changes in other module. And a module is said to be loosely coupled if a module is independent of any other modules. Cohesion refers to the measure of how strongly-related the functions of a module are. Low cohesion refers to modules that have different unrelated responsibilities. High cohesion refers to modules that have functions that are similar in many aspects.
 Question 10
Which testing technique is used to test the robustness of the system by performing the test repetitively?
 A Integration Testing B Unit Testing C Gorilla Testing D Smoke Testing
SP Contest 4
Discuss it

Question 10 Explanation:
Gorilla Testing is the testing technique in which we test the system repetitively several times to test the robustness of the system.
There are 10 questions to complete.
My Personal Notes arrow_drop_up