Oracle IC3 interview

Posted
2 Sept 2026
129 reads

Summary

I was asked to construct an N-ary tree from a balanced-parentheses string during an Oracle IC3 interview.

How it went

Construct an N-ary Tree from Balanced Parentheses

I recently encountered this interview problem for oracle IC3 interview:

Given a balanced-parentheses string, construct and return the root of an N-ary tree. Each matching () represents a node, and parentheses directly nested inside it represent its children.

Example:

(()()(()))

A stack-based solution can construct the tree in O(n) time:

  • On (, create a node and add it to the current parent’s children.
  • Push the new node onto the stack.
  • On ), pop the completed node.
  • Return the first node as the root.

Questions asked (1)

  1. 01

    Construct an N-ary Tree from Balanced Parentheses

    Data Structures & Algorithms

    Given a balanced-parentheses string, construct and return the root of an N-ary tree. Each matching () represents a node, and parentheses directly nested inside it represent its children.

    Example: (()()(()))

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Oracle recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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