
o9 Solutions


o9 Solutions Interview Questions and Answers for Freshers
Q1. Angle between hour hand and minute hand at 3:15
The angle between the hour hand and minute hand at 3:15 is 7.5 degrees.
At 3:00, the hour hand is at the 3 o'clock position, which is 90 degrees.
In 15 minutes, the minute hand moves 90 degrees (360 degrees divided by 4).
The hour hand also moves slightly in 15 minutes, covering 7.5 degrees (30 degrees divided by 4).
Therefore, the angle between the hour hand and minute hand at 3:15 is 7.5 degrees.
Q2. Factorial code using recursion
Factorial code using recursion
Recursion is a technique where a function calls itself
Factorial of a number is the product of all positive integers less than or equal to that number
To calculate factorial using recursion, the base case is when the number is 0 or 1
The recursive step is to call the factorial function with the number decremented by 1 and multiply it with the number itself
Q3. For what purpose trim used in sql?
Trim is used in SQL to remove leading and trailing spaces from a string.
Trim function is used to remove leading and trailing spaces from a string
It is commonly used to clean up data before performing comparisons or concatenations
Syntax: TRIM([LEADING | TRAILING | BOTH] [characters] FROM [string])
Example: SELECT TRIM(' hello ') as trimmed_string
Q4. Reverse the String Problem Statement
You are given a string STR
which contains alphabets, numbers, and special characters. Your task is to reverse the string.
Example:
Input:
STR = "abcde"
Output:
"edcba"
Input...read more
The task is to reverse a given string that may contain lowercase letters, uppercase letters, digits, and special characters.
Iterate through the string from the last character to the first character and append each character to a new string.
Alternatively, you can use built-in string reversal functions or methods available in your programming language.
To solve the follow-up question with O(1) space complexity, you can use a two-pointer approach. Swap the characters at the start...read more
Fetch data from two tables with a common column without using WHERE keyword.
Use JOIN keyword to combine the two tables based on the common column.
Specify the common column in the ON clause of the JOIN statement.
This will retrieve all the rows where the common column values match in both tables.
Q6. Factorial Calculation Problem Statement
Develop a program to compute the factorial of a given integer 'n'.
The factorial of a non-negative integer 'n', denoted as n!
, is the product of all positive integers les...read more
Develop a program to compute the factorial of a given integer 'n'.
Create a function to calculate factorial using a loop or recursion
Handle edge cases such as negative input or input exceeding constraints
Return 'Error' if factorial is undefined
Example: For input 5, output should be 120
Q7. Angle Calculation Between Clock Hands
Given a specific time in hours and minutes, your task is to calculate the smallest possible angle between the hour hand and the minute hand of a clock.
Example:
Input:
T = ...read more
Calculate the smallest angle between the hour and minute hands of a clock for a given time.
Calculate the angles of the hour and minute hands based on the input time.
Find the absolute difference between the angles of the hour and minute hands.
Return the smaller angle between the two possible angles.
Ensure to handle cases where the smaller angle is greater than 180 degrees.
SQL query to find and sort students with scores above a threshold
Use the SELECT statement to retrieve the required data
Use the WHERE clause to filter students with scores above the threshold
Use the ORDER BY clause to sort the results by score and then by name
Interview Process at o9 Solutions for Freshers

Top Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

