i
Oracle
Filter interviews by
Implementing design patterns in software development
Singleton pattern ensures a class has only one instance and provides a global point of access to it
Factory pattern creates objects without specifying the exact class of object that will be created
Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated
Given an array ARR
of size N
, where each element represents the height of a balloon. The task is to destroy all balloons by shooting arrows from left to right. When an arrow hits ...
Find the minimum number of arrows needed to burst all balloons by shooting arrows from left to right.
Sort the array in ascending order to make it easier to determine the minimum number of arrows needed.
Iterate through the sorted array and count the number of times the height decreases.
The count of height decreases plus 1 gives the minimum number of arrows needed to burst all balloons.
Given a binary tree with 'N' nodes numbered from 1 to 'N', your task is to print all the root-to-leaf paths of the binary tree.
The first line of the input cont...
Given a binary tree, print all root-to-leaf paths in order.
Traverse the binary tree from root to leaf nodes, keeping track of the path nodes.
Use depth-first search (DFS) to explore all possible paths.
Return each path as a string of nodes separated by spaces.
Handle cases where nodes have NULL values by skipping them in the path.
Ensure the order of nodes in each path is maintained.
Given a list of integers pre[]
of size n
, representing the preorder traversal of a special binary tree where each node has 0 or 2 children, and a boolean array isLeaf...
Construct a binary tree from preorder traversal and leaf node information.
Create a binary tree using preorder traversal and leaf node information
Use recursion to build the tree
Handle both leaf and non-leaf nodes appropriately
Given a binary tree with N
nodes, determine whether the tree is a Binary Search Tree (BST). If it is a BST, return true
; otherwise, return false
.
A binary search tree (BST) ...
Validate if a binary tree is a Binary Search Tree (BST) based on given properties.
Check if the left subtree of a node contains only nodes with data less than the node's data.
Verify if the right subtree of a node contains only nodes with data greater than the node's data.
Ensure that both the left and right subtrees are also binary search trees.
Iterate through the tree in level order form to validate the BST propert...
Given an array or list ARR
consisting of N
integers, your task is to identify all distinct triplets within the array that sum up to a specified number K
.
A tr...
Identify all distinct triplets within an array that sum up to a specified number.
Iterate through the array and use nested loops to find all possible triplets.
Check if the sum of the triplet equals the specified number.
Print the valid triplets or return -1 if no triplet exists.
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
The first line c...
Find all pairs of elements in an array that add up to a given target.
Iterate through the array and store each element in a hashmap along with its index.
For each element, check if the target minus the element exists in the hashmap.
If found, print the pair of elements. If not found, print (-1, -1).
Delete nodes from linkedList if their value matches a certain condition
Implementing design patterns in software development
Singleton pattern ensures a class has only one instance and provides a global point of access to it
Factory pattern creates objects without specifying the exact class of object that will be created
Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated
I appeared for an interview before Jan 2021.
Round duration - 50 Minutes
Round difficulty - Medium
It was the screening round he asked me 2 questions
First one is easy and other one is medium type
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
The first line ...
Find all pairs of elements in an array that add up to a given target.
Iterate through the array and store each element in a hashmap along with its index.
For each element, check if the target minus the element exists in the hashmap.
If found, print the pair of elements. If not found, print (-1, -1).
Given a binary tree with 'N' nodes numbered from 1 to 'N', your task is to print all the root-to-leaf paths of the binary tree.
The first line of the input con...
Given a binary tree, print all root-to-leaf paths in order.
Traverse the binary tree from root to leaf nodes, keeping track of the path nodes.
Use depth-first search (DFS) to explore all possible paths.
Return each path as a string of nodes separated by spaces.
Handle cases where nodes have NULL values by skipping them in the path.
Ensure the order of nodes in each path is maintained.
Round duration - 45 Minutes
Round difficulty - Easy
This is the first round in the loop interviews. Are you familiar with Javascript. Why do we use js. How do you use js to change the value of a textbox.
Given a binary tree with N
nodes, determine whether the tree is a Binary Search Tree (BST). If it is a BST, return true
; otherwise, return false
.
A binary search tree (BST)...
Validate if a binary tree is a Binary Search Tree (BST) based on given properties.
Check if the left subtree of a node contains only nodes with data less than the node's data.
Verify if the right subtree of a node contains only nodes with data greater than the node's data.
Ensure that both the left and right subtrees are also binary search trees.
Iterate through the tree in level order form to validate the BST properties.
Given a list of integers pre[]
of size n
, representing the preorder traversal of a special binary tree where each node has 0 or 2 children, and a boolean array isLea...
Construct a binary tree from preorder traversal and leaf node information.
Create a binary tree using preorder traversal and leaf node information
Use recursion to build the tree
Handle both leaf and non-leaf nodes appropriately
Round duration - 45 minutes
Round difficulty - Easy
It was the team fit round
Round duration - 45 Minutes
Round difficulty - Medium
4tn round in the loop, he asked me to design a game. He focused both on backend and frontend.
..
Given an array ARR
of size N
, where each element represents the height of a balloon. The task is to destroy all balloons by shooting arrows from left to right. When an arrow hits...
Find the minimum number of arrows needed to burst all balloons by shooting arrows from left to right.
Sort the array in ascending order to make it easier to determine the minimum number of arrows needed.
Iterate through the sorted array and count the number of times the height decreases.
The count of height decreases plus 1 gives the minimum number of arrows needed to burst all balloons.
Round duration - 45 Minutes
Round difficulty - Medium
Another problem solving round
Given an array or list ARR
consisting of N
integers, your task is to identify all distinct triplets within the array that sum up to a specified number K
.
A t...
Identify all distinct triplets within an array that sum up to a specified number.
Iterate through the array and use nested loops to find all possible triplets.
Check if the sum of the triplet equals the specified number.
Print the valid triplets or return -1 if no triplet exists.
Tip 1 : clear your basics in ds algo
Tip 2 : problem solving is must to Crack coding interview
Tip 3 : solve leetcode problem as much as you can
Tip 1 : it should be short as possible
Tip 2 : you must have mentioned your past experience in chronological order with descriptions
Top trending discussions
I applied via Company Website and was interviewed before Oct 2019. There were 4 interview rounds.
I applied via Campus Placement and was interviewed before Nov 2021. There were 3 interview rounds.
Numerical and logical aptitude test
There are 5 rounds on datastructure and algorithm
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 1 interview experience
Difficulty level
based on 5 reviews
Rating in categories
Senior Software Engineer
2.5k
salaries
| ₹19.9 L/yr - ₹36 L/yr |
Principal Consultant
2.2k
salaries
| ₹20 L/yr - ₹34 L/yr |
Senior Consultant
2.2k
salaries
| ₹12.8 L/yr - ₹23.5 L/yr |
Senior Member of Technical Staff
1.9k
salaries
| ₹23.6 L/yr - ₹40.3 L/yr |
Software Developer
1.5k
salaries
| ₹15.2 L/yr - ₹27 L/yr |
SAP
MongoDB
Salesforce
IBM