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.
Learn to code easily with our course
Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated :
18 Oct, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...