i
Oracle
Filter interviews by
Efficiently locate an element in a sorted 2D matrix using binary search or a stair-step approach.
Use binary search on each row if the matrix is sorted row-wise.
For a matrix sorted both row-wise and column-wise, start from the top-right corner.
If the current element is greater than the target, move left; if less, move down.
Example: In a matrix [[1, 2, 3], [4, 5, 6], [7, 8, 9]], to find 5, start at 3 (top-right) and...
A binary tree is balanced if the height of its left and right subtrees differ by at most 1.
A balanced binary tree has a smoother and faster search time than an unbalanced one.
Balancing a binary tree can be done using various algorithms like AVL tree, Red-Black tree, etc.
An example of a balanced binary tree is the AVL tree, where the heights of the left and right subtrees differ by at most 1.
Spring MVC is a framework used for building web applications in Java.
Spring MVC stands for Model-View-Controller, which is a design pattern for separating concerns in a web application.
It provides a powerful model for building flexible and loosely coupled web applications.
It integrates with other Spring frameworks like Spring Boot, Spring Security, and Spring Data.
It uses annotations to simplify configuration and ...
You are provided with two singly linked lists containing integers, where both lists converge at some node belonging to a third linked list.
Your task is to determine th...
Find the node where two linked lists merge, return -1 if no merging occurs.
Traverse both lists to find their lengths and the difference in lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the merging point
What people are saying about Oracle
MVC components include Model, View, and Controller for organizing code in a web application.
Model: Represents the data and business logic of the application.
View: Represents the UI and presentation layer of the application.
Controller: Acts as an intermediary between Model and View, handling user input and updating the Model accordingly.
Example: In a web application, a user interacts with the View (UI), which sends...
Java is platform independent because it compiles code into bytecode that can run on any system with a JVM, which is platform dependent due to its reliance on the underlying hardware and operating system.
Java code is compiled into bytecode, which can run on any system with a JVM installed.
JVM acts as an intermediary between the Java code and the underlying hardware/OS, making it platform dependent.
The JVM interpret...
Filters in MVC are components that allow pre-processing and post-processing of requests and responses.
Filters are used to perform common functionalities like logging, authentication, authorization, etc.
They can be applied globally to all controllers or selectively to specific controllers or actions.
Examples of filters include Authorization filters, Action filters, Result filters, and Exception filters.
Railway Reservation System for booking train tickets.
Users can search for trains based on source and destination stations.
Users can select preferred train, class, and seat.
System should handle payment processing and generate e-tickets.
Admin panel for managing trains, schedules, and bookings.
Integration with SMS/email notifications for updates.
Database to store train details, user information, and booking history.
Yes, it is possible to import the same class or package twice in Java, but it will not cause any issues during runtime.
Importing the same class or package multiple times in Java will not result in any errors or conflicts.
The Java compiler will simply ignore duplicate imports and only include the class or package once in the compiled code.
This behavior helps in avoiding unnecessary redundancy and keeps the code cle...
Marker interfaces in Java are interfaces with no methods, used to mark classes for special treatment.
Marker interfaces have no methods, they simply mark a class as having a certain capability or characteristic.
Examples of marker interfaces in Java include Serializable, Cloneable, and Remote.
Classes implementing marker interfaces can be treated differently by the JVM or other components based on the interface they ...
I appeared for an interview before Apr 2024, where I was asked the following questions.
Efficiently locate an element in a sorted 2D matrix using binary search or a stair-step approach.
Use binary search on each row if the matrix is sorted row-wise.
For a matrix sorted both row-wise and column-wise, start from the top-right corner.
If the current element is greater than the target, move left; if less, move down.
Example: In a matrix [[1, 2, 3], [4, 5, 6], [7, 8, 9]], to find 5, start at 3 (top-right) and move...
I applied via Naukri.com and was interviewed before Sep 2020. There were 3 interview rounds.
I appeared for an interview before Feb 2021.
Round duration - 60 Minutes
Round difficulty - Medium
This round had 1 question related to DSA and then the majority of the questions were revolving around Java.
Given a binary tree of integers, convert it to a sum tree where each node is replaced by the sum of the values of its left and right subtrees. Set leaf nodes to zero.
...Convert a binary tree to a sum tree by replacing each node with the sum of its left and right subtrees, setting leaf nodes to zero.
Traverse the tree in postorder fashion to calculate the sum of left and right subtrees for each node.
Set leaf nodes to zero by checking if a node has no children.
Update the value of each node to be the sum of its left and right subtrees.
Return the level order traversal of the converted sum ...
Garbage collector in Java is a built-in mechanism that automatically manages memory by reclaiming unused objects.
Garbage collector runs in the background to identify and delete objects that are no longer needed.
It helps prevent memory leaks and optimize memory usage.
Examples of garbage collectors in Java include Serial, Parallel, CMS, and G1.
Java is platform independent because it compiles code into bytecode that can run on any system with a JVM, which is platform dependent due to its reliance on the underlying hardware and operating system.
Java code is compiled into bytecode, which can run on any system with a JVM installed.
JVM acts as an intermediary between the Java code and the underlying hardware/OS, making it platform dependent.
The JVM interprets the...
Marker interfaces in Java are interfaces with no methods, used to mark classes for special treatment.
Marker interfaces have no methods, they simply mark a class as having a certain capability or characteristic.
Examples of marker interfaces in Java include Serializable, Cloneable, and Remote.
Classes implementing marker interfaces can be treated differently by the JVM or other components based on the interface they imple...
Round duration - 60 Minutes
Round difficulty - Medium
In this round, I had 2 questions of DSA where I had to first explain my approach with proper compleixt analysis and then write the pseudo code for both of them. After that, I was asked some questions from Java and MVC architecture.
Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:
1. get(key)
- Return the value of the key if it exists in the cache; otherw...
Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.
Implement a doubly linked list to keep track of the order of keys based on their recent usage.
Use a hashmap to store key-value pairs for quick access and update.
When capacity is reached, evict the least recently used item before inserting a new item.
Handle get and put operations efficiently to maintain ...
You are provided with two singly linked lists containing integers, where both lists converge at some node belonging to a third linked list.
Your task is to determine t...
Find the node where two linked lists merge, return -1 if no merging occurs.
Traverse both lists to find their lengths and the difference in lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the merging point
MVC components include Model, View, and Controller for organizing code in a web application.
Model: Represents the data and business logic of the application.
View: Represents the UI and presentation layer of the application.
Controller: Acts as an intermediary between Model and View, handling user input and updating the Model accordingly.
Example: In a web application, a user interacts with the View (UI), which sends requ...
Routing in MVC pattern is handled by a routing engine which maps incoming URLs to specific controller actions.
Routing is the process of matching incoming URLs to specific controller actions in the MVC pattern.
Routes are defined in a routing table which maps URLs to corresponding controller actions.
The routing engine uses the routing table to determine which controller and action should handle a particular request.
Route...
Yes, it is possible to import the same class or package twice in Java, but it will not cause any issues during runtime.
Importing the same class or package multiple times in Java will not result in any errors or conflicts.
The Java compiler will simply ignore duplicate imports and only include the class or package once in the compiled code.
This behavior helps in avoiding unnecessary redundancy and keeps the code clean an...
Round duration - 60 Minutes
Round difficulty - Medium
This round was inclined towards some Low Level Design Principles and some concepts from MVC.
Railway Reservation System for booking train tickets.
Users can search for trains based on source and destination stations.
Users can select preferred train, class, and seat.
System should handle payment processing and generate e-tickets.
Admin panel for managing trains, schedules, and bookings.
Integration with SMS/email notifications for updates.
Database to store train details, user information, and booking history.
Spring MVC is a framework used for building web applications in Java.
Spring MVC stands for Model-View-Controller, which is a design pattern for separating concerns in a web application.
It provides a powerful model for building flexible and loosely coupled web applications.
It integrates with other Spring frameworks like Spring Boot, Spring Security, and Spring Data.
It uses annotations to simplify configuration and reduc...
Filters in MVC are components that allow pre-processing and post-processing of requests and responses.
Filters are used to perform common functionalities like logging, authentication, authorization, etc.
They can be applied globally to all controllers or selectively to specific controllers or actions.
Examples of filters include Authorization filters, Action filters, Result filters, and Exception filters.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
A binary tree is balanced if the height of its left and right subtrees differ by at most 1.
A balanced binary tree has a smoother and faster search time than an unbalanced one.
Balancing a binary tree can be done using various algorithms like AVL tree, Red-Black tree, etc.
An example of a balanced binary tree is the AVL tree, where the heights of the left and right subtrees differ by at most 1.
I appeared for an interview in Oct 2016.
Inheritance is a concept in object-oriented programming where a class inherits properties and behaviors from another class.
Inheritance allows for code reuse and promotes modularity.
The class that is being inherited from is called the superclass or base class.
The class that inherits from the superclass is called the subclass or derived class.
The subclass can access the public and protected members of the superclass.
Inhe...
Regular expressions in PHP are powerful tools for pattern matching and manipulating strings.
Regular expressions are defined using the preg_match() function in PHP.
They are used to search, replace, and validate strings based on specific patterns.
Regex patterns consist of a combination of characters and special symbols.
Modifiers can be added to the pattern to control the matching behavior.
Common regex functions in PHP in...
Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as the same type.
Polymorphism allows a single interface to be used for different types of objects.
It enables code reusability and flexibility in object-oriented programming.
For example, a parent class 'Animal' can have multiple child classes like 'Dog', 'Cat', and 'Bird'. They can all be treated as 'Anim...
I appeared for an interview in Dec 2016.
The code for finding the Lowest Common Ancestor (LCA) in a Binary Search Tree (BST).
Start from the root node and compare it with the given two nodes.
If both nodes are smaller than the current node, move to the left subtree.
If both nodes are greater than the current node, move to the right subtree.
If one node is smaller and the other is greater, then the current node is the LCA.
Continue this process until the LCA is fou...
A DBMS for managing college faculty, professors, courses, and students.
The DBMS should have tables for faculty, professors, courses, and students.
Each table should have appropriate attributes to store relevant information.
Relationships can be established between tables using foreign keys.
Queries can be used to retrieve information about faculty, professors, courses, and students.
The DBMS can be used to track enrollment...
I was actively involved in coding competitions, hackathons, and programming clubs during college.
Participated in coding competitions such as ACM ICPC and Codeforces
Attended hackathons to work on real-world projects and improve problem-solving skills
Joined programming clubs to collaborate with peers and learn new technologies
Yes, I believe in seeking help when stuck in a problem as it leads to faster resolution and learning.
I believe in collaborating with team members to brainstorm solutions
I am not afraid to ask for help from more experienced developers
I utilize online resources like Stack Overflow or documentation when needed
Teamwork is collaborating with others towards a common goal, utilizing each member's strengths and skills.
Collaborating with others towards a common goal
Utilizing each member's strengths and skills
Communicating effectively and openly
Respecting and valuing diverse perspectives
Sharing responsibilities and supporting each other
Celebrating successes as a team
When faced with an unsolvable problem, I break it down, research, seek help, experiment, and iterate until a solution is found.
Break down the problem into smaller, manageable parts
Research and gather information related to the problem
Seek help from colleagues, online communities, or experts
Experiment with different approaches or solutions
Iterate and refine the solution based on feedback and results
In 5 years, I see myself as a senior software developer leading a team of developers on innovative projects.
Leading a team of developers on innovative projects
Senior software developer role
Continuing to learn and grow in the field
I applied via Referral
Find the minimum and maximum values in an array in a single traversal.
Initialize min and max variables with the first element of the array
Iterate through the array and update min and max if a smaller or larger value is found
Return the min and max values
The maximum number of squares on a chessboard is 64.
The chessboard has 64 squares in total.
The number of squares on a chessboard can be calculated using the formula n^2, where n is the number of rows or columns.
In this case, n = 8 (8 rows and 8 columns), so the maximum number of squares is 8^2 = 64.
C++ is a programming language. Deep copy creates a new object and copies all values, while shallow copy creates a reference to the original object.
C++ is a general-purpose programming language
Deep copy creates a new object with its own copy of the data
Shallow copy creates a reference to the original object
Deep copy is safer but can be slower and consume more memory
Shallow copy is faster but can lead to unexpected behav...
Pre initialization refers to the process of initializing variables or objects before they are used in a program.
Pre initialization helps avoid errors or unexpected behavior caused by using uninitialized variables.
It is a good practice to pre initialize variables with default values.
Pre initialization can be done using constructors, default values, or initialization blocks.
Example: int count = 0; initializes the variabl...
Reverse a linked list with and without using Recursion
Iterative approach: Use three pointers to reverse the links between nodes
Recursive approach: Recursively reverse the rest of the list and then fix the links
A copy constructor creates a new object as a copy of an existing object, ensuring proper resource management.
Used to initialize an object using another object of the same class.
Syntax: ClassName(const ClassName &obj) { /* copy data */ }
Example: MyClass obj1; MyClass obj2 = obj1; // Calls copy constructor
Important for classes that manage dynamic memory to avoid shallow copies.
Default copy constructor performs a shal...
Polymorphism refers to the ability of an object to take on many forms. The diamond problem occurs in multiple inheritance.
Polymorphism can be achieved through method overloading and method overriding.
Method overloading allows multiple methods with the same name but different parameters.
Method overriding occurs when a subclass provides a specific implementation of a method already defined in its superclass.
The diamond p...
The program should differentiate between integers and characters when using the assignment operator (=).
Check the data type of the variable before assigning a value.
Use conditional statements to perform different actions based on the data type.
For integers, assign the value directly. For characters, convert the character to its ASCII value and assign it.
Sort an array by moving all zeroes to the end.
Iterate through the array and move all non-zero elements to the front.
Count the number of zeroes encountered and append them at the end of the array.
Use two pointers to swap elements and maintain the order.
The number of VTables created in a class hierarchy depends on the number of virtual functions and the number of derived classes.
VTables are used in object-oriented programming languages to implement dynamic dispatch.
Each class with at least one virtual function has its own VTable.
Derived classes inherit the VTable of their base class and add their own entries for any additional virtual functions.
The total number of VTa...
List is preferred when frequent insertion and deletion is required. Vector is preferred when random access is required.
List is implemented as a doubly-linked list, allowing for efficient insertion and deletion at any position.
Vector is implemented as a dynamic array, allowing for efficient random access.
Use List when the number of elements is expected to change frequently and the order of elements matters less.
Use Vect...
The given string needs to be reversed and the words need to be rearranged.
Split the string into an array of words
Reverse the array
Join the array elements with a space in between
based on 3 interview experiences
Difficulty level
Duration
based on 42 reviews
Rating in categories
Senior Software Engineer
2.5k
salaries
| ₹12 L/yr - ₹42 L/yr |
Principal Consultant
2.2k
salaries
| ₹10.9 L/yr - ₹38.5 L/yr |
Senior Consultant
2.2k
salaries
| ₹9.2 L/yr - ₹25 L/yr |
Senior Member of Technical Staff
1.9k
salaries
| ₹13.5 L/yr - ₹47 L/yr |
Software Developer
1.5k
salaries
| ₹8.4 L/yr - ₹31.6 L/yr |
SAP
MongoDB
Salesforce
IBM