Oracle interview prep

Practice 30 problems from community-reported Oracle interviews.

Ranked problems

30 problems
Oracle interview prep, ordered by rank
ProblemDifficultyCompany lists
Data structure design

Design a fixed-capacity cache with constant-time reads and writes. When it fills up, evict the least recently used key.

On the Amazon, Microsoft, Samsung, Oracle, J.P. Morgan, Morgan Stanley lists.

Medium
Hash tables

Find the indices of two different elements in an array whose values add up to a given target.

On the Amazon, Google, Microsoft, Meta, Samsung, Tekion, IBM, Oracle, J.P. Morgan, Morgan Stanley lists.

Try [2, 7, 11, 15] with a target of 9.

Reveal the indices

[0, 1] points to 2 and 7.

Easy
Sliding window

Find the length of the longest contiguous stretch of a string in which no character appears twice.

On the Amazon, Google, Microsoft, Meta, Tekion, IBM, Oracle, J.P. Morgan, Morgan Stanley lists.

Medium
Graph traversal

Count the connected patches of land in a grid. Cells connect horizontally or vertically.

On the Amazon, Microsoft, Samsung, Oracle lists.

Medium
Hash tables

Group words that contain exactly the same letters with the same counts, regardless of order.

On the Amazon, Google, Meta, Oracle, J.P. Morgan, Morgan Stanley lists.

Medium
Counting

Return the k distinct values that occur most often in the input array.

On the Amazon, Oracle lists.

Medium
Monotonic queue

Slide a window of k elements across an array one position at a time and return the largest value in each window.

On the Microsoft, Oracle, J.P. Morgan lists.

Hard
Heaps

Combine k sorted linked lists into a single sorted linked list containing all their nodes.

On the Amazon, Oracle lists.

Hard
Stacks

Check whether a string of round, square, and curly brackets closes every opening bracket in the correct order.

On the Amazon, Google, Microsoft, Meta, IBM, Oracle lists.

Easy
Intervals · LeetCode Premium

Given meeting start and end times, find the fewest rooms needed so every meeting can run on schedule.

On the Tekion, Oracle, J.P. Morgan lists.

Medium
Binary search

Find a target in a rotated ascending array of distinct values in logarithmic time. Return its index or −1 if absent.

On the Amazon, Oracle lists.

Medium
Data structure design

Implement a fixed-capacity cache that evicts the least frequently used key, choosing the least recently used key when frequencies tie.

On the Oracle list.

Hard
Intervals

Combine overlapping intervals and return a list that covers the same ranges without overlaps.

On the Amazon, Microsoft, IBM, Oracle, J.P. Morgan, Morgan Stanley lists.

Medium
Linked lists

Reverse the links in a singly linked list and return its new head.

On the Oracle list.

Easy
Stacks

Repeatedly delete k adjacent copies of the same character, including groups formed when deletions bring characters together.

On the Oracle list.

Medium
Strings

Return the longest contiguous part of a string that reads the same forward and backward.

On the Amazon, Google, Microsoft, Meta, Tekion, IBM, Oracle, J.P. Morgan lists.

Medium
Two pointers

Choose two vertical lines that, together with the x-axis, can hold the greatest area of water.

On the Amazon, Google, Microsoft, Meta, IBM, Oracle lists.

Medium
Two pointers

Find every distinct triple of values that adds up to zero, using three different positions in the array.

On the Amazon, Google, Microsoft, Meta, Samsung, Oracle, Morgan Stanley lists.

Medium
Arrays

Return every entry in a rectangular matrix in clockwise spiral order, starting at the top-left corner.

On the Oracle, Morgan Stanley lists.

Medium
Stacks

Expand a string with nested repetitions, where a number before brackets repeats the contents that many times.

On the Oracle list.

Medium
Stacks

Simulate collisions between asteroids moving left or right along a line. Larger asteroids survive a collision and equal sizes destroy each other.

On the Oracle list.

Medium
Dynamic programming

Find the largest sum you can make by taking a nonempty, contiguous part of an array.

On the Amazon, Google, Microsoft, Meta, Tekion, Oracle lists.

Medium
Counting

Find the first adjacent pair of different digits where each digit occurs exactly its own numeric value of times in the full string.

On the Oracle list.

Easy
Binary search

Find the slowest whole-number eating speed that finishes all the piles on time. Each hour can be spent on only one pile.

On the Amazon, Google, Oracle lists.

Medium
Data structure design

Build a stack that can push, pop, read its top, and report its current minimum, each in constant time.

On the Oracle list.

Medium
Trees

Return the value visible at each depth when looking at a binary tree from its right side.

On the Oracle list.

Medium
Hash tables

Decide whether two strings contain exactly the same characters with the same multiplicities.

On the Google, Microsoft, Meta, IBM, Oracle lists.

Easy
Heaps

Support inserting numbers into a stream and retrieving the median of all numbers seen so far.

On the Tekion, Oracle lists.

Hard
Data structure design

Store timestamped versions of a key’s value. For a lookup, return its newest version at or before the requested time.

On the Oracle list.

Medium
Data structure design

Implement expiring tokens with operations to generate a token, renew an unexpired token, and count tokens still valid at a given time.

On the IBM, Oracle lists.

Medium
How are questions ranked?

Company lists follow community-reported interview frequency. Ties keep the source order. Where a list uses two sources, we keep the first list’s ranks and fill the remaining places with the highest-ranked distinct problems from the second.

Across companies, first place earns 30 points and each subsequent rank earns one fewer. We add each problem’s points and break ties alphabetically.

  • Oracle · All time · 21 October 2026