Technical-Spherical (Length-1hr):
- Introduction
- Diameter of Tree
- Given two arrays old_profit and new_profit of size n the place old_profit[ i ] and new_profit[ i ] characterize revenue from store within the outdated metropolis and new metropolis respectively at day i+1. It’s a must to shift the store from the outdated metropolis to the brand new metropolis such that the whole revenue is most. Discover the utmost revenue.
Instance:
old_profit = [5 , 25, 10, 7 , 9 , 11] new_profit= [10 , 5, 11, 13, 7, 14] Output: 75 Rationalization: Day - Revenue 1 - 5 2 - 25 Now shift the store to new place 3 - 11 4 - 13 5 - 7 6 - 14 So the whole most revenue turns into 75
- Would you have the ability to change to a different language?
NOTE:
- Firstly Interviewer requested me for an strategy as soon as he was totally happy with the strategy then he advised me to do the code. Once I was performed with coding, he gave me some take a look at instances to dry run. After that, he requested me about house and time Complexity of code.
- I used to be free to code in any language ( I selected Python).
- There was just one interview spherical.