Oracle Interview DS questions

oracle logo
oracle
software role
April 1, 20256 reads

Summary

I recently interviewed with Oracle for a software role, and it was a great learning experience where I encountered several coding questions testing my problem-solving skills, data structures, and algorithmic thinking.

Full Experience

I recently had the opportunity to interview with Oracle for a software role, and it was a great learning experience! Here are some of the coding questions I encountered during the process:

1️⃣ Remove the minimum number of parentheses for a valid string

Given a string containing parentheses, the goal is to remove the minimum number of invalid parentheses to make the string valid. Hint:-The solution requires efficient use of stacks or DFS.
2️⃣ Stock Price Tracker

You are given a stream of records about a particular stock. Each record contains a timestamp and the corresponding price of the stock at that timestamp. You need to implement the Stock Price class that supports the following operations:
Update the price of the stock at a given timestamp.
Retrieve the latest stock price (price at the latest timestamp recorded).
Retrieve the maximum stock price recorded so far.
Retrieve the minimum stock price recorded so far.
Hint:-This problem can be efficiently solved using a combination of hash maps and priority queues.

3️⃣ Maximum Path Sum in a Binary Tree

Given a binary tree, find the path with the maximum sum. The path can start and end at any node.
Hint:- The solution involves a depth-first search (DFS) traversal while keeping track of the maximum sum encountered.

These questions tested my problem-solving skills, data structures, and algorithmic thinking. Overall, it was a great experience!

If you’re preparing for coding interviews, I highly recommend practicing these types of questions. Feel free to drop a comment if you have any thoughts or if you’ve faced similar challenges in your interviews!

#Oracle #InterviewExperience #CodingInterview #DataStructures #Algorithms #SoftwareEngineering

Interview Questions (3)

Q1
Remove Minimum Number of Parentheses for Valid String
Data Structures & Algorithms

Given a string containing parentheses, the goal is to remove the minimum number of invalid parentheses to make the string valid. Hint:-The solution requires efficient use of stacks or DFS.

Q2
Stock Price Tracker
Data Structures & Algorithms

You are given a stream of records about a particular stock. Each record contains a timestamp and the corresponding price of the stock at that timestamp. You need to implement the Stock Price class that supports the following operations:
Update the price of the stock at a given timestamp.
Retrieve the latest stock price (price at the latest timestamp recorded).
Retrieve the maximum stock price recorded so far.
Retrieve the minimum stock price recorded so far.
Hint:-This problem can be efficiently solved using a combination of hash maps and priority queues.

Q3
Maximum Path Sum in a Binary Tree
Data Structures & Algorithms

Given a binary tree, find the path with the maximum sum. The path can start and end at any node. Hint:- The solution involves a depth-first search (DFS) traversal while keeping track of the maximum sum encountered.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!