Skip to main content
All Questions

Tree Node.

Easy
Unlock detailed company stats for this questionUpgrade

Given a binary tree, identify which nodes are leaf nodes, root nodes or inner nodes.

  • Leaf nodes: A node with no children
  • Root nodes: A node with no parent
  • Inner nodes: A node with both children and parent nodes

You are given the following table tree_node_table:

idp_id
integerinteger

where p_id is the id of the parent node. Your output should contain the following columns: id, node_types (’Root’, ‘Inner’, ‘Leaf’).

Interview experiences

4 shared
Google · 5 months ago
"Pretty easy, just very long. For technical just need to do leetcode, no system design. Interviewers help you if you are stuck."
Software Engineer · Entry Level / L3
Microsoft · 5 months ago
"What went well: The live coding and system architecture rounds went smoothly. I was able to articulate my design choices clearly, especially around API design, database strategy, and maintaining high availability for microservices. What didn’t go well: The initial behavioral portion felt slightly rushed because we spent extra time discussing specific cross-functional project dynamics from my previous roles. How does this interview compare to other interviews you've done? It was significantly more interactive. Rather than giving static answers, the interviewers actively challenged my assumptions and asked "what if" scenarios, making the evaluation feel comprehensive and realistic to day-to-day work."
Machine Learning Engineer · Entry Level / L3
Meta · 2 years ago
"My interview process started with a CodeSignal GCF online assessment that had four sections with increasing difficulty. The earlier sections were more straightforward and focused on implementation speed and correctness, while the later sections required more problem-solving depth and handling more complex constraints under time pressure. After that, I had a technical interview consisting of two LeetCode-style medium questions in a 45-minute session. The focus was on both arriving at efficient solutions and clearly communicating my thought process while working through each problem. What went well was my ability to understand the problems quickly and stay consistent across different difficulty levels. What didn’t go as well was pacing, especially in balancing correctness and optimization within the time limits."
Software Engineer · Intern
Infosys · 2 years ago
"The process was smoooth and easy.Phone round followed by a technical interview.I got the offer but i didnt accept it"
Software Engineer · Entry Level / L3

Related courses

Course

Machine Learning Engineer Interview Prep

Land your dream machine learning role at Meta, Google, Amazon, Apple, Microsoft, Nvidia, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates. Explore ML system design, core concepts, coding, behavioral interviews, and more.

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.