Only user-defined functions. No inbuilt functions at all.
No scanning for inputs, directly assign to vars.
Level 1: (2 hours – pen & paper)
1.Solve the equation X power Y with given values.
Example: Input: X=2, Y=-2 Output: 0.25
2.Find the distance between two given points and round it to the nearest number.
Example: Input: (2,4)(4,10) Output: 6
3.Count the numbers of characters in the given string treating ‘$’ as escape sequence. If ‘$’ is preceded by ”, consider it as normal ‘$’ and not the escape sequence. If ” occurs, treat it as single ”.
Example: Input: Hello$World$ Output: 11
4.Given a 2D matrix, find the sum of all the elements.
Example: Input: [1 2 3] [4 5 6] [7 8 9] Output: 45
Level 2:
Finish one question to get the next type. Total 5 questions. (3 hours – machine round)
1.Solve the equation (XpowerY/Z!) + (Z/(X!+Z)) with given values of X, Y, Z. X and Z cannot be negative.
Example: Input: X=2, Y=3, Z=4 Output: 1
2.Batman, Spiderman and Superman are going to start a business. The total investment is 1000M$. Anyone can add new investment to their existing investment. They can transfer investments between themselves. The program should be in OOP style and should have a menu for user to do all operations. (Something similar to below example.)
Constraints: a.Total investment should always be equal to or lesser than 1000M$. b.Spiderman's investment should never exceed Batman's. c.Investment cannot go into negative. d.Display investments on each update. Example: Input: batman = 300, spiderman = 250, superman = 100 Output: batman - 300 spiderman - 250 superman - 100 add 100 into spiderman sorry, spiderman cant have more investment than batman add 200 to batman batman - 500 spiderman - 250 superman - 100 add 500 to superman sorry, total investment cant exceed 1000.
I couldn’t get the 3rd question as I ran out of time. Need to complete 3 questions to qualify for next round.
If you like neveropen and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to review-team@geeksforgeeks.org. See your article appearing on the neveropen main page and help other Geeks.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!