Oracle
Lava International Interview Questions and Answers
Q1. Find the highest element from a BST and implement insertion operation of BST.
To find the highest element in a BST, perform a right traversal until reaching the rightmost leaf node.
Perform a right traversal starting from the root node until reaching the rightmost leaf node to find the highest element.
Implement the insertion operation by comparing the value to be inserted with each node and traversing left or right accordingly.
Ensure that the BST property is maintained during insertion by placing smaller values to the left and larger values to the right...read more
Q2. How do you explain a C student to use Java
Explain the basics of Java in a simple and practical way, focusing on hands-on examples and real-world applications.
Start by explaining the basic syntax and structure of Java code
Use simple examples to demonstrate concepts like variables, loops, and functions
Show how Java is used in real-world applications, such as building websites or mobile apps
Q3. Permutation of the number without duplicates
Generate all permutations of a given number without duplicates
Use backtracking to generate all possible permutations
Avoid duplicates by keeping track of used digits
Recursively swap digits to generate permutations
Q4. Delete nth element from end in a LINKEDLIST.
To delete the nth element from the end in a LinkedList, we can use two pointers approach.
Use two pointers - one to traverse the list and another to keep track of the nth element from the end.
Calculate the distance between the two pointers and delete the node at the second pointer.
Q5. What is memory management
Memory management is the process of controlling and coordinating computer memory, assigning portions called blocks to various running programs.
Memory allocation - assigning memory blocks to programs as needed
Memory deallocation - releasing memory blocks when no longer needed
Memory fragmentation - the division of memory into small blocks leading to inefficient use
Memory leaks - when a program fails to release memory after use, causing memory to be unavailable for other program...read more
Q6. Heap Sort with Max Heap
Heap Sort is a comparison-based sorting algorithm that uses a binary heap data structure.
Heap Sort involves building a max heap from the input array, then repeatedly removing the maximum element and rebuilding the heap.
The time complexity of Heap Sort is O(n log n) in the worst case scenario.
Example: Given an array [4, 10, 3, 5, 1], after applying Heap Sort, the sorted array would be [1, 3, 4, 5, 10].
Q7. detect cycle in directed graph
Detect cycle in directed graph using depth-first search algorithm.
Use depth-first search (DFS) algorithm to traverse the graph.
Maintain a visited set to keep track of visited nodes.
If a node is visited again during traversal, there is a cycle in the graph.
Q8. Reverse a LinkedLis
To reverse a LinkedList, iterate through the list and change the direction of pointers.
Iterate through the LinkedList and keep track of the previous, current, and next nodes.
Update the pointers to reverse the direction of the nodes.
Repeat until the end of the list is reached.
More about working at Oracle
Interview Process at Lava International
Top Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month