Oracle Interview Round 1 | Senior Platform Engineer
Summary
I interviewed for a Senior Platform Engineer position at Oracle; round 1 included a sliding-window coding problem and a SQL tree‑classification question.
Full Experience
Interview Questions I Got
1. Maximum of Minimums of Every Window
Given an array A of size n and an integer x:
- Consider every continuous subarray of length
x. - Find the minimum element in each window.
- Return the maximum among all those minimums.
Example:
A = [1, 3, -1, 5, 3, 6]
x = 3
Windows:
[1, 3, -1] -> min = -1
[3, -1, 5] -> min = -1
[-1, 5, 3] -> min = -1
[5, 3, 6] -> min = 3
Answer = 3
Core pattern: Sliding Window + Monotonic Deque.
The tricky part is recognizing that we need to maintain the minimum of the current window efficiently rather than recomputing it for every window.
2. SQL - Classify Nodes in a Tree
Given a table:
id pid
1 NULL
2 1
3 1
4 2
Where:
id= node IDpid= parent ID
Classify every node as:
- Root -> has no parent
- Inner -> has at least one child
- Leaf -> has no children
Expected result:
1 -> Root
2 -> Inner
3 -> Leaf
4 -> Leaf
The concept itself was straightforward.
The tricky part was writing the SQL correctly - especially determining whether a node appears as someone else's pid and combining that with the NULL parent condition.
A typical approach is to use:
CASE
WHEN pid IS NULL THEN 'Root'
WHEN id IN (SELECT pid FROM Tree WHERE pid IS NOT NULL) THEN 'Inner'
ELSE 'Leaf'
END
Interview Questions (2)
Maximum of Minimums of Every Window
Given an array A of size n and an integer x, consider every continuous subarray of length x. Find the minimum element in each window and return the maximum among all those minimums.
Example:
A = [1, 3, -1, 5, 3, 6]
x = 3
Windows:
[1, 3, -1] -> min = -1
[3, -1, 5] -> min = -1
[-1, 5, 3] -> min = -1
[5, 3, 6] -> min = 3
Answer = 3
Core pattern: Sliding Window + Monotonic Deque.
SQL - Classify Nodes in a Tree
Given a table with columns id (node ID) and pid (parent ID), classify each node as:
- Root: has no parent (
pidis NULL) - Inner: has at least one child (its
idappears as another row'spid) - Leaf: has no children.
Example input:
id pid
1 NULL
2 1
3 1
4 2
Expected output:
1 -> Root
2 -> Inner
3 -> Leaf
4 -> Leaf