paint-brush
Apple stocks interview questionby@vadim-samokhin
2,727 reads
2,727 reads

Apple stocks interview question

by Vadim Samokhin3mJanuary 5th, 2018
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Recently I stumbled upon <a href="https://www.interviewcake.com/question/php/stock-price" target="_blank">this interview question</a> on <a href="http://interviewcake.com" target="_blank">InterviewCake</a>. Basically it goes like this: you have an array of stock prices, and you should calculate the highest profit you could get. For example, you have <em>[2, 1, 4, 10, 7]</em> — the highest profit is <em>10–1 = 9</em>. What I didn’t like about the problem was that it didn’t require to find minimum and maximum stock prices you could obtain the best profit with, just the highest profit itself. So I decided to solve it with this clause. Besides, I believe it requires to delve into the nature of this problem a bit deeper.

Company Mentioned

Mention Thumbnail
featured image - Apple stocks interview question
Vadim Samokhin HackerNoon profile picture
Vadim Samokhin

Vadim Samokhin

@vadim-samokhin

Aspiring object-thinker

Learn More
LEARN MORE ABOUT @VADIM-SAMOKHIN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Vadim Samokhin HackerNoon profile picture
Vadim Samokhin@vadim-samokhin
Aspiring object-thinker

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Bitcoininsider