₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,328,201 members, 8,434,608 topics. Date: Friday, 26 June 2026 at 10:52 PM

Toggle theme

Nigerian Developers How Did You Master Algorithm And Problem Solving - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingNigerian Developers How Did You Master Algorithm And Problem Solving (2544 Views)

1 Reply (Go Down)

Nigerian Developers How Did You Master Algorithm And Problem Solving by Guest911(op): 12:51pm On Jan 09, 2020
I've been invited for several interviews the blocker has always been algorithms. How did you guys overcome this? Practical guide preferred
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by progeek37(m): 3:35pm On Jan 09, 2020
Join my tutorial and coding group. Check my post for details.
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by gbolly1151(m): 6:18pm On Jan 09, 2020
Guest911:
I've been invited for several interviews the blocker has always been algorithms. How did you guys overcome this? Practical guide preferred
Can you share those algorithm questions?
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by Guest911(op): 6:25pm On Jan 09, 2020
gbolly1151:
Can you share those algorithm questions?
Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made from buying and selling that stock. You're also given a number fee that represents a transaction fee for each buy and sell transaction.

You must buy before you can sell the stock, but you can make as many transactions as you like.

For example, given [1, 3, 2, 8, 4, 10] and fee = 2, you should return 9, since you could buy the stock at 1 dollar, and sell at 8 dollars, and then buy it at 4 dollars and sell it at 10 dollars. Since we did two transactions, there is a 4 dollar fee, so we have 7 + 6 = 13 profit minus 4 dollars of fees.
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by Guest911(op): 1:37pm On Jan 10, 2020
Where the Nairaland developers Dey abeg
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by gbolly1151(m): 2:02pm On Jan 10, 2020
Guest911:
I've been invited for several interviews the blocker has always been algorithms. How did you guys overcome this? Practical guide preferred
I will advise you to check on google on:

1.how to write good algorithms and
2. study on data structure and algorithm

,there are many pdf online to learn from.
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by afuye(m): 9:09am On Jan 11, 2020
Chat me up on 0818_543_1319 and I will give u free tip to kill any Algorithmic challenges and Data structures questions
Guest911:
Where the Nairaland developers Dey abeg
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by afuye(m): 9:11am On Jan 11, 2020
Chat me up on 0818_543_1319 and I will give u free tip to kill any Algorithmic challenges and Data structures questions

Join my group
https:///GUMmjY8MQdO53SRhj1mcrO


Guest911:
Where the Nairaland developers Dey abeg
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by Nobody: 10:59am On Jan 11, 2020
Guest911:
I've been invited for several interviews the blocker has always been algorithms. How did you guys overcome this? Practical guide preferred
I experience the same sometimes around October last year. That has made me to get good books on data structure and algorithm.

Get this textbook. Crack coding interview 6th edition
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by Nobody: 11:02am On Jan 11, 2020
Guest911:
Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made from buying and selling that stock. You're also given a number fee that represents a transaction fee for each buy and sell transaction.

You must buy before you can sell the stock, but you can make as many transactions as you like.

For example, given [1, 3, 2, 8, 4, 10] and fee = 2, you should return 9, since you could buy the stock at 1 dollar, and sell at 8 dollars, and then buy it at 4 dollars and sell it at 10 dollars. Since we did two transactions, there is a 4 dollar fee, so we have 7 + 6 = 13 profit minus 4 dollars of fees.
racking my brain over the challenge.....
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by ToyinDipo(m): 6:29pm On Jan 11, 2020
Join hackerrank, you will get a lot of algorithms to practice from.
If you have any difficulty with a problem, view the discussion tab.
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by afuye(m): 6:06pm On Jan 12, 2020
This is easy just make sure u don't buy or sell below or at the given transaction price to make profit U can solve this by iteration of the array given!
Guest911:
Given a array of numbers representing the stock prices of a company in chronological order, write a function that calculates the maximum profit you could have made from buying and selling that stock. You're also given a number fee that represents a transaction fee for each buy and sell transaction.

You must buy before you can sell the stock, but you can make as many transactions as you like.

For example, given [1, 3, 2, 8, 4, 10] and fee = 2, you should return 9, since you could buy the stock at 1 dollar, and sell at 8 dollars, and then buy it at 4 dollars and sell it at 10 dollars. Since we did two transactions, there is a 4 dollar fee, so we have 7 + 6 = 13 profit minus 4 dollars of fees.
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by Guest911(op): 6:12pm On Jan 12, 2020
afuye:
This is easy just make sure u don't buy or sell below or at the given transaction price to make profit U can solve this by iteration of the array given!
Please attempt the challenge, what matters is your approach / thought process
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by etoluw: 9:26pm On Jan 12, 2020
Guest911:
Please attempt the challenge, what matters is your approach / thought process
which language you want make i write am
java, php or javascript?
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by MajorWarren: 5:29am On Jan 13, 2020
Thought I was a bit decent with arrays and arraylists but no idea how to get around this. This shows I’ve still got a long way to go smh.
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by etoluw: 3:04pm On Jan 13, 2020
i don fix am
you can test it here

http://shineforthmedia.com.ng/stock.php
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by makavele: 4:30pm On Jan 13, 2020
Guest911:
I've been invited for several interviews the blocker has always been algorithms. How did you guys overcome this? Practical guide preferred
99% of the time they dont' even wanna see you pass the algorithm test except it's a fairly easy and popular one . . like the stock one above, it's all over internet, matter of fact, all of them are . . . so they know you can cram and bulldoze your way through . .

What they want to see if your approach towards it . . did you bulldoze you way through and dropped an algo that runs in 0(n!) time?
or you refined your approach and ended with an O(1) algo . . . or you dropped both solutions and explained why the latter is better than the former?
etc

I'll pick solution #3, then #2 ... while #1 would be leaving the interview desk in any minute
Re: Nigerian Developers How Did You Master Algorithm And Problem Solving by jelel6: 11:05am On Jan 14, 2020
afuye:
This is easy just make sure u don't buy or sell below or at the given transaction price to make profit U can solve this by iteration of the array given!
Hi interesting question. There's a popular resource called Cracking the Coding interview. Many developers recommends it and I think it's a decent help.

Hope you don't mind my asking, the positions that are testing you with algorithm questions, are they local companies or foreign?
1 Reply

Aside Fintech, What Should Nigerian Developers Build ?Algorithm And Data Structure Study SectionFor Developers, How Did You Get Your First Remote Job And What Was The Pay.234

Final Year Project Topic In Mechanical Software ApplicationMy New Classic Chemistry Android AppI Just Lost An Upwork Gig Because Of NEPA