The question was, given a binary tree, and a node, you burn that node at time t = 0. At time t = 1, all the neighbours of the node are burnt too as the fire spreads in all directions (ie burning child and parent of that node). Each burning node will burn all its neighbors in next second. Task: Find total time to burn the tree. I solved it using a hashmap. The connection to children exists via nodes, all you need is a connection to the parent, for which I used a hashmap. PS:- I learnt this from Striver. He has video on this exact same question.
Development Intern Interview Questions
5,462 development intern interview questions shared by candidates
tell us about your latest project
A question based on local storage
Tell me about a recent achievement
Implement the following: - Kadane's Algorithm (Round 2) - Sort the array half ascending, half descending (Round 3)
What would you like to do at NASA?
How do you resolve conflicts?
Related to full stack and linked lists
What coursework have you taken that is relevant to the position?
Why do you want to join TravClan?
Viewing 3921 - 3930 interview questions