i
Oracle
Filter interviews by
I appeared for an interview in Oct 2020.
Round duration - 107 minutes
Round difficulty - Medium
The test was active on (Oct 1, 2020) from 7:00 PM to 09:00 PM. The duration of the test is 107 minutes.
The candidate should have completed the test by 9:45 PM.
The camera and microphone was on all the time. There was time alotted for each section. After completing one section you cannot switch to the previous section. If you go off the camera you will get a warning.
The test contained several sections and all questions were MCQs. The sections were Coding ability, Computer Science theory, Advanced data structures like AVL Tree, Verbal and Quantitative ability, etc
Given an array or list PREORDER
representing the preorder traversal of a Binary Search Tree (BST) with N
nodes, construct the BST which matches the given preord...
Given a preorder traversal of a BST, construct the BST and print its inorder traversal.
Parse the input to get the number of test cases and preorder traversal for each case
Construct the BST using the preorder traversal by recursively building the tree
Print the inorder traversal of the constructed BST for each test case
Round duration - 30 minutes
Round difficulty - Medium
The Round started at 10:15 am and ended at 10:45 am approx. We waited in breakout room in zoom and when the interviewer was free we entered in the zoom call with the interviewer both camera and microphone was on. The interviewer was really supportive and hepled me in thinking different approches of a problem.
Determine if a given string of integers bin
represents a valid binary number. Return 'true'
if the string represents a valid binary number, otherwise return 'false'
. A binary n...
Check if a given string represents a valid binary number composed of 0s and 1s.
Iterate through each character in the string and check if it is either '0' or '1'.
If any character is not '0' or '1', return 'false'.
Return 'true' if all characters are '0' or '1'.
You are given an array/list 'NUM' of integers. Rearrange the elements of 'NUM' such that no two adjacent elements are the same in the rearranged array.
The task is to rearrange an array such that no two adjacent elements are the same.
Iterate through the array and check if any adjacent elements are the same.
If adjacent elements are the same, swap one of them with a different element.
Return 'YES' if a valid rearrangement is possible, 'NO' otherwise.
You are provided with a positive integer N
. Your task is to identify all numbers such that the sum of the number and its digits equals N
.
N = 21
Identify numbers whose sum with digits equals given integer N.
Iterate through numbers from 1 to N and check if sum of number and its digits equals N.
Use a helper function to calculate sum of digits for a given number.
Return -1 if no such number exists for a test case.
Given a string STR
containing characters from [a-z], [A-Z], [0-9], and special characters, determine the reverse of the string.
The input starts with a single i...
Reverse a given string containing characters from [a-z], [A-Z], [0-9], and special characters.
Iterate through each character in the string and append them in reverse order to a new string
Use built-in functions like reverse() or slice() to reverse the string
Handle special characters and numbers along with alphabets
The result of adding two binary numbers in a 64-bit and a 32-bit operating system will differ due to the different number of bits used for calculations.
In a 64-bit operating system, the result will be more accurate and can handle larger numbers compared to a 32-bit system.
Overflow may occur in a 32-bit system when adding large binary numbers, leading to incorrect results.
Example: Adding 1111 (15 in decimal) and 1111 (1...
Round duration - 30 minutes
Round difficulty - Medium
It took place at 11:30am(approx) and last for about 30 minutes
We waited in breakout room in zoom and when the interviewer was free we entered in the zoom call with the interviewer. Both camera and microphone was on.
Round duration - 30 minutes
Round difficulty - Easy
It took place around 1:30pm and last for 30 minutes. We waited in breakout room in zoom and when the interviewer was free we entered in the zoom call with the interviewer. Both camera and microphone was on.
Tip 1 : Make your basics strong don't run after new technologies as a fresher companies wants your good command on DSA
Tip 2 : Focus more on competitive programming to get into a good organization don't indulge to much in development because the first step to reach to the interview round is to clear the coding round
Tip 3 : Do at least 2-3 Questions per day and practice daily
Tip 4 : Also practice basic aptitude questions
Tip 1 : Don't mention things in the resume that you don't have full command on you should have complete knowledge of what you mention in your resume
Tip 2 : Make your resume short and if you mention projects in your resume be clear about the details of the project even if you have done that in group because the interviewer will surely ask from it.
I applied via LinkedIn and was interviewed in Jan 2021. There were 3 interview rounds.
A singleton class is a class that can only have one instance created at a time.
Singleton classes are often used for managing resources that should only have one instance, such as a database connection.
They are implemented by making the constructor private and providing a static method to access the single instance.
Singleton classes can also be used for global state management in an application.
In Java, the Singleton pa...
I appeared for an interview before Sep 2020.
Round duration - 140 minutes
Round difficulty - Hard
2 Separate online rounds were hosted on HackerRank . Online Aptitude Round consisted of 45 questions. Online Coding Round consisted of 3 questions.
You are given an array ARR
of N integers. Your task is to perform operations on this array until it becomes empty, and maximize the sum of selected elements. In each operatio...
The task is to maximize the sum of selected elements from an array by following specific rules.
Select elements strategically to maximize the sum
Remove occurrences of selected element, and its neighbors
Repeat the process until the array becomes empty
You are given an array/list 'NUM' of integers. Rearrange the elements of 'NUM' such that no two adjacent elements are the same in the rearranged array.
The task is to rearrange an array such that no two adjacent elements are the same.
Iterate through the array and check if any adjacent elements are the same.
If adjacent elements are the same, swap one of them with a different element.
Return 'YES' if a valid rearrangement is possible, 'NO' otherwise.
Round duration - 40 minutes
Round difficulty - Hard
The interview started of with questions about the online test, general questions on “tell me about yourself”
Then he asked me a relative velocity problem from physics section to warm things up.
It was Followed by discussion on topics taught in college, Questions on OS and DBMS.
Given the number of stairs, initially at the 0th stair, you need to reach the Nth stair. Each time, you can either climb one step or two steps. Determine the number of distinct way...
Calculate the number of distinct ways to climb N stairs by either taking one or two steps at a time.
Use dynamic programming to keep track of the number of ways to reach each stair
The number of ways to reach a stair is the sum of the number of ways to reach the previous two stairs
Return the result modulo 10^9+7
Given a binary tree of integers, return its level order traversal.
The first line contains an integer 'T' which represents the number of test cases. For each ...
Level Order Traversal of Binary Tree returns nodes in level order traversal.
Perform a level order traversal of the binary tree starting from the root node.
Visit nodes level by level, printing them in the order they are encountered.
Use a queue data structure to keep track of nodes at each level.
Round duration - 50 minutes
Round difficulty - Easy
The interviewer asked about my project – the idea of the project, the challenges I faced etc. She also asked some OS concepts like CPU scheduling, multi-queue scheduling, mutex, deadlocks.
Given a binary tree, your task is to print the left view of the tree.
The input will be in level order form, with node values separated by a...
The task is to print the left view of a binary tree given in level order form.
Traverse the tree level by level and print the first node of each level (leftmost node).
Use a queue to keep track of nodes at each level.
Consider null nodes as well while traversing the tree.
Given a binary tree, your task is to print the Top View of the Binary Tree. The Top View is the set of nodes visible when the tree is viewed from the top. Please ...
The task is to print the Top View of a Binary Tree, which is the set of nodes visible when viewed from the top, in left to right order.
Traverse the binary tree in level order and maintain a map to store the horizontal distance of each node from the root.
For each node, if the horizontal distance is not already in the map, add the node's value to the result.
Print the values from the map in ascending order of horizontal d
Design a system to store incoming characters in sorted manner and answer queries about character presence.
Use a data structure like a balanced binary search tree to store characters in sorted order.
Implement functions to insert characters into the tree and check for character presence.
Optimize search queries by using binary search or tree traversal techniques.
Consider edge cases like duplicate characters and handling s...
Tip 1 : Be solid with the basics of Ds, Algo. Good to have end to end projects which are hosted on cloud.
Tip 2 : Its always good to be presentable and have good communications skills
Tip 3 : Be honest, clear in approach and always walkthrough your thought process to the interviewer
Tip 1 : Mention your projects and experience at the top. Be clear on what was done, a brief on how it was done, language /tech stack involved. If possible try to host and make it accessible. You never know if you can present it with just one click.
Tip 2 : Choose a balance between, white spaces and text, it should be well indented, no grammatical errors.
Tip 3 : It takes less than 2 min to scan a resume. Don't mention things which are irrelevant.
I applied via Company Website and was interviewed in Nov 2022. There were 3 interview rounds.
2 medium hard problems were asled one was dynamic programming second was multi spurce bfs
The question is about finding the area of a histogram and the Kth largest value.
Calculate the area of the histogram by multiplying the width and height of each bar and summing them up.
Find the Kth largest value by sorting the data and selecting the Kth element.
The Kth largest value can also be found using a heap data structure.
Example: Histogram area of [2, 3, 1, 4, 5] with bar width of 1 is 15. The 3rd largest value i
Finding the Kth largest element in an array.
Sort the array and return the Kth element from the end
Use a max heap to keep track of the K largest elements
Use quickselect algorithm to find the Kth largest element
I applied via Recruitment Consulltant and was interviewed in Jun 2022. There were 2 interview rounds.
1 hour 30 minutes, questions were based on coding, aptitude
Insertion sort and quicksort are sorting algorithms used to sort arrays of data.
Insertion sort: iterates through the array and inserts each element into its proper position.
Quicksort: selects a pivot element and partitions the array into two sub-arrays, one with elements less than the pivot and one with elements greater than the pivot.
Insertion sort is best for small arrays, while quicksort is best for large arrays.
Bot...
Merge two sorted linked lists using recursion
Create a recursive function that compares the first nodes of both lists
Set the smaller node as the head of the merged list and call the function again with the next node of the smaller list
Base case: if one list is empty, return the other list
Return the merged list
Given an integer, determine which byte is zero.
Convert the integer to a byte array using bitwise operations.
Iterate through the byte array and check for a zero value.
Return the index of the zero byte.
Consider endianness when converting to byte array.
To check endianness, create a 4-byte integer with a known value and check the byte order.
Create a 4-byte integer with a known value
Check the value of the first byte to determine endianness
If the first byte is the least significant, the machine is little endian
If the first byte is the most significant, the machine is big endian
Static objects can be used to print something before main() execution.
Static objects are initialized before main() execution
They can be used to print something before main()
Example: static int x = printf("Hello World!");
Output: Hello World! will be printed before main() execution
Static variables are allocated memory in the data segment of the program's memory space.
Static variables have a fixed memory location throughout the program's execution.
They are initialized to zero by default.
If initialized explicitly, they are stored in the data segment.
Static variables can be accessed by any function in the program.
Finding space and time complexity of a recursive function.
Space complexity is the amount of memory used by the function.
Time complexity is the amount of time taken by the function to execute.
Recursive functions have higher space complexity due to the call stack.
Time complexity can be calculated using Big O notation.
Examples of recursive functions include factorial and Fibonacci sequence.
Diamond hierarchy problem is a problem in object-oriented programming where a class inherits from multiple classes in a diamond-shaped hierarchy.
Occurs when a class inherits from two classes that share a common base class
Can lead to ambiguity in method calls and data members
Solved using virtual inheritance or by using interfaces
To determine if a point is inside a polygon, use the ray casting algorithm.
Create a line from the point to a point outside the polygon
Count the number of times the line intersects with the polygon edges
If the count is odd, the point is inside the polygon; otherwise, it is outside
The four storage classes in C are auto, register, static, and extern.
Auto: default storage class for all local variables
Register: used to define local variables that should be stored in a register instead of RAM
Static: used to define local variables that retain their value between function calls
Extern: used to declare a global variable that is defined in another file
i is stored in global data segment, j is stored in stack, k is stored in heap.
i is a global variable and is stored in the global data segment
j is a local variable and is stored in the stack
k is a pointer variable and is stored in the stack, while the memory it points to is allocated on the heap using malloc()
Use a hash table to store the words and check for existence in constant time.
Create a hash table with the words as keys and a boolean value as the value.
For each new word, check if it exists in the hash table. If it does, it has appeared before. If not, add it to the hash table.
Alternatively, use a set data structure to store only the unique words and check for existence in the set.
Return all root to leaf node paths in a binary tree with row, col and value.
Traverse the binary tree recursively and keep track of the current path.
When a leaf node is reached, add the path to the result array.
Include row, col and value of each node in the path.
Use an array of strings to store the paths.
To get max value from a stack in O(1), maintain a separate stack to keep track of maximum values.
Create a separate stack to keep track of maximum values
Push the maximum value onto the stack whenever a new maximum is encountered
Pop the maximum value stack whenever the top element of the main stack is popped
Return the top element of the maximum value stack to get the maximum value in O(1)
To get max element from a queue in O(1) time complexity
Maintain a separate variable to keep track of the maximum element in the queue
Update the maximum element variable whenever a new element is added or removed from the queue
Return the maximum element variable when getMax() function is called
Find the Next Greatest Element to the right for each element in an array of strings.
Iterate through the array from right to left
Use a stack to keep track of elements
Pop elements from stack until a greater element is found
If no greater element is found, assign -1
Return the result array
To remove unnecessary parenthesis from an expression, we need to apply a set of rules to identify and eliminate them.
Identify and remove parenthesis around single variables or constants
Identify and remove parenthesis around expressions with only one operator
Identify and remove parenthesis around expressions with operators of equal precedence
Identify and remove parenthesis around expressions with operators of different ...
Find the maximum product of three integers in an array.
Sort the array in descending order.
Check the product of the first three numbers and the product of the first and last two numbers.
Return the maximum of the two products.
Find length of longest consecutive sub array forming an AP from given array of integers.
Sort the array in ascending order
Iterate through the array and find the longest consecutive sub array forming an AP
Use a variable to keep track of the length of the current consecutive sub array forming an AP
Use another variable to keep track of the length of the longest consecutive sub array forming an AP seen so far
I appeared for an interview before Jan 2021.
Round duration - 60 Minutes
Round difficulty - Medium
The interviewer asked me 2 questions related to DS/Algo in this round . Both the questions were of Easy-Medium difficulty and I was also required to code them in a production ready manner.
You are provided with a binary tree consisting of N
nodes where each node has an integer value. The task is to determine the maximum sum achievable by a...
Find the maximum sum achievable by a simple path between any two nodes in a binary tree.
Traverse the binary tree to find all possible paths and calculate their sums.
Keep track of the maximum sum encountered during traversal.
Consider paths that may include the same node twice.
Implement a recursive function to explore all possible paths.
Handle cases where nodes have negative values.
Given two arrays A
and B
with sizes N
and M
respectively, both sorted in non-decreasing order, determine their intersection.
The intersection of two arrays in...
The problem involves finding the intersection of two sorted arrays efficiently.
Use two pointers to iterate through both arrays simultaneously.
Compare elements at the pointers and move the pointers accordingly.
Handle cases where elements are equal, and update the intersection array.
Return the intersection array as the result.
Round duration - 50 Minutes
Round difficulty - Medium
This round had 2 questions of DS/Algo to solve under 50 minutes and one question related to Operating Systems.
You are provided with an array or list ARR
containing N
positive integers. Your task is to determine the Next Greater Element (NGE) for each element in the array.
T...
Find the Next Greater Element for each element in an array.
Iterate through the array from right to left
Use a stack to keep track of elements with no greater element to the right
Pop elements from the stack until finding a greater element or stack is empty
Given three integers X
, C
, and Y
, where X
is the first term of an arithmetic sequence with a common difference of C
, determine if Y
is part of this arithmetic sequ...
Check if a given number is part of an arithmetic sequence with a given first term and common difference.
Calculate the arithmetic sequence using the formula: nth term = X + (n-1) * C
Check if Y is equal to any term in the sequence to determine if it belongs to the sequence
Return 'True' if Y belongs to the sequence, otherwise return 'False'
Processes are instances of programs in execution, while threads are smaller units within a process that can execute independently.
A process is a program in execution, consisting of code, data, and resources.
Threads are smaller units within a process that can execute independently.
Processes have their own memory space, while threads share the same memory space within a process.
Processes are heavyweight, while threads ar...
Round duration - 50 Minutes
Round difficulty - Medium
This round had 2 questions of DSA of Easy-Medium difficulty and at the end I was asked a Puzzle to check my general problem solving ability.
Given an array/list arr
of size n
, determine the maximum product possible by taking any subset of the array/list arr
. Return the result modulo 10^9+7
since the product ...
Find the maximum product of a subset of an array modulo 10^9+7.
Iterate through the array and keep track of the maximum positive product and minimum negative product encountered so far.
Handle cases where the array contains zeros separately.
Return the maximum product modulo 10^9+7.
Given a complete binary tree with 'N' nodes, your task is to determine the 'next' node immediately to the right in level order for each node in the given tree.
...Implement a function to update 'next' pointers in a complete binary tree.
Iterate level by level using a queue
Connect nodes at each level using 'next' pointers
Handle null nodes appropriately
Ensure the tree is a complete binary tree
Round duration - 50 Minutes
Round difficulty - Medium
This round consisted of 2 questions from DSA where I was first asked to explain my approach to the interviewer with proper complexity analysis and then code the problems. The interviewer was quite friendly and also provided me some hints when I was stuck.
Create a stack data structure that supports not only the usual push and pop operations but also getMin(), which retrieves the minimum element, all in O(1) time complexity witho...
Implement a stack with push, pop, top, isEmpty, and getMin operations in O(1) time complexity without using extra space.
Use two stacks - one to store the actual elements and another to store the minimum element at each level.
When pushing an element, check if it is smaller than the current minimum and update the minimum stack accordingly.
When popping an element, also pop from the minimum stack if the popped element is t...
You are given an integer array arr
of size N
. Your task is to split the array into the maximum number of subarrays such that the first and last occurre...
Given an array, split it into maximum subarrays with first and last occurrence of each element in a single subarray.
Iterate through the array and keep track of the first and last occurrence of each element.
Use a hashmap to store the indices of each element.
Split the array whenever the last occurrence of an element is found.
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.
based on 4 reviews
Rating in categories
Senior Software Engineer
2.4k
salaries
| ₹10.3 L/yr - ₹40 L/yr |
Principal Consultant
2.1k
salaries
| ₹14.5 L/yr - ₹36 L/yr |
Senior Consultant
2.1k
salaries
| ₹8.7 L/yr - ₹28 L/yr |
Senior Member of Technical Staff
1.8k
salaries
| ₹13.4 L/yr - ₹45 L/yr |
Senior Application Engineer
1.4k
salaries
| ₹9.6 L/yr - ₹30 L/yr |
SAP
MongoDB
Salesforce
IBM