Add office photos
Engaged Employer

Oracle

3.7
based on 5k Reviews
Filter interviews by

90+ 12th Wonder Research Interview Questions and Answers

Updated 19 Sep 2024
Popular Designations
Q1. Minimum Cost to Connect All Points

You are given an array, ‘COORDINATES’ that represents the integer coordinates of some points on a 2D plane. Your task is to find the minimum cost to make all the points connect...read more

View 3 more answers
Q2. Delete Kth node From End

You have been given a singly Linked List of 'N' nodes with integer data and an integer 'K'. Your task is to remove the Kth node from the end of the given Linked List.

For example:
The gi...read more
View 4 more answers
Q3. Partition Equal Subset Sum

You are given an array 'ARR' of 'N' positive integers. Your task is to find if we can partition the given array into two subsets such that the sum of elements in both subsets is equal....read more

View 5 more answers
Q4. Count Subsequences

You have been given an integer array/list 'ARR' of size 'N'. Your task is to return the total number of those subsequences of the array in which all the elements are equal.

A subsequence of a ...read more

View 3 more answers
Discover 12th Wonder Research interview dos and don'ts from real experiences
Q5. Count Inversions

For a given integer array/list 'ARR' of size 'N', find the total number of 'Inversions' that may exist.

An inversion is defined for a pair of integers in the array/list when the following two co...read more

View 4 more answers

Q6. 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 more
Ans.

The 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.

Add your answer
Are these interview questions helpful?
Q7. Valid Parentheses

You're given string ‘STR’ consisting solely of “{“, “}”, “(“, “)”, “[“ and “]” . Determine whether the parentheses are balanced.

Input Format:
The first line contains an Integer 'T' which denot...read more
View 2 more answers
Q8. Puzzle

A lady has 10 bags full of coins. Each bag contains 1000 coins. But one bag is full of forgeries, and she just can’t recall which one. She does know that genuine coins weigh 1 gram, but forgeries weigh 1....read more

Add your answer
Share interview questions and help millions of jobseekers 🌟
Q9. Transpose of a Matrix

You are given a matrix ‘MAT’. Print the transpose of the matrix. The transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of a matrix...read more

View 2 more answers
Q10. Merge K Sorted Arrays

You have been given ‘K’ different arrays/lists, which are sorted individually (in ascending order). You need to merge all the given arrays/list such that the output array/list should be sor...read more

View 4 more answers

Q11. 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 more
Ans.

The 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.

Add your answer
Q12. Palindromic Substrings

You are given a string ‘S’. Your task is to return all distinct palindromic substrings of the given string in alphabetical order.

A string is said to be palindrome if the reverse of the st...read more

View 2 more answers
Q13. Merge Two Sorted Linked Lists

You are given two sorted linked lists. You have to merge them to produce a combined sorted linked list. You need to return the head of the final linked list.

Note:

The given linked ...read more
View 3 more answers
Q14. Middle Of Linked List

Given the head node of the singly linked list, return a pointer pointing to the middle of the linked list.

If there are an odd number of elements, return the middle element if there are eve...read more

View 3 more answers
Q15. Greatest Common Divisor

You are given two numbers, ‘X’ and ‘Y’. Your task is to find the greatest common divisor of the given two numbers.

The Greatest Common Divisor of any two integers is the largest number th...read more

View 3 more answers
Q16. LCA Of Binary Tree

You have been given a Binary Tree of distinct integers and two nodes ‘X’ and ‘Y’. You are supposed to return the LCA (Lowest Common Ancestor) of ‘X’ and ‘Y’.

The LCA of ‘X’ and ‘Y’ in the bina...read more

View 3 more answers
Q17. Heap Sort

You are given an array ‘ARR’ consisting of 'N' integers, and your task is to sort the given array in non-decreasing order using the Heap sort algorithm.

Input Format:
The first line of the input contai...read more
View 2 more answers
Q18. Search In A Row Wise And Column Wise Sorted Matrix

You are given an N * N matrix of integers where each row and each column is sorted in increasing order. You are given a target integer 'X'. Find the position of...read more

View 4 more answers
Q19. Find all occurrences

You are given a 'M' x 'N' matrix of characters, 'CHARACTER_MATRIX' and a string 'WORD'. Your task is to find and print all occurrences of the string in the given character matrix. You are al...read more

View 2 more answers
Q20. Construct Tree From Preorder Traversal

Given an array ‘pre[]’ of ‘n’ elements that represent Preorder traversal of a spacial binary tree where every node has either 0 or 2 children. Also Given a boolean array ‘i...read more

View 3 more answers
Q21. Anagram Pairs

Pre-requisites: Anagrams are defined as words or names that can be formed by rearranging letters of another word. Such as "spar" can be formed by rearranging letters of "rasp". Hence, "spar" and "r...read more

View 3 more answers
Q22. Infix To Postfix

You are given a string EXP which is a valid infix expression. Convert the given infix expression to postfix expression.

Infix expression is of the form a op b. Where operator is is between the o...read more

View 2 more answers
Q23. Largest subarray with equal number of 0s and 1s

You are given an array consisting of 0s and 1s. You need to find the length of the largest subarray with an equal number of 0s and 1s.

For example:

If the given ar...read more
View 4 more answers

Q24. 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 more
Ans.

Design 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

Add your answer

Q25. 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 more
Ans.

The 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.

Add your answer

Q26. There N rooms in a hotel so customers will check-in and check-out a rooms simultaneously so which type of data structure you implement and it should be efficient and extension of this prebooking will also happe...

read more
Ans.

To efficiently manage room bookings and prebookings in a hotel, a priority queue data structure can be implemented.

  • A priority queue can be used to prioritize room bookings based on check-in dates.

  • When a customer checks out, the room becomes available and can be assigned to the next customer in the priority queue.

  • Prebookings can be stored separately and checked against the availability of rooms before assigning them to customers.

  • The priority queue can be implemented using a bi...read more

Add your answer

Q27. 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

Ans.

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.

Add your answer
Q28. Puzzle

There are n glasses on the table, all standing upside down. In one move, you are allowed to turn over exactly n – 1 of them. Determine all values of n for which all the glasses can be turned up in the min...read more

Add your answer

Q29. There are 25 horses in which you need to find out the fastest 3 horses. you can conduct a race among at most 5 horses to find out relative speed. At no point, you can find out the actual speed of the horse in a...

read more
Ans.

Minimum 7 races required to find the top 3 fastest horses.

  • Divide the 25 horses into 5 groups of 5 horses each.

  • Conduct a race among the horses in each group to determine the fastest horse in each group.

  • Take the top 2 horses from each group and conduct a race among them to determine the fastest horse overall.

  • The winner of this race is the fastest horse.

  • Now, take the second-place horse from the final race and the second-place horse from each group race.

  • Conduct a race among these...read more

Add your answer

Q30. There are 25 horses and only 5 horses can be raced at a time and the top 3 are announced in each such race. What is the minimum number of races required to find the top 3 among 25 horses

Ans.

The minimum number of races required to find the top 3 among 25 horses is 7.

  • Divide the 25 horses into 5 groups of 5 horses each.

  • Race the 5 groups, which will give us the top 3 horses from each group.

  • Now we have 15 horses remaining.

  • Race the top 3 horses from each group, which will give us the top 3 horses overall.

  • This requires a total of 7 races.

Add your answer

Q31. 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 more
Ans.

Print 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

Add your answer
Q32. Puzzle

You have 10 coins….arrange them in 4 straight lines such that each line contains 4 coins, without picking up the pencil.

Add your answer
Q33. Java Question

Why Java is platform independent and JVM platform dependent?

Add your answer
Q34. SQL Question

Write a query that joins two tables A and B having common attribute ID and selects records(ID_NAME) that have matching ID values in both tables .

Add your answer

Q35. What are abstract classes in Java and what is the difference between an abstract class and an interface

Ans.

Abstract classes in Java are classes that cannot be instantiated and are used as blueprints for other classes.

  • Abstract classes cannot be instantiated, meaning you cannot create objects of an abstract class.

  • Abstract classes can have both abstract and non-abstract methods.

  • Interfaces in Java are similar to abstract classes, but they cannot have any method implementations.

  • A class can implement multiple interfaces, but it can only extend one abstract class.

  • Abstract classes can hav...read more

Add your answer
Q36. DBMS Question

What is the difference between Clustered and Non-clustered index?

Add your answer

Q37. 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

Ans.

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

Add your answer
Q38. OOPS Question

What do you mean by virtual functions in C++?

Add your answer
Q39. OS Question

What is the major difference b/w 32-bit and 64-bit processors?

Add your answer
Q40. OS Question

What are the differences b/w Mutex and Semaphore?

Add your answer
Q41. OOPS Question

What is the difference b/w Abstract Class and Interface in Java?

Add your answer
Q42. DBMS Question

What is the main difference between UNION and UNION ALL?

Add your answer

Q43. What is overloading and what is overriding. Explain each with example

Ans.

Overloading is when multiple methods have the same name but different parameters. Overriding is when a subclass provides a different implementation of a method inherited from its superclass.

  • Overloading allows a class to have multiple methods with the same name but different parameters.

  • Overriding occurs when a subclass provides a different implementation of a method inherited from its superclass.

  • Overloading is resolved at compile-time based on the method signature.

  • Overriding i...read more

Add your answer
Q44. DBMS Question

Explain different types of Normalization forms in a DBMS.

Add your answer

Q45. How is undo operation (ctrl + z) implemented internally?

Ans.

Undo operation (ctrl + z) is implemented by maintaining a stack of previous states.

  • When a change is made, the current state is pushed onto the stack

  • When undo is called, the top state is popped and applied

  • Redo is implemented by maintaining a stack of undone states

  • Some applications may also implement a limit on the number of undo/redo steps

  • Undo/redo can be implemented at different levels (e.g. character, word, paragraph)

Add your answer

Q46. How do you measure 4 liters with a 5 liters and 3 liters container

Ans.

You can measure 4 liters by following these steps:

  • Fill the 5 liters container completely

  • Pour the 5 liters into the 3 liters container, leaving 2 liters in the 5 liters container

  • Empty the 3 liters container

  • Pour the remaining 2 liters from the 5 liters container into the 3 liters container

  • Fill the 5 liters container again

  • Pour 1 liter from the 5 liters container into the 3 liters container, which now has 3 liters

  • The 5 liters container now has 4 liters

Add your answer

Q47. to explain algorithm of the project that I’m going to do in the upcoming semester and asked me code it

Ans.

The algorithm for the upcoming semester project involves developing an application.

  • Identify the requirements and objectives of the project

  • Design the application architecture and user interface

  • Implement the necessary algorithms and data structures

  • Test and debug the application

  • Optimize the performance and efficiency of the code

  • Document the project for future reference

Add your answer

Q48. Write code to find the middle element of a linked list

Ans.

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

Add your answer

Q49. Write a code to count the number of times '1' occurs from 1 to 999999

Ans.

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

Add your answer

Q50. Given a matrix.Write a code to print the transpose of the matrix

Ans.

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.

Add your answer
Q51. DBMS Question

Given an Employee Table, find the Nth highest salary from it.

Add your answer
Q52. DBMS Question

What are Constraints in SQL?

Add your answer
Q53. SQL Question

Given an Employee Table, find the Nth highest salary from it.

Add your answer

Q54. Find the common ancestor of two given nodes in a tree

Ans.

Find the common ancestor of two given nodes in a tree

  • Traverse the tree from the root node

  • Check if both nodes are on the same side of the current node

  • If not, return the current node as the common ancestor

  • If yes, continue traversing down that side of the tree

Add your answer
Q55. DBMS Question

Explain the difference between the DELETE and TRUNCATE command in a DBMS.

Add your answer

Q56. What is time complexity of 8 queens algorithm

Ans.

The time complexity of 8 queens algorithm is O(n!).

  • The algorithm checks all possible permutations of the queens on the board.

  • The number of permutations is n! where n is the number of queens.

  • For 8 queens, there are 8! = 40,320 possible permutations.

  • The algorithm has to check each permutation to find a valid solution.

  • Therefore, the time complexity is O(n!).

Add your answer

Q57. Puzzle: Gi1ven 4 coins, arrange then to make maximum numbers of triangle of the figure

Ans.

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

Add your answer

Q58. What is your favorite program and why is it so

Ans.

My favorite program is Visual Studio Code because of its user-friendly interface and extensive plugin library.

  • User-friendly interface with customizable settings

  • Extensive plugin library for various programming languages and tools

  • Integrated terminal and debugging features

  • Supports Git version control

  • Frequent updates and improvements

  • Free and open-source

  • Examples: Python, JavaScript, HTML/CSS, Git

Add your answer

Q59. Puzzle: Given 10 coins, arrange them such that we get 4 different rows each containing 4 coins

Ans.

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.

Add your answer
Q60. OOPS Question

Explain Method Overloading and Method Overriding.

Add your answer

Q61. Programs like count the frequency of every alphabet in a string

Ans.

Count the frequency of each alphabet in a string.

  • Iterate through the string and count the occurrence of each alphabet using a dictionary or array.

  • Convert the string to lowercase or uppercase to avoid case sensitivity.

  • Exclude non-alphabetic characters using regular expressions.

  • Consider using built-in functions or libraries for efficiency.

  • Handle edge cases such as empty strings or strings with no alphabetic characters.

Add your answer
Q62. OS Question

Explain multitasking and multiprogramming.

Add your answer

Q63. Find the number of palindromes in a big string

Ans.

Count the number of palindromes in a given string.

  • A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward.

  • Iterate through the string and check if each substring is a palindrome.

  • Use two pointers, one at the beginning and one at the end of the substring, and move them towards each other until they meet in the middle.

  • If the substring is a palindrome, increment the count.

  • Consider both even and odd length palindromes.

Add your answer

Q64. Find the fifth largest element in a linked list

Ans.

Find the fifth largest element in a linked list

  • Traverse the linked list and store the elements in an array

  • Sort the array in descending order

  • Return the fifth element in the sorted array

Add your answer

Q65. Explain multitasking and multiprogramming

Ans.

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

Add your answer

Q66. Find the maximum salary in emp table

Ans.

To find the maximum salary in emp table, use the MAX function on the salary column.

  • Use the MAX function in SQL to find the highest value in a column

  • Specify the column name after the MAX function, in this case 'salary'

  • Example: SELECT MAX(salary) FROM emp

  • This will return the highest salary value in the emp table

Add your answer

Q67. What are ER diagrams for?

Ans.

ER diagrams are used to visualize and design relational databases.

  • ER diagrams show the relationships between entities in a database

  • They help in identifying the attributes of each entity

  • They aid in designing the structure of a database

  • ER diagrams are commonly used in software development

Add your answer

Q68. Design circular doubly linked list with all operations.

Ans.

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

Add your answer

Q69. Different types of searching and sorting algo discussion.

Ans.

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

Add your answer

Q70. Write code for Towers of Hanoi problem

Ans.

Towers of Hanoi is a classic problem of moving disks from one peg to another with specific rules.

  • The problem involves three pegs and a number of disks of different sizes.

  • The goal is to move all the disks from the first peg to the third peg, while following the rules.

  • The rules are: only one disk can be moved at a time, a larger disk cannot be placed on top of a smaller disk, and all disks must be moved to the third peg.

  • The solution can be implemented recursively.

  • Example code: ...read more

Add your answer

Q71. Explain three normalizations with example

Ans.

Explanation of three normalizations with examples

  • First Normal Form (1NF): Eliminate duplicate data and create separate tables for related data

  • Example: A table with customer information and their orders should be split into two tables

  • Second Normal Form (2NF): Ensure non-key attributes are dependent on the primary key

  • Example: A table with customer information and their orders should have separate tables for customer and order details

  • Third Normal Form (3NF): Eliminate transitive...read more

Add your answer

Q72. Find the duplicates in an array

Ans.

Find duplicates in an array

  • Iterate through the array and compare each element with the rest of the elements

  • Use a hash table to keep track of the frequency of each element

  • Sort the array and compare adjacent elements

  • Use a set to keep track of unique elements and add duplicates to another set

Add your answer

Q73. Difference between semaphore and mutex

Ans.

Semaphore allows multiple threads to access shared resources at the same time, while mutex allows only one thread at a time.

  • Semaphore is used to control access to a resource with limited capacity, like a printer or database connection pool.

  • Mutex is used to protect a shared resource from simultaneous access, like a critical section of code.

  • Semaphore can have a count greater than 1, allowing multiple threads to access the resource simultaneously.

  • Mutex has a binary state, either...read more

Add your answer

Q74. Implement queue using linked lists

Ans.

Implementing queue using linked lists

  • Create a Node class with data and next pointer

  • Create a Queue class with head and tail pointers

  • Enqueue by adding a new node at the tail and dequeue by removing the head node

  • Check for empty queue by checking if head is null

Add your answer

Q75. minimum area of square that contains all the points

Ans.

The minimum area of a square that contains all given points is the square of the maximum distance between any two points.

  • Calculate the distance between all pairs of points

  • Find the maximum distance

  • Square the maximum distance to get the minimum area of the square

Add your answer

Q76. design hashmap from scratch

Ans.

Designing a hashmap from scratch

  • A hashmap is a data structure that allows for efficient key-value pair storage and retrieval

  • It typically uses an array and a hashing function to map keys to array indices

  • Collision handling techniques like chaining or open addressing may be used

  • Operations like insert, delete, and search can be implemented using the hashmap

  • Example: Designing a hashmap to store student records with their roll numbers as keys

Add your answer

Q77. Largest element in window size K

Ans.

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.

Add your answer

Q78. Merge two sorted linked lists

Ans.

Merge two sorted linked lists

  • Create a new linked list to store the merged list

  • Compare the first nodes of both lists and add the smaller one to the new list

  • Move the pointer of the added node to the next node

  • Repeat until one of the lists is empty, then add the remaining nodes to the new list

Add your answer

Q79. Explain 8 queens algorithm

Ans.

8 Queens Algorithm is a backtracking algorithm to place 8 queens on a chessboard without attacking each other.

  • The algorithm places one queen in each column, starting from the leftmost column.

  • If a queen can be placed in a row without attacking another queen, it is placed there.

  • If no such row exists, the algorithm backtracks to the previous column and tries a different row.

  • The algorithm continues until all 8 queens are placed on the board without attacking each other.

  • The algori...read more

Add your answer

Q80. Explain interfaces in Java

Ans.

Interfaces in Java define a contract for classes to implement certain methods.

  • Interfaces are like a blueprint for classes to follow

  • They can contain method signatures but no implementation

  • Classes can implement multiple interfaces

  • Interfaces can extend other interfaces

  • Example: Comparable interface for sorting objects

Add your answer

Q81. Maximum length of subarray of given sum

Ans.

Find the maximum length of a subarray with a given sum in an array.

  • Use a hashmap to store the running sum and its corresponding index.

  • Iterate through the array and update the hashmap with the running sum.

  • Check if the difference between the current sum and the target sum exists in the hashmap to find the subarray length.

Add your answer

Q82. Traversing singly linked list

Ans.

Traversing a singly linked list involves iterating through each node starting from the head node.

  • Start at the head node

  • Iterate through each node by following the 'next' pointer

  • Stop when reaching the end of the list (next pointer is null)

Add your answer

Q83. Explain heap sort

Ans.

Heap sort is a comparison-based sorting algorithm that uses a binary heap data structure.

  • It divides the input into a sorted and an unsorted region.

  • It repeatedly extracts the largest element from the unsorted region and inserts it into the sorted region.

  • It has a worst-case and average-case time complexity of O(n log n).

Add your answer

Q84. Reverse a string

Ans.

Reverse a string

  • Use a loop to iterate through the string and append each character to a new string in reverse order

  • Alternatively, use the built-in reverse() method for strings in some programming languages

Add your answer

Q85. sum 2 linkedlists in efficient way

Ans.

Use iterative approach to traverse both linked lists and sum corresponding nodes while keeping track of carry.

  • Iterate through both linked lists simultaneously

  • Sum corresponding nodes and carry from previous sum

  • Create a new linked list to store the sum

Add your answer

Q86. Hotel booking system design

Ans.

Design a hotel booking system.

  • Create a database to store hotel information, room availability, and bookings.

  • Develop a user interface for customers to search and book hotels.

  • Implement a payment gateway for secure transactions.

  • Include features like room selection, date selection, and guest information.

  • Consider implementing a rating and review system for hotels.

  • Ensure the system can handle concurrent bookings and prevent double bookings.

Add your answer

Q87. Sql query using joins

Ans.

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

Add your answer

Q88. Merge two sorted arrays

Ans.

Merge two sorted arrays into a single sorted array

  • Create a new array to store the merged result

  • Use two pointers to iterate through both arrays and compare elements

  • Add the smaller element to the new array and move the pointer for that array

Add your answer

Q89. Shallow copy vs Deep copy

Ans.

Shallow copy only copies the references of objects, while deep copy creates new copies of objects.

  • Shallow copy creates a new object but does not create copies of nested objects.

  • Deep copy creates new copies of all nested objects.

  • Shallow copy is faster and more memory efficient, but changes to nested objects affect both copies.

  • Deep copy is slower and uses more memory, but changes to nested objects do not affect the original object.

Add your answer

Q90. Design Tic Tac Toe

Ans.

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

Add your answer

Q91. Find area using co ordinates

Ans.

Calculate the area of a shape using coordinates

  • Determine the type of shape (e.g. rectangle, triangle, circle)

  • Use the appropriate formula for the shape to calculate the area

  • Input the coordinates into the formula to get the area

Add your answer

Q92. Intersection of linked list

Ans.

Intersection of linked list is finding the common node where two linked lists merge.

  • Traverse both linked lists to find their lengths

  • Align the longer list's pointer to match the length of the shorter list

  • Iterate through both lists simultaneously to find the intersection node

Add your answer

More about working at Oracle

#22 Best Mega Company - 2022
#3 Best Internet/Product Company - 2022
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at 12th Wonder Research

based on 14 interviews in the last 1 year
2 Interview rounds
Coding Test Round
Technical Round
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Application Developer Interview Questions from Similar Companies

3.9
 • 212 Interview Questions
4.1
 • 43 Interview Questions
3.7
 • 28 Interview Questions
3.8
 • 27 Interview Questions
3.9
 • 14 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter