Full Prep Oracle

Anonymous User
2854
Sep 20, 2025

Oracle


DSA question: [DSA]

Divide 2 positive integers without using / operator.Gave naive approach of repeated subtraction. Probed on time complexity.

https://leetcode.com/problems/divide-two-integers/description/

-Leetcode medium 2D matrix based dp problem

-Java multithreading questions and one standard problem on multithreading (Printing even odd using two threads)
return subsequences in sorted ordet without empty strings + experience questions

LFU cache

Find to k frequent elements

Like we need to find all the pairs of nodes (u, V) in the graph which is a tree .
Given all edge weights of edges array and each node values array .
The conditions are where u is ancestor of V and edge weight(u, V) <= value[v]

Jump Game all variations
https://leetcode.com/problems/divide-two-integers/description/
Longest Subarray with 0 Sum - question from GFG

Q: Remove duplicate sequence from linked list.
Ex:
Input: 1->2->2->2->5->4->4, output: 1->5
Input: 1->1->2->2->2->5->4->4, output: 5

-Leetcode medium 2D matrix based dp problem
-Java multithreading questions and one standard problem on multithreading (Printing even odd using two threads)

Given a String s, build all possible subsequences, sort them and return as a List
Create a Thread safe data structure and write 2 producer and 1 consumer for it.

Problem 1: https://leetcode.com/problems/merge-intervals/description/ (LeetCode)
Problem 2: Find the duplicate in an array of size n with elements in [0, n-1].
Expected solution: Efficient swapping approach (similar to https://leetcode.com/problems/find-the-duplicate-number/description/).

Problem 1: Validate parentheses in a string (basic () case).
Follow-up: Extended to multiple types ((), [], {}).
Problem 2: Given an employee hierarchy (tree structure), find all reports under each manager.
Follow-up: Reverse lookup (find all managers for a given employee).

Coding Problem: Multiply two very large integers represented as strings (e.g., "123456789" * "987654321").

Given a phone dictionary. Implement 3 operations
Add unique names to phone dictionary
Return all names from dictionary
Find all names starting b/w character range
For this problem i started with a simple HashMap to store unqiue names. And for finding names b/w range i proposed to use additional data-strucure to store character and name mapping(HashMap)
Later on improvement. I proposed a BST based solution. I was able to implement first 2 functionalities, for 3rd one i just gave the psuedo code.

Given two arrays, sort without extra space
A = [10, 2, 20, -1]
B = [1, 5, 25]
Output:
A = [-1, 1, 2, 5]
B = [10, 20, 25]
https://leetcode.com/problems/regular-expression-matching/description/

Buy and Sell Stock - and its further variations Buy and Sell Stock II, Buy and Sell Stock III.
House Robber - and its variation House Robber II, .
Single Number - and its variation Single Number III (difficult to arrive at if you haven't practiced bit manipulation. I had done this question earlier, so knew the concept behind it.)

Generate String with Valid Parentheses - Given a number n, generate all valid combinations of parentheses.
Fruit Into Baskets problem.

Started with the classic Leetcode question: Find the missing number, followed by a variation where multiple numbers could be missing.

DSA: question 1 : Given list of jumps that the frog can make sequentially on stairs(could have negative value) starting at stair 1 give the smallest stair no. the frog has to be on so that jumping all the jumps will still keep the frog on positive stair no.
eg: jumps:[-5,1,2,1-6] : output : 8
1≤ stairs<10^5
Was able to to solve using binary search, did optimization after a hint
Hint: if we start with smallest stair say x (smallest value = 1) and every time the result dips below 0 you add that value back in x that way x will always be smallest value, TC would be O(n) by this approach

DSA: question 2 : Given encoding of the string give the count of each character from 0 to 25, eg: abcd → incoded as input : “1234” : output: [1,1,1,1,0,0,0....0], eg: aabbz → intput: 1(2)2(2)25# : output: [2,2,0,0,....,1]

tells two digits should taken into consideration together like 25# for z, 24# for y, etc.

Was able to solve this by iterating from right to left, missed few edge cases though, that I fixed later on.

Round 3: Data Structures & Algorithms

Leaders in Array Variant:
Solved a variation of the classic "Leaders in an Array" problem.
String Encoding Question:
Given input like 12(2)3(2)10#, decoded it into abbcccj.
Focus was on parsing and converting numerical and symbolic patterns into their corresponding characters.
Round 4: Data Structures & Algorithms

Integer to Roman Conversion:
Implemented a highly optimized solution for converting integers to Roman numerals without hardcoding mappings, leveraging arrays and modular logic.

Implemented a Binary Search Tree with logic to rebalance the tree after every insertion and deletion (e.g., using AVL or Red-Black Tree concepts).

https://leetcode.com/problems/basic-calculator/description/
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/description/
https://leetcode.com/problems/remove-invalid-parentheses/description/
https://leetcode.com/discuss/post/6677180/interview-experience-oracle-salesforce-o-7zo3/ : check again
https://leetcode.com/discuss/post/6963253/oracle-front-end-developer-interview-by-r42wr/
https://leetcode.com/discuss/post/6957356/oracle-oci-smts-ic3-screening-round-by-d-z59x/

Longest Increasing Subsequence (LIS) : Optimized
Find the nth node from the back of a linked list – solved using two pointers.
Find the Lowest Common Ancestor (LCA) in a binary tree – solved using DFS.
Find all pairs of numbers whose sum is divisible by 60 – solved using complements and hashing.

He explained about the project and some interaction happend and asked the question for converting number to roman numeral.
I gave a solution using Separate Mapping for all 1000,900,500,400 etc.
Then he asked to keep only mapping of 1000,500 etc and not the combinations.
So I just gave a solution with hardcoding the value, and he was not satisfied with it. He wanted it to be "Extensible"
I could not come up with it.
Then he said, for 1000 the next is at index +2 and so on
and for 500, the next is at index +1 and so on.
I coded the solution for it
But I argued with him, you cannot call it extensible as there is no defined rule the for even indexes the subtraction one will be at +2, and for odd it will b at +1. Tomorrow I can say 950 will have its separate pattern.
My point being if he wanted an "extensible" solution, he should not have started with roman numerals as they are fixed and no one is extending them, and his approach cannot be called fully extensible either.
I didnt think of it much as I anyway had given a correct solution (although not extensible).
The interviewer was very friendly

Question : find cycle in linked list
I gave slow/fast pointer and HashSet apporoach => He wanted another approach as well but anything else didnt come to my mind.
Question : sum of value of all leaf nodes in binary tree
=> I implemented it but then he clarified he asked for sum of the deepest level only so I modified the solution within a minute.
I gave recursive solution for both and did dry ru

Q: A conference will be for d days. A schedule of n interviews is given with 3 arrays for start, end and knowledge gained. The interview start time and end time are in days and each day the maximum number of meetings allowed to is k. I need to maximize knowledge gained.
-> Solved fully

[DBMS]

https://leetcode.com/discuss/post/7039500/dbms-fundamentals-you-should-have-a-deep-4fgp/


===============================================================
Java and Multithreading

Asked me difference between HashMap and ConcurrentHashMap.
Explained him about the thread safety, segment locking, ConcurrentModificationException etc.
Interview ended 15 min early as he was done judging.

-Java multithreading questions and one standard problem on multithreading (Printing even odd using two threads)
Deep Dive on current project. Why/What/How of everything.
How would you rate yourself in Java?

Why is java platform independent?
What is a hash map?
What does .equals in hashmap do ?
Difference btw abstract interface
What is threads?
What is asyn programming?
creates 2 threads
create kind of producer and consumer to count odd and even numbers one by one (wait/notify was used)

exceptions, errors
create immutable class
deadlock
All solid principles with example
factory, abstract factory
encapsulation vs abstraction
actuator, dispatcher servlet =>
asked a bit about api query params path variable request body
cloneable, serializable, transient
Implement immutable class, use of final keyword in different places

create singleton class with thread safetly
Follow up: How do you prevent creating clones of the singleton class object?

Differences between PUT, PATCH, and POST
When and why to use each
Deep dive into the OPTIONS HTTP method
Why and how it's used (CORS preflight, etc.)

Polymorphism in Java, how to acheive
Composition & Association
Aggregation
Aggregation vs Composition

SOLID Principles – explained each in depth
Abstract Class vs Interface
Asked for real-world, non-programming examples (e.g., appliances, contracts vs blueprints)

What are messaging queues? Give examples.
What is AOF and RDB in Redis? Explain the differences.
Why do we need Redis when programming languages already have hashmaps?

Redis Cache (eviction policies, clustering)
Kafka (consumer groups, partitioning, offset management)
REST API Security (OAuth 2.0, JWT, rate limiting)
High-level system design aspects of past projects.

Kafka (message retries, ordering guarantees)
Blue-Green Deployment (strategies, advantages)
High availability, throughput, and latency optimizations

how load balancers work, caching, API gateways etc.

Write a class where each object has a unique ID. Copying/assigning an abject should also lead to unique ID. Could not implement it fully.

Are you familier with Multi-Threading?
Do you have any idea about ExecutorService?
I want to Design ATM by help of ExecutorService where Multiple user simultaneously can withdraw money. But we have to taken care of money available in ATM that if no Money available then user won't be able to withdraw that and also for simultaneous users, it will synchronous

We're given a String. I want to find the maximum distance between to repeatative words
String str = "Hello Param Welcome to Oracle Param is from Ahmedabad Param is Java Developer";
Among this, Distance Between "Param" keyword is having the highest distance between first repeated iteration and last repeated iteration.

Definitions and real-world implementation of core design patterns like Singleton, Factory, Observer, and Strategy were discussed.

Project and then API design for scenio based question
in depth spring and db concepts like 2PC , Review Saga why
concurrency, how do you maintained in disctributed environment
How to handle batch procssing and concurrency.
All crud api with actual params and input.
some minor here nad there like spring security, how to manage custom pagination in method other than db , which class is used.
create a BST inorder and tree as well, unclear question time up by the time completed

Java based questions like difference between final and finally, traditional try-catch block and try-catch block with resources,
Lambdas and functional interfaces,
Some stream based questions involving map and reduce -> quite basic stuff
GC models -> i did some work involving migrating Services to JDK 17 maybe that's why
Spring Questions -> DI, Spring Security, How we call another microservice from a microservice (Feign client)
Some SQL questions -> he asked me to write some join queries i told him i am not in practice with SQL and have never worked with SQL in a professional settinh

How have you calculated performance and throughput in your project.
Discussion of projects.
Have you used reactive programming ? Have you used async programming ? completablefuture ?
What is the difference between REST and HTTP ?
Given 2 strings consisting of numbers, multiply the numericals and store it in string, and numbers are such that no primitive data type or bigInteger can store it.

How to conditionally intialize a bean for a given environment (dev, staging, prod) - @ConditionalOnProperty

For a service if there are millions of messages in a queue that you want to process how will you process them? - I suggested CompletableFuture. There were follow-up questions on it:

Cons of using CompeltableFuture.
ExecutorService vs CompletableFuture
How will you ensure you store the timestamp when the event was received using completableFutue as it is async.
SOLID Principles - Explain using examples from your codebase

What is ConcurrentHashMap and SynchronizedMap and difference between these.
What is BlockingQueue and SynchronizedQueue and difference between these.
What is a bean? What are bean scopes? Tell the difference about different bean scopes.
Tell me about a time you had a conflict at work

This round started with intro, questions from resume around rabbitmq, spring db connections, Singleton design pattern and few more and 2 DSA questions.

Technical questions were asked:
What is Stateful and Stateless APIs ?
What is reflection?
Got quizzed around different error codes: 4xx, 5xx, 2xx.
What is multidimensional array? Real life application?
What is hashtable? How is it different from HashMap? Real life application?
What is linkedlist? How is it different from array? Real life application of linkedlist? Time complexities on LL traversal etc.
What is circuit breaker? Explain.
How do you reverse a linkedlist?

Some questions on Elasticsearch and streaming pipelines based on my project.


LLD + HLD

SAGA & orchestration
how to handle cascade failure in the third party integration

Round 3

All about current project
what is redis cache?
difference between memcache & Redis cache
Design LRU Cache
Design Booking System such as BookMyShow
Inter Microservice communication
Puzzle to know about defective jar using minimum weighing machine.
Round 4

LLD Question (Need to create Reader Utility which accepts source and format.) Need to write extensible, open for modification code.)

Source such as DB, API, File etc and format can be JSON, XML, csv

More questions around code.

which design pattern followed

main categorisation of design patterns

factory and behavioural design patterns

If logic of calling API already exists and how we can reuse them?

Spring Bean lifecycle

postconstruct + predestroy difference

spring aop

spring and spring boot

SQL vs NoSQL – when to use which, pros/cons, CAP tradeoffs

Design an alarm notification system like AWS alarms

a live counter problem.

-Design BookMyShow HLD and LLD both, discussed multiple scenario in design
System design question for bookmyshow kind of service. was mostly interested in requiremnets and api design
She wanted API request type, request body, response body all.
She asked to skip db schema, estimations as time was less
at the end asked to create the hld diagram

I was told to draw the HLD for a social media posting app like instagram. I completed following:
Functional Requirements
Non Functional Requirements
DB Schema
DB resilient design
Services
Diagram
We discussed DB choices and reasoning, design decisions, CAP theorem etc.

Lastly, I was told to draw the HLD for an ECommerce website like Amazon. Expectations:

Email Notification Service (SMTP, DLQ handling)

Design a messenger application
Design a cloud storage Application

Design movie recommendation app. Write some code for user registration module

Low-Level Design (LLD) - Music Streaming App (Spotify)

Then moved on to HLD: I was asked to design a URL Shortener Service.

Add to Cart – Given a system design, I had to identify bottlenecks and suggest latency improvements.
BookMyShow Design – I was asked to design the API, schema, and high-level architecture.
LLD Implementation – Given an interface, I had to implement two classes.

Design twitter like system, follow up questions on scaling, load balancing, latency of tweeter feed and search, database schema design related question.

System design: Design ecommerce like application (amazon or flipkart)
In depth discussion on the search feature of the application
like search optimization using elastic search, various authentication mechanisms for the application.

High-Level Design:
Designed a Healthcare Medicine Recommendation System that suggests medications based on a patient’s disease and medical history.
Covered components like data ingestion, rule engine for recommendations, caching strategies, database schema, and handling scalability.

Design whatsapp using AWS Services(preferrably)

System Design (HLD + Scalability Concepts):
Deep discussion on:
Scalability techniques
Apache Kafka for event-driven architecture
Circuit Breaker Pattern for fault tolerance
Saga Pattern for managing distributed transactions in microservices

All these Design problems (Rounds 1,2,3) were System Design problems, like "design TinyURL".

Round 1: Design Distributed LFU Cache
Round 2: Design Distributed LRU Cache
Design Metrics and Monitoring System

Design Whiteboard (25 min was alloted for this)

System Level Design

The hospital has multiple wards.
Every ward has patients.
Every ward is managed by a group of Nurses
If a medicine is to be given to the patient, the nurse would do it.
Doctors come to see patients check medicines, what new medicine to give, and cancel any existing medicine.
Doctors use an app to place orders for medicine.
Medicine A should 2 times a day to 3 patients (6 tasks)
First day morning - evening

Nurse has a dashboard and see task that which medicine is to be given to the patient
on time and mark the task as done.

There are 4 major parts we have in our system,

Order management system responsible for searching, modifying and canceling order.
An App to place, modify and regenerate orders.
Task management system, show which task is created.
Internal dashboard shows which task has done, yet to be done.
Scale:
10000 patients in one hospital
There can be multiple hospitals as well in the city.

Design a High-Level System design supporting the below use case,

Highly Scalable
low latency
Availability
Fault Tolerant
APIs Design
Work-flow Design


Bartender Round

Question on disagreement with seniors.
You have a 3L jug and a 5L jug with infinite water supply. Measure exactly 4 liters without any measuring marks.
Behavioral / Scenario Questions:

Where do you see yourself in 5 years?

If you were a tech lead, how would you manage your team?

How would you handle a situation where a team member is absent, manpower is short, and a deadline is approaching?

Do you have plans for pursuing MS in the future?

What are some real-life applications of data structures?

How do you handle conflicts with teammates?
Why are you leaving your current organization?
What will be your reaction if you don’t get promoted to SDE3?

Comments (3)