Oracle
10+ Edra Labs Interview Questions and Answers
Q1. Puzzle: – Two persons X and Y are sitting side by side with a coin in each’s hand. The game is to simultaneously flip the coin till anyone wins. Player X will win if he gets a consecutive HEAD, TAIL however Y w...
read moreThe game is not fair.
Player X has a higher chance of winning as they only need to get a consecutive HEAD, TAIL.
Player Y needs to get a consecutive HEAD, HEAD which is less likely to occur.
The probability of Player X winning is higher than Player Y winning.
Q2. In a bag you have 20 black balls and 16 red balls.When you take out 2 black balls you take another white ball.If you take 2 white balls then you take out 1 black ball and if balls are of different color you tak...
read moreThe last ball that will be left is black.
When you take out 2 black balls, you take another white ball.
If you take 2 white balls, you take out 1 black ball.
If balls are of different color, you take out another black ball.
Since there are more black balls initially, the last ball will be black.
Q3. Design a website similar to bookmyshow.com for booking cinema tickets but it must be for a single location only which can have multiple theatres in it. In this he wanted me to design a basic rough GUI, relevant...
read moreDesign a website similar to bookmyshow.com for booking cinema tickets for a single location with multiple theatres.
Design a user-friendly GUI with options for advance booking, user login, user registration, movie rating, and saving card details.
Create relevant database tables to store information about movies, theatres, bookings, user details, and card details.
Link the GUI to the database to enable data flow and retrieval.
Implement features like advance booking, where users c...read more
Q4. Provided a string a character and a count, you have to print the string after the specified character has occurred count number of times. Ex: String: “This is demo string” Character: ‘i’ Count: 3 Output: “ng” H...
read moreThe program prints the substring after a specified character has occurred a certain number of times in a given string.
Iterate through the string to find the specified character.
Keep track of the count of occurrences of the character.
Once the count reaches the specified count, extract the substring after that position.
Handle corner cases such as when the character is not in the string or when it doesn't occur the specified number of times.
Q5. There are five glasses that are kept upside down.At a time you are bound to turn four glasses.Give minimum number of times in which you can turn back all the glasses so that now none among them are upside down
Minimum number of times to turn all glasses upside down when 4 can be turned at a time.
Turn over any four glasses, leaving one untouched.
Repeat the above step until only one glass is left upside down.
Finally, turn over the last glass to complete the task.
Minimum number of turns required is 3.
Q6. Code: – Given the value of a starting position and an ending position, you have to reach from start to end in a linear way, and you can move either to position immediate right to current position or two step ri...
read morePrint all possible paths from start to end in a linear way, moving either one or two steps right.
Use dynamic programming to solve the problem
Create a 2D array to store the number of paths to each position
Start from the end position and work backwards
At each position, calculate the number of paths by summing the number of paths from the next two positions
Print all the paths by backtracking from the start position
Q7. Write a code for inserting two numbers in a text file given n2>n1 and the next entry should not be overlapping like if first was 4,6 next can't be 5,7.the second n1 has to be greater than first n2
The code inserts two numbers in a text file, ensuring that the second number is greater than the first and there is no overlap between entries.
Read the existing entries from the text file
Check if the new numbers satisfy the conditions
If conditions are met, insert the new numbers into the file
Otherwise, display an error message
Q8. Write code to find the middle element of a linked list
Code to find the middle element of a linked list
Traverse the linked list with two pointers, one moving twice as fast as the other
When the fast pointer reaches the end, the slow pointer will be at the middle element
If the linked list has even number of elements, return the second middle element
Q9. Write a code to count the number of times '1' occurs from 1 to 999999
Code to count the number of times '1' occurs from 1 to 999999
Loop through all numbers from 1 to 999999
Convert each number to a string and count the number of '1's in it
Add the count to a running total
Return the total count
Q10. Given a matrix.Write a code to print the transpose of the matrix
The code prints the transpose of a given matrix.
Iterate through each row and column of the matrix.
Swap the elements at the current row and column with the elements at the current column and row.
Print the transposed matrix.
Q11. Puzzle: Gi1ven 4 coins, arrange then to make maximum numbers of triangle of the figure
Arrange 4 coins to make maximum number of triangles
Place 3 coins in a triangle formation and the fourth coin in the center to form 4 triangles
Place 2 coins on top of each other and the other 2 coins on either side to form 2 triangles
Place 2 coins in a line and the other 2 coins on either side to form 2 triangles
Q12. Puzzle: Given 10 coins, arrange them such that we get 4 different rows each containing 4 coins
Arrange 10 coins in 4 rows of 4 coins each.
Place 4 coins in a row and keep the remaining 6 aside.
Place 3 coins from the remaining 6 in the next row and keep the remaining 3 aside.
Place 2 coins from the remaining 3 in the third row and keep the remaining 1 aside.
Place the last coin in the fourth row along with the remaining 1 coin from step 3.
The final arrangement will have 4 rows with 4 coins each.
Q13. Explain multitasking and multiprogramming
Multitasking is the ability of an operating system to run multiple tasks concurrently while multiprogramming is the ability to run multiple programs concurrently.
Multitasking allows multiple tasks to run concurrently on a single processor system.
Multiprogramming allows multiple programs to run concurrently on a single processor system.
Multitasking is achieved through time-sharing, where the processor switches between tasks at a very high speed.
Multiprogramming is achieved thr...read more
Q14. Design circular doubly linked list with all operations.
Circular doubly linked list is a data structure where each node has a reference to both the next and previous nodes, forming a circular loop.
Create a Node class with data, next, and prev pointers
Implement operations like insert, delete, search, and display
Ensure the last node's next pointer points to the first node and the first node's prev pointer points to the last node
Q15. Different types of searching and sorting algo discussion.
Searching and sorting algorithms are essential in programming for efficiently organizing and retrieving data.
Searching algorithms: linear search, binary search, depth-first search, breadth-first search
Sorting algorithms: bubble sort, selection sort, insertion sort, merge sort, quick sort
Examples: Searching for a specific item in a list, sorting a list of numbers in ascending order
Q16. Largest element in window size K
Find the largest element in a window of size K in an array.
Iterate through the array and maintain a deque to store the indices of elements in decreasing order.
Remove indices from the front of the deque that are outside the current window.
The front of the deque will always have the index of the largest element in the current window.
Q17. Sql query using joins
SQL query using joins
Use JOIN keyword to combine rows from two or more tables based on a related column between them
Types of joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column
Q18. Design Tic Tac Toe
Design a Tic Tac Toe game
Create a 3x3 grid to represent the game board
Allow two players to take turns marking X and O on the grid
Check for win conditions after each move to determine the winner
Handle tie game if all spaces are filled without a winner
More about working at Oracle
Top HR Questions asked in Edra Labs
Interview Process at Edra Labs
Top Application Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month