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 ] signify revenue from store within the previous metropolis and new metropolis respectively at day i+1. You need to shift the store from the previous metropolis to the brand new metropolis such that the entire 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 entire 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 absolutely glad with the strategy then he informed me to do the code. After I was finished 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.