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

Senior Application Developer

Oracle
upvote
share-icon
3 rounds | 12 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 Months
Topics: Data Structures, Algorithms, System Design, DBMS, Java, Aptitude, OOPS
Tip
Tip

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.

Application process
Where: Referral
Eligibility: Above 2 years of experience
Resume Tip
Resume tip

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.

Interview rounds

01
Round
Medium
Face to Face
Duration60 Minutes
Interview date4 May 2019
Coding problem4

This round had 1 question related to DSA and then the majority of the questions were revolving around Java.

1. Convert a binary tree to its sum tree

Easy
15m average time
85% success
0/40
Asked in companies
AmazonMicrosoftSamsung

Given a binary tree of integers, you are supposed to modify the given binary tree to a sum tree where each node value is replaced by the sum of the values of both left and right subtrees in the given tree. The value of leaf nodes is changed to zero.

Example:
Below is the example showing the input tree and its sum tree.  

alt text

Problem approach

Approach : 

1) Build the Sum Tree
1.1) Update the root data with the sum of the left and right children’s data given that the root itself is not null.
1.2) Check the left node and right node. If they are not null, take their sum and update the root data.
1.3) Extend this idea further by making a recursive call on to the left and right subtrees.

2) Do a pre order traversal.
2.1) To keep track of the node data in the preorder traversal manner, we take a dynamic array.
2.2) If the root is not null, put the root data to the dynamic array and do the same for the left and the right subtrees by making recursive calls.

TC : O(N), where N=total number of nodes in the binary tree
SC : O(N)

Try solving now

2. Java Question

What is Garbage collector in JAVA?

Problem approach

Answer :

1) Garbage Collection in Java is a process by which the programs perform memory management automatically.

2) The Garbage Collector(GC) finds the unused objects and deletes them to reclaim the memory. I

3) In Java, dynamic memory allocation of objects is achieved using the new operator that uses some memory and the memory remains allocated until there are references for the use of the object.

4) When there are no references to an object, it is assumed to be no longer needed, and the memory, occupied by the object can be reclaimed.

5) There is no explicit need to destroy an object as Java handles the de-allocation automatically.

The technique that accomplishes this is known as Garbage Collection. Programs that do not de-allocate memory can eventually crash when there is no memory left in the system to allocate. These programs are said to have memory leaks.

Garbage collection in Java happens automatically during the lifetime of the program, eliminating the need to de-allocate memory and thereby avoiding memory leaks.

In C language, it is the programmer’s responsibility to de-allocate memory allocated dynamically using free() function. This is where Java memory management leads.

3. Java Question

Why Java is platform independent and JVM platform dependent?

Problem approach

JVM is platform dependent because it takes java byte code and generates byte code for the current operating system. So Java software is platform dependent but Java language is platform independent because different operating system have different JVMs.

4. Java Question

What do you understand by marker interfaces in Java?

Problem approach

Marker interfaces, also known as tagging interfaces are those interfaces that have no methods and constants defined in them. They are there for helping the compiler and JVM to get run time-related information regarding the objects.

02
Round
Medium
Face to Face
Duration60 Minutes
Interview date4 May 2019
Coding problem5

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.

1. LRU Cache Implementation

Moderate
25m average time
65% success
0/80
Asked in companies
MicrosoftUberSalesforce

Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:

1. get(key) - Return the value of the key if the key exists in the cache, otherwise return -1.

2. put(key, value), Insert the value in the cache if the key is not already present or update the value of the given key if the key is already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
You will be given ‘Q’ queries. Each query will belong to one of these two types:
Type 0: for get(key) operation.
Type 1: for put(key, value) operation.
Note :
1. The cache is initialized with a capacity (the maximum number of unique keys it can hold at a time).

2. Access to an item or key is defined as a get or a put operation on the key. The least recently used key is the one with the oldest access time.
Problem approach

Answer :

Structure of an LRU Cache :

1) In practice, LRU cache is a kind of Queue — if an element is reaccessed, it goes to the end of the eviction order.
2) This queue will have a specific capacity as the cache has a limited size. Whenever a new element is brought in, it is added at the head of the queue. When eviction happens, it happens from the tail of the queue.
3) Hitting data in the cache must be done in constant time, which isn't possible in Queue! But, it is possible with HashMap data structure
4) Removal of the least recently used element must be done in constant time, which means for the implementation of Queue, we'll use DoublyLinkedList instead of SingleLinkedList or an array.

LRU Algorithm :

The LRU algorithm is pretty easy! If the key is present in HashMap, it's a cache hit; else, it's a cache miss.

We'll follow two steps after a cache miss occurs:
1) Add a new element in front of the list.
2) Add a new entry in HashMap and refer to the head of the list.

And, we'll do two steps after a cache hit:
1) Remove the hit element and add it in front of the list.
2) Update HashMap with a new reference to the front of the list.

Tip : This is a very frequently asked question in interview and its implementation also gets quite cumbersome if you are doing it for the first time so better knock this question off before your SDE-interviews.

Try solving now

2. Intersection of Linked List

Easy
25m average time
73% success
0/40
Asked in companies
OracleThought WorksIBM

You are given two Singly Linked Lists of integers, which may have an intersection point.

Your task is to return the first intersection node. If there is no intersection, return NULL.


Example:-
The Linked Lists, where a1, a2, c1, c2, c3 is the first linked list and b1, b2, b3, c1, c2, c3 is the second linked list, merging at node c1.

alt.txt

Problem approach

Approach (Using 2-pointers) : 

1) Initialize two pointers ptr1 and ptr2 at the head1 and head2.
2) Traverse through the lists,one node at a time.
3) When ptr1 reaches the end of a list, then redirect it to the head2.
4) Similarly when ptr2 reaches the end of a list, redirect it the head1.
5) Once both of them go through reassigning, they will be equidistant from the collision point
6) If at any node ptr1 meets ptr2, then it is the intersection node.
7) After second iteration if there is no intersection node it returns NULL.

TC : O(m+n) where m=Length of LL-1 and n=Length of LL-2
SC : O(1)

Try solving now

3. Technical Question

Explain in brief the role of different MVC components?

Problem approach

The different MVC components have the following roles -
1) Presentation: This component takes care of the visual representation of a particular abstraction in the application.

2) Control: This component takes care of the consistency and uniformity between the abstraction within the system along with their presentation to the user. It is also responsible for communicating with all other controls within the MVC system.

3) Abstraction: This component deals with the functionality of the business domain within the application.

4. Technical Question

How routing is done in the MVC pattern?

Problem approach

There is a group of routes called the RouteCollection, which consists of registered routes in the application. The RegisterRoutes method records the routes in this collection. A route defines a URL pattern and a handler to use if the request matches the pattern.

The first parameter to the MapRoute method is the name of the route. The second parameter will be the pattern to which the URL matches. The third parameter might be the default values for the placeholders if they are not determined.

5. Technical Question

Is it possible to import the same class or package twice in Java and what happens to it during runtime?

Problem approach

It is possible to import a class or package more than once, however, it is redundant because the JVM internally loads the package or class only once.

03
Round
Medium
Face to Face
Duration60 Minutes
Interview date4 May 2019
Coding problem3

This round was inclined towards some Low Level Design Principles and some concepts from MVC.

1. System Design Question

Design a Railway Reservation System

Problem approach

Tip 1 : Firstly, remember that the system design round is extremely open-ended and there’s no such thing as a standard answer. Even for the same question, you’ll have a totally different discussion with different interviewers.
Tip 2 : Before you jump into the solution always clarify all the assumptions you’re making at the beginning of the interview. Ask questions to identify the scope of the system. This will clear the initial doubt, and you will get to know what are the specific detail interviewer wants to consider in this service.
Some standard steps that are being followed with respect to this question are :
1) The first step is to provide the total number of passengers and submit all the necessary details of the passengers.
2) The next step is to enter the source and destination.
3) A list of available trains will appear. Among them, the user has to choose one.
4) The ticket value will be evaluated. The system will ask to enter the seat choice by showing the seat matrix. At last, a receipt will be generated on the screen.
Design your structure and functions according to the requirements and try to convey your thoughts properly to the interviewer so that you do not mess up while implementing the idea .
Finally , for acing System Design Rounds I would suggest watching Gaurav Sen's System Design Videos on YouTube and for hands on practice there is a Guided Path solely for System Design on CodeStudio which is very useful while preparing for these type of rounds.

2. Technical Question

What is Spring MVC?

Problem approach

1) The Spring MVC or Spring Web MVC can be defined as a framework that provides a “Model View Controller” (MVC) architecture in the application as well as ready-components implemented for developing adjustable and adaptable web applications. 

2) It is actually a Java-based framework intended to build web applications. It works on the Model-View-Controller design approach. 

3) This framework also makes use of all the elementary traits of a core Spring Framework such as dependency injection, light-weight, integration with other frameworks, inversion of control, etc. Spring MVC has a dignified resolution for implementing MVC in Spring Framework with the use of DispatcherServlet.

3. Technical Question

Define the concept of Filters in MVC?

Problem approach

There are situations where I want to implement some logic either prior to the execution of the action method or right after it. In that scenario, the Action Filters are used. Filters are used to determine the logic needed for executing before or after the action method gets executed. Action methods make use of the action filters as an attribute. Different types of MVC action filter are:

1) Action filter (that implements the IActionFilter)
2) Exception filter (that implements the IExceptionFilter attribute)
3) Authorization filter (that implements the IAuthorizationFilter)
4) Result filter (that implements the IResultFilter)

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
Server Technology Engineer
2 rounds | 3 problems
Interviewed by Oracle
1998 views
0 comments
0 upvotes
company logo
Senior Application Developer
2 rounds | 3 problems
Interviewed by Oracle
1468 views
0 comments
0 upvotes
company logo
Associate Consultant
3 rounds | 3 problems
Interviewed by Oracle
939 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Oracle
1727 views
0 comments
0 upvotes