Tip 1 : solve maximum coding questions
Tip 2 : develop problem solving skills
Tip 3 : do some projects
Tip 1: don't put false things
Tip 2: keep ur resume short
This is my 1st round, it was held on 1st march 2023, and it was contain only basic coding questions and it seems for me easy.



If the given input string is "Welcome to Coding Ninjas", then you should return "Ninjas Coding to Welcome" as the reversed string has only a single space between two words and there is no leading or trailing space.
1. Create an empty string to hold the reversed string
2. Loop through the input string from the end to the beginning
3. For each character, append it to the empty string
4. Return the reversed string



Input: 'n' = 5, 'arr' = [1, 2, 3, 4, 5]
Output: 5
Explanation: From the array {1, 2, 3, 4, 5}, the largest element is 5.
1. Initialize a variable to hold the maximum element, set it to the first element in the array
2. Loop through the array starting at the second element
3. If the current element is greater than the maximum element, update the maximum element
4. Return the maximum element



Consider if ‘N’ = 4, the Factorial of 4 will be the product of all numbers from 1 to 4, which is 1 * 2 * 3 * 4 = 24. Hence, the answer is 24.
1. Initialize a variable to hold the factorial, set it to 1
2. Loop through the integers from 1 to the input number
3. Multiply the factorial by each integer in the loop
4. Return the factorial
This was my 2nd round, and it was also data structures and algorithms questions.




If we are given the above binary tree as input then moving from root node(5) to the farthest leaf node(50), the path formed will be [ 5->10->25->35->40->45->50 ]. The total number of nodes encountered is 7, therefore the maximum depth of the binary tree is 7.
1. Check if the root node is null, if so, return 0
2. Recursively find the maximum depth of the left subtree and right subtree
3. Return the maximum of the two depths plus one (to account for the root node)



F(n) = F(n-1) + F(n-2),
Where, F(1) = F(2) = 1.
For ‘N’ = 5, the output will be 5.
1. Create an array to hold the first two Fibonacci numbers (0 and 1)
2. Loop from 2 to n, adding the previous two Fibonacci numbers to get the current
3. Fibonacci number
Return the nth Fibonacci number
Create a class to represent a circle with a given radius, and calculate its circumference and area.
1. Create a Circle class with a radius instance variable
2. Define methods to set and get the radius
3. Define methods to calculate the circumference and area using the radius
Use the formula C = 2 * pi * r for circumference and A = pi * r * r for area
This was my 3rd round for me it's tough compare to others. This round contains problem from system design, DBMS, operating system
Design a URL shortening service.
1. Define the requirements and constraints of the service
2. Choose appropriate data storage and retrieval mechanisms
3. Implement a system to generate unique short URLs for long URLs, and to redirect users from short URLs to long URLs
Select all records from a table where a particular column value equals a given value.
1. Write an SQL query to select records from the table
2. Use a WHERE clause to filter records where the column value equals the given value
3. Execute the query
Implement a mutex lock using semaphores.
It was last round hr round.
What inspired you to become a developer?

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?