Given a binary tree root and function which prints the value of the node at the (x,y) position in the screen, write a function to print the entire tree in the screen. A lot of edge cases to take care here... 1. The resolution of the screen (its dimensions). 2. Cannot collapse two values at the screen. 3. How do you take care of large numbers on the same vertical line? 4. This was the follow-up question. Maybe it was because I first started with using the same distance for all the children at the same level. The question was to optimize the distance used. For example to use only distance 1 if I didn't need more. Some examples to understand what I talking about. 1 d=1 / \ d = 1 2 3 1 / \ d = 2 / \ 2 5 / \ / \ d = 1 3 4 6 7 You can not use d=1 at the first level because 4 and 6 will collide.
Software Engineer New Grad Interview Questions
3,069 software engineer new grad interview questions shared by candidates
Copy a linked list Make an iterator
4*1 algorithm questions related to linked-list, binary search tree, vector and so on
best meeting point for the clients, analyzing the black box data for a truck to calculate the distance traveled at a specific time, no. of input modules to build a project
Problems related to graphs and mathematical coding questions
What was challenging about the project?
find 2 missing numbers in an array of n size containing numbers from 1 to n wihtout using basic ops. (xor to be used)
Typical algorithms/data structures problems. System Design/REST APIs/Databases
recursion
DP (LC med), Two pointer (LC med), String manipulation (LC hard), Data structs (LC med), Trees (LC hard)
Viewing 1561 - 1570 interview questions