Oracle interview experience Real time questions & tips from candidates to crack your interview

MTS-2

Oracle
upvote
share-icon
1 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: Data Structures, OOPS, System Design, Algorithms, Graph, Trees
Tip
Tip

Tip 1 : Practice is the key to crack any interview. Solve as many questions as you can.
Tip 2 : Learn about the company values.

Application process
Where: Other
Eligibility: Performance in previous position.
Resume Tip
Resume tip

Tip 1 : Keep it short
Tip 2 : Try to highlight some work or projects that you did outside your work

Interview rounds

01
Round
Medium
Face to Face
Duration75 minutes
Interview date12 Sep 2014
Coding problem3

It was an internal coding round for a better post in the same company.

1. Count number of Good Nodes in a Binary Tree

Easy
15m average time
80% success
0/40
Asked in companies
MicrosoftOracleMorgan Stanley

You are given the root node of a binary tree consisting of ‘N’ nodes. Your task is to find the number of good nodes in the given binary tree.

A good node is defined as good if there are no nodes with a value greater than X’s value in the path from the root to X.

You are given a root node ‘ROOT’.Your task is to return the number of good nodes.

Example:
Elements are in the level order form. The input consists of values of nodes separated by a single space in a single line. In case a node is null, we take -1 in its place.

For example, the input for the tree depicted in the below image would be :

Example

1
2 3
4 -1 5 6
-1 7 -1 -1 -1 -1
-1 -1

Explanation :
Level 1 :
The root node of the tree is 1

Level 2 :
Left child of 1 = 2
Right child of 1 = 3

Level 3 :
Left child of 2 = 4
Right child of 2 = null (-1)
Left child of 3 = 5
Right child of 3 = 6

Level 4 :
Left child of 4 = null (-1)
Right child of 4 = 7
Left child of 5 = null (-1)
Right child of 5 = null (-1)
Left child of 6 = null (-1)
Right child of 6 = null (-1)

Level 5 :
Left child of 7 = null (-1)
Right child of 7 = null (-1)

The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level. 

The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.

The input ends when all nodes at the last level are null (-1).
Note :
The above format was just to provide clarity on how the input is formed for a given tree. 

The sequence will be put together in a single line separated by a single space. Hence, for the above-depicted tree, the input will be given as:

1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Problem approach

Recorded the maximum value along the path from the root to the node. Used recursion to solve the problem

Try solving now

2. Swap Number Without Temporary Variable

Easy
15m average time
85% success
0/40
Asked in companies
SAP LabsBNY MellonMakeMyTrip

Given two variables ‘X’ and ‘Y’. Your task is to swap the number without using a temporary variable or third variable.

Swap means the value of ‘X’ and ‘Y’ must be interchanged. Take an example ‘X’ is 10 and ‘Y’ is 20 so your function must return ‘X’ as a 20 and ‘Y’ as a 10.

Problem approach

Used bitwise operation to solve the problem

Try solving now

3. Add Two Numbers As Linked Lists

Moderate
20m average time
80% success
0/80
Asked in companies
SprinklrIBMDeutsche Bank

You are given two non-negative numbers 'num1' and 'num2' represented in the form of linked lists.


The digits in the linked lists are stored in reverse order, i.e. starting from least significant digit (LSD) to the most significant digit (MSD), and each of their nodes contains a single digit.


Calculate the sum of the two numbers and return the head of the sum list.


Example :
Input:
'num1' : 1 -> 2 -> 3 -> NULL
'num2' : 4 -> 5 -> 6 -> NULL

Output: 5 -> 7 -> 9 -> NULL

Explanation: 'num1' represents the number 321 and 'num2' represents 654. Their sum is 975.


Problem approach

1. Calculate the sizes of the given two linked lists.


2. If sizes are not the same, then append zeros in the smaller linked list.
 

3. If the size is the same, then follow the below steps:
a. Find the smaller valued linked list.
b. One by one add nodes of the smaller-sized linked list to the larger size. Keep track of carry while adding.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 2 problems
Interviewed by Oracle
10749 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Oracle
0 views
0 comments
0 upvotes
company logo
Application Developer
3 rounds | 4 problems
Interviewed by Oracle
1841 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Oracle
3010 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
MTS-2
3 rounds | 5 problems
Interviewed by Adobe
2519 views
0 comments
0 upvotes
company logo
MTS-2
3 rounds | 6 problems
Interviewed by Adobe
2784 views
0 comments
0 upvotes
company logo
MTS-2
5 rounds | 5 problems
Interviewed by Adobe
3973 views
0 comments
0 upvotes