Oracle
50+ Interview Questions and Answers
You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K.
An array is said to have a...read more
Given a number N, find its square root. You need to find and print only the integral part of square root of N.
For eg. if number given is 18, answer is 4.
Input format :
Integer N
Output ...read more
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
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
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
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
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
Given a string “STR”, you need to remove spaces from the string “STR” and rewrite in the Pascal case. Your task is to return the string “STR”.
In the Pascal case writing style we ...read more
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
Given a binary tree having a positive integer written on each of its nodes. Your task is to find the vertical sum of node values i.e. the sum of nodes that can be connected by a ver...read more
For a given binary tree, convert it to its sum tree. That is, replace every node data with sum of its immediate children, keeping leaf nodes 0. Finally, return its preorder.
For example:
The input for t...read more
You are given a square matrix of non-negative integers of size 'N x N'. Your task is to rotate that array by 90 degrees in an anti-clockwise direction without using any extra spac...read more
You are given a graph with 'N' vertices numbered from '1' to 'N' and 'M' edges. You have to colour this graph in two different colours, say blue and red such that no two vertices connected by an...read more
Given an integer number ‘num’. Your task is to convert ‘num’ into a word.
Suppose the given number ‘num’ is ‘9823’ then you have to return a string “nine thousand eight hundred tw...read more
Q15. Spring Collections Difference between list and set What is sorted mean in hashed set java Serialization Exceptions How can you give an exception to caller method Unix- how to move a folder without giving yes/no...
read moreInterview questions for Software Developer related to Spring, Collections, Serialization, Exceptions, Unix, Annotations, Json, Build tools, Restful services, and more.
List and Set are both collection interfaces in Java. List allows duplicates and maintains insertion order while Set doesn't allow duplicates and doesn't maintain any order.
Sorted in Hashed Set means that the elements are stored in a sorted order based on their hash code.
Serialization is the process of converting...read more
Let's say I give you a number 1,53,345 (I don't remember exactly). Write a program that will take the above number as input array and give output as "One Lakh Fifty-Three Thousand Three Hundre...read more
What is a virtual function? Give an example.
What is encapsulation? What is polymorphism?
SQL query - Top 2 users in a table - do it using subquery, views, and joins.
SQL query - Nested query using joins.
Q19. What is rotational shifts. What is web service flow. How will you check ports on Unix or Solaris machine.
Rotational shifts refer to working in different shifts at different times. Web service flow is the sequence of steps involved in a web service request. Checking ports on Unix or Solaris machine involves using the netstat command.
Rotational shifts involve working in different shifts at different times, such as day shift, night shift, and swing shift.
Web service flow involves a sequence of steps, such as sending a request, receiving a response, and processing the data.
To check ...read more
If I want to implement a stack then what should the value of the pointer (top of stack) in case of an empty stack? 0 or -1?
You have been given a column title as appears in an Excel sheet, return its corresponding column number.
Find the degree between an hour hand and a minute hand? Gave me a pen and paper to come up with the answer (it was an equation).
1. What is Primary key and foreign key?
2. What are ACID properties?
Q24. Which database are you going to use for Parking lot and Why ?
I would use a relational database like MySQL for the Parking lot as it provides structured data storage and supports complex queries.
Relational databases like MySQL offer structured data storage for parking lot information
Supports complex queries for managing parking lot data efficiently
Ability to handle large amounts of data and transactions
Provides data integrity and security features
Can easily integrate with other systems and applications
Q25. Program Based on Java String Operations. Print concatenation of Zig Zag string from a row
Program to concatenate Zig Zag string from a row using Java String Operations.
Use StringBuilder to efficiently concatenate strings
Use loops to traverse the rows and columns of the zig zag pattern
Use conditional statements to determine the direction of traversal
Write SQL query to get Nth highest salary
Q29. Tell us about Coalnet Architecture of MMS Module?
Coalnet Architecture of MMS Module is a system for managing and monitoring coal mines.
Coalnet Architecture is designed to manage and monitor coal mines.
It includes modules for tracking production, equipment maintenance, and safety.
The MMS Module specifically focuses on maintenance management.
It allows for scheduling and tracking of maintenance tasks, as well as inventory management.
The architecture is scalable and can be customized to fit the needs of different mines.
It is bu...read more
Q30. How to check ports in Solaris or linux machine
To check ports in Solaris or Linux machine, use the netstat command.
Open the terminal and type 'netstat -an' to display all open ports.
Use 'netstat -an | grep
' to check if a specific port is open. To check listening ports, use 'netstat -an | grep LISTEN'.
For Solaris, use 'netstat -an | grep .
' instead of '| grep '.
Q31. Given array contain duplicate elements need to remove duplicates and after deletion oreder of remaining element should remain same..
Remove duplicates from array of strings while maintaining original order.
Iterate through the array and use a Set to keep track of unique elements.
Add elements to a new array only if they are not already in the Set.
Q32. What is the difference between iterator and geneator
Iterator is a design pattern that allows sequential access to elements, while generator is a function that can pause and resume execution.
Iterator is an object that provides a way to access elements of a collection sequentially.
Generator is a function that can yield multiple values one at a time, allowing it to pause and resume execution.
Iterators are used in loops to iterate over collections like arrays, while generators are used to create iterable sequences.
Q33. What is java and explain oopes concept
Java is a popular programming language used for developing various applications. OOPs (Object-Oriented Programming) is a programming paradigm based on the concept of objects.
Java is a class-based, object-oriented programming language.
OOPs concepts include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation is the bundling of data and methods that operate on the data into a single unit.
Inheritance allows a class to inherit properties and behavior from anoth...read more
Q34. a robot that cleans the whole room
A robot that cleans the whole room is a useful tool for maintaining cleanliness and saving time.
Efficiently cleans all surfaces in the room
Can reach tight spaces and corners easily
Saves time and effort for the user
Examples: Roomba vacuum cleaner, iRobot Braava mopping robot
Q35. Longest string with no repeating character
Find the longest string in an array with no repeating characters.
Iterate through each string in the array
Use a set to keep track of characters seen so far
Update the longest string found without repeating characters
Q36. How do you create thread locks
Thread locks are created using synchronization mechanisms to prevent multiple threads from accessing shared resources simultaneously.
Use synchronized keyword in Java to create a synchronized block or method
Use locks from java.util.concurrent.locks package like ReentrantLock
Use synchronized collections like ConcurrentHashMap to handle thread safety
Implement thread-safe data structures like BlockingQueue for producer-consumer scenarios
Q37. What is web service flow
Web service flow is the sequence of steps involved in the communication between a client and a server over the internet.
Web service flow involves a client sending a request to a server
The server processes the request and sends a response back to the client
The response can be in various formats such as XML, JSON, or plain text
Web service flow can be synchronous or asynchronous
Examples of web services include RESTful APIs and SOAP web services
Q38. What is testing explain types
Testing is the process of evaluating a software application to identify defects or bugs.
Types of testing include unit testing, integration testing, system testing, acceptance testing, and regression testing.
Unit testing involves testing individual components or modules of the software.
Integration testing checks if different modules work together correctly.
System testing evaluates the entire system's functionality.
Acceptance testing ensures that the software meets the user's r...read more
Q39. What is exceptions handling
Exceptions handling is a mechanism to handle errors or exceptional situations in a program.
Exceptions allow for graceful handling of errors without crashing the program
Try-catch blocks are commonly used to catch and handle exceptions
Exceptions can be thrown manually using 'throw' keyword
Common exceptions include NullPointerException, ArrayIndexOutOfBoundsException, etc.
Q40. What is auto event wireup
Auto event wireup is a feature in ASP.NET that automatically connects events to event handlers based on naming conventions.
Auto event wireup simplifies event handling by automatically connecting events to event handlers without needing to manually wire them up in code.
In ASP.NET Web Forms, auto event wireup is enabled by default, but can be disabled by setting the AutoEventWireup attribute to false in the Page directive.
Event handlers are expected to follow a specific naming ...read more
Q41. Locators in automation selenium
Locators in automation selenium are used to identify web elements on a webpage for testing purposes.
Locators include ID, class name, name, tag name, link text, partial link text, and xpath.
ID is the most efficient locator as it is unique for each element.
Xpath is powerful but can be slow and brittle if not used correctly.
Using CSS selectors can also be a good alternative to xpath.
It is important to choose the right locator strategy based on the specific element and context.
Q42. What are Decorators in Python
Decorators in Python are functions that modify the behavior of other functions or methods.
Decorators are denoted by the @ symbol followed by the decorator name.
They allow you to add functionality to an existing function without modifying its code.
Common use cases include logging, authentication, and memoization.
Example: @staticmethod decorator in Python is used to define a method that is not bound to the class instance.
Q43. Implement your own search functionality
Implement a custom search functionality using algorithms like binary search or linear search.
Understand the requirements for the search functionality
Choose an appropriate search algorithm based on the data size and type
Implement the chosen algorithm in the programming language of choice
Test the search functionality with different input data to ensure accuracy
Q44. Trapping rain water problem
Trapping rain water problem involves calculating the amount of water that can be trapped between buildings given their heights.
Calculate the maximum height of buildings to the left and right of each building
Find the minimum of the two heights
Subtract the height of the current building to get the amount of water that can be trapped at that building
Q45. writte code for fibonacci
Fibonacci code generates a series of numbers where each number is the sum of the two preceding ones.
Start with two variables initialized to 0 and 1
Use a loop to calculate the next number by adding the previous two
Repeat the process until reaching the desired length or value
Q46. Design Toll system
Design a toll system for collecting fees from vehicles using RFID technology.
Implement RFID technology for automatic vehicle identification
Set up toll booths with RFID readers to detect vehicles
Calculate toll fees based on vehicle type, distance traveled, and time of day
Provide payment options such as prepaid accounts or credit card payments
Q47. Generate paranthesis
Generate all valid combinations of parentheses for a given number n
Use backtracking to generate all possible combinations of opening and closing parentheses
Keep track of the number of opening and closing parentheses used
Add opening parentheses if there are remaining to be used, and add closing parentheses if it won't create an invalid combination
Q48. Dense rank in sql
Dense rank in SQL is a function that assigns a rank to each row in a result set with no gaps between the ranks.
Dense rank is used to assign unique ranks to each row in a result set, with no gaps between the ranks.
It is similar to the RANK function, but does not leave gaps in the ranking sequence.
For example, if two rows have the same value and are ranked 1 and 2, the next row will be ranked 3, not 2.
Q49. Sort using frequency
Sort an array of strings based on their frequency of occurrence.
Create a frequency map to count the occurrences of each string
Sort the strings based on their frequency in descending order
If two strings have the same frequency, sort them lexicographically
Return the sorted array
Q50. Camel banana problem
The Camel Banana problem is a puzzle that involves calculating the number of bananas a camel can eat.
The problem involves a camel that can carry a certain weight and a number of bananas with different weights.
The camel can only carry a maximum weight and can only eat a certain number of bananas.
The goal is to determine the maximum number of bananas the camel can eat without exceeding its weight limit.
More about working at Oracle
Top HR Questions asked in null
Interview Process at null
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month