Friday, September 30, 2022
HomeWordPress DevelopmentAmazon Interview Expertise for SDE (On-Campus)

Amazon Interview Expertise for SDE (On-Campus)


View Dialogue

Enhance Article

Save Article

Like Article

View Dialogue

Enhance Article

Save Article

Like Article

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 ] symbolize revenue from store within the previous metropolis and new metropolis respectively at day i+1. It’s a must to shift the store from the previous 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
Clarification:

 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 be capable to swap to a different language?

NOTE:

  • Firstly Interviewer requested me for an method as soon as he was totally happy with the method then he instructed me to do the code. After I was finished with coding, he gave me some check instances to dry run. After that, he requested me about area and time Complexity of code.
  • I used to be free to code in any language  ( I selected Python).
  • There was just one interview spherical.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments