Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,199 members, 7,780,342 topics. Date: Thursday, 28 March 2024 at 12:49 PM

Programming Logic Challenge - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Programming Logic Challenge (3096 Views)

Learn Microcontroller PLC Ladder Logic Programming With Ldmicro Free On Youtube / How To Write For Loop & If Logic Statements Inside React JSX / How To Code This Logic With Php... (2) (3) (4)

(1) (2) (3) (Reply) (Go Down)

Programming Logic Challenge by Nobody: 11:54am On Feb 01, 2020
So I found this in a book I'm reading and I'm quite curious how many of our resident developers can solve it.
By starting from the number 1 and repeatedly either adding 5 or multiplying by 3, an infinite amount of new numbers can be produced. How would you write a function that, given a number, tries to find a sequence of additions and multiplications that produce that number?
Would love to see some answers posted and of course. No cheating please. That only means you're cheating yourself right? wink
Re: Programming Logic Challenge by stanliwise(m): 1:30pm On Feb 01, 2020
crownedrookie:
So I found this in a book I'm reading and I'm quite curious how many of our resident developers can solve it.
By starting from the number 1 and repeatedly either adding 5 or multiplying by 3, an infinite amount of new numbers can be produced. How would you write a function that, given a number, tries to find a sequence of additions and multiplications that produce that number?
Would love to see some answers posted and of course. No cheating please. That only means you're cheating yourself right? wink
such a silly question.
Re: Programming Logic Challenge by Nobody: 1:54pm On Feb 01, 2020
stanliwise:
such a silly question.
If you're feeling particularly stupid and childish, you can always stick your finger in your nostril, give it a swirl and eat the proceeds. Displaying your foolish opinions is not necessary
Re: Programming Logic Challenge by stanliwise(m): 5:33pm On Feb 01, 2020
crownedrookie:

If you're feeling particularly stupid and childish, you can always stick your finger in your nostril, give it a swirl and eat the proceeds. Displaying your foolish opinions is not necessary
hahahahha, ain't it clear already... Haven't you noticed it yet?
Let me not waste my time jare.
Re: Programming Logic Challenge by resosdigital(m): 6:37pm On Feb 01, 2020
crownedrookie:
So I found this in a book I'm reading and I'm quite curious how many of our resident developers can solve it.
By starting from the number 1 and repeatedly either adding 5 or multiplying by 3, an infinite amount of new numbers can be produced. How would you write a function that, given a number, tries to find a sequence of additions and multiplications that produce that number?
Would love to see some answers posted and of course. No cheating please. That only means you're cheating yourself right? wink

Restructure the question for better understanding
Re: Programming Logic Challenge by Nobody: 11:19pm On Feb 01, 2020
stanliwise:
hahahahha, ain't it clear already... Haven't you noticed it yet?
Let me not waste my time jare.
You already did so by posting utter stupidity. Go fool around somewhere else
Re: Programming Logic Challenge by Nobody: 11:22pm On Feb 01, 2020
resosdigital:


Restructure the question for better understanding
The question was copied directly from the book. If you don't understand it, its quite simple, you can't solve it. If your think you're better at JavaScript than the author Marijn Haverbeke, then you can go ahead and restructure his question for better understanding
Re: Programming Logic Challenge by geedot: 12:01am On Feb 02, 2020
crownedrookie:

The question was copied directly from the book. If you don't understand it, its quite simple, you can't solve it. If your think you're better at JavaScript than the author Marijn Haverbeke, then you can go ahead and restructure his question for better understanding
Nigga, watch how you talk, you just talk anyhow to people you don't know much about. You're still crawling when it comes to Programming, but you're already making it seem as if you're running.
Your statements reeks of pride, only a fool will try to attempt what you wrote up there.
Just my humble opinion.

1 Like

Re: Programming Logic Challenge by Nobody: 12:56am On Feb 02, 2020
geedot:
Nigga, watch how you talk, you just talk anyhow to people you don't know much about. You're still crawling when it comes to Programming, but you're already making it seem as if you're running.
Your statements reeks of pride, only a fool will try to attempt what you wrote up there.
Just my humble opinion.
Your humble opinion becomes insulting when you tell me to watch how I talk. I must tell you to shove such opinion up your dunghole. Common sense is not a matter of programming, if there's a fault in a google top programmers reasoning and he comments something silly on my post I'll let him know its silly.
How will I copy a post I found particularly challenging from a book and share here and I'm being told to restructure? Restructure what kwanu? Na force to comment again? So if commenter can't attempt the question, he should've passed by, instead of making it seem like the fault lies in the question. Or is it the fvcktard that came to say what a silly question you're defending? Abeg bros go school someone else on etiquette.
Re: Programming Logic Challenge by Nobody: 7:38am On Feb 02, 2020
The book is eloquent JavaScript right
Re: Programming Logic Challenge by Nobody: 7:39am On Feb 02, 2020
Teejay96:
The book is eloquent JavaScript right
Yeah
Re: Programming Logic Challenge by Nobody: 7:42am On Feb 02, 2020
The question is logic, and the book is not totally meant for beginner bcoz whenever the writer want to console.log he uses `$` this in the parentheses
Re: Programming Logic Challenge by Nobody: 9:00am On Feb 02, 2020
Teejay96:
The question is logic, and the book is not totally meant for beginner bcoz whenever the writer want to console.log he uses `$` this in the parentheses
Exactly the feedback I was expecting to get. Cos I was surprised seeing such a challenge on the first 70 pages of a JS for beginner book.
Re: Programming Logic Challenge by Nobody: 11:12am On Feb 02, 2020
Number 7 won't yield anything so is it that if the multiplications and additions cannot yield an output you say so or what the question doesn't state what should happen when there is no sequence of multiplications and additions.
Re: Programming Logic Challenge by Grandlord: 3:01pm On Feb 02, 2020
Where my lovely people?

icode2
Bunnae
Bossgem

Come and attempt oo!

peterincredible how's it going?

I missed this place. grin grin

Greetings to the gurus;

Makavele
Sirlakes
Progeek37
Lordpeckxy
wane01
Maskky
Ejiod
Mastergramnet
Re: Programming Logic Challenge by makavele: 5:42pm On Feb 02, 2020
crownedrookie:

Exactly the feedback I was expecting to get. Cos I was surprised seeing such a challenge on the first 70 pages of a JS for beginner book.

Seen that question too many times . . . Recursion is your answer !
But back to the most important stuff here to discuss:

So I found this in a book I'm reading and I'm quite curious how many of our resident developers can solve it.

Well, that wouldn't go down well with some people. I have no qualms with that, (maybe because I am not a developer, as you like to put it, but) because I believe, everybody should have freedom of 'expression' but verily, verily I say unto you, I have breezed through lots of books and materials in software engineering and I will tell you a secret. questions like these, are very good, to test your problem solving abilities, and perhaps scale through some interviews (99%) of the time.

But upon resumption, guess what, it's a different ballgame altogether, and all your BFS and DFS algorithm will go to sh.t
when you face the first issue for which you are to create a pull request.

Cheers.
Re: Programming Logic Challenge by Nobody: 6:57pm On Feb 02, 2020
crownedrookie:
So I found this in a book I'm reading and I'm quite curious how many of our resident developers can solve it.
By starting from the number 1 and repeatedly either adding 5 or multiplying by 3, an infinite amount of new numbers can be produced. How would you write a function that, given a number, tries to find a sequence of additions and multiplications that produce that number?
Would love to see some answers posted and of course. No cheating please. That only means you're cheating yourself right? wink
how would you know if I cheat?

This kind of question can be solved using Big O. If you don't know you don't know nani
Re: Programming Logic Challenge by Nobody: 7:00pm On Feb 02, 2020
2kaybiel:
how would you know if I cheat?

This kind of question can be solved using Big O. If you don't know you don't know nani
Bros if u no get wetin to talk better to keep quiet and be thought a fool than talk and confirm the suspicions
Re: Programming Logic Challenge by Nobody: 7:06pm On Feb 02, 2020
crownedrookie:

Bros if u no get wetin to talk better to keep quiet and be thought a fool than talk and confirm the suspicions


I don't get u

Do you know what Big O is?

What's your level of skill in algorithm?


Next time, read before you reach a rash conclusion. Don't just display your pseudointellectuals here.

2 Likes

Re: Programming Logic Challenge by wane01(m): 7:23pm On Feb 02, 2020
2kaybiel:
how would you know if I cheat?

This kind of question can be solved using Big O. If you don't know you don't know nani

Haa

When did the Big O Notation become a way of solving computational problems ?

1 Like

Re: Programming Logic Challenge by wane01(m): 7:31pm On Feb 02, 2020
makavele:


But upon resumption, guess what, it's a different ballgame altogether, and all your BFS and DFS algorithm will go to sh.t
when you face the first issue for which you are to create a pull request.

Cheers.

smiley dem no dey tell person !

Personally i feel overly focusing on algorithms could be a bit unnecessary except you build packages and libraries (like in the js world ) or you're trying to write very very performant codes.
Re: Programming Logic Challenge by wane01(m): 7:32pm On Feb 02, 2020
Grandlord:
Where my lovely people?
icode2 Bunnae Bossgem
Come and attempt oo!
peterincredible how's it going?
I missed this place. grin grin
Greetings to the gurus;
Makavele Sirlakes Progeek37 Lordpeckxy wane01 Maskky Ejiod Mastergramnet
Chief !!!

1 Like

Re: Programming Logic Challenge by Nobody: 7:32pm On Feb 02, 2020
wane01:


Haa

When did the Big O Notation become a way of solving computational problems ?
I only suggest. After all, Big O notation is used to test the efficiency of an algorithm. At least, the problem is mathematical in nature he can make use of algorithm and use Big O notation to test its efficiency.
Re: Programming Logic Challenge by makavele: 7:50pm On Feb 02, 2020
2kaybiel:
I only suggest. After all, Big O notation is used to test the efficiency of an algorithm. At least, the problem is mathematical in nature he can make use of algorithm and use Big O notation to test its efficiency.

I think he needs the algo and don't care if it's in constant time
or factorial time . . .
Re: Programming Logic Challenge by wane01(m): 8:18pm On Feb 02, 2020
2kaybiel:
I only suggest. After all, Big O notation is used to test the efficiency of an algorithm. At least, the problem is mathematical in nature he can make use of algorithm and use Big O notation to test its efficiency.
Yea .

Its used to check computational overhead and test efficiency.

Your other statement seemed a bit misleading.
Re: Programming Logic Challenge by resosdigital(m): 9:32pm On Feb 02, 2020
crownedrookie:

The question was copied directly from the book. If you don't understand it, its quite simple, you can't solve it. If your think you're better at JavaScript than the author Marijn Haverbeke, then you can go ahead and restructure his question for better understanding

Listen bro, I am a very very busy guy so don't ever expect me to engage in any form of war if words with you.
Thanks
Re: Programming Logic Challenge by Nobody: 10:46pm On Feb 02, 2020
2kaybiel:


I don't get u

Do you know what Big O is?

What's your level of skill in algorithm?


Next time, read before you reach a rash conclusion. Don't just display your pseudointellectuals here.
Not everyone read algorithm books but they no how to program so bros just calm down even if you know how to analyse programs big O is not even an answer to the question.

1 Like

Re: Programming Logic Challenge by Nobody: 11:14pm On Feb 02, 2020
2kaybiel:


I don't get u

Do you know what Big O is?

What's your level of skill in algorithm?


Next time, read before you reach a rash conclusion. Don't just display your pseudointellectuals here.
Save the grammer
If you don't know you don't know nani
This is a stupid statement.
Re: Programming Logic Challenge by Nobody: 11:32pm On Feb 02, 2020
2kaybiel:


I don't get u

Do you know what Big O is?

What's your level of skill in algorithm?


Next time, read before you reach a rash conclusion. Don't just display your pseudointellectuals here.
Save the grammer
If you don't know you don't know nani
This is a stupid statement. Keep it for Facebook
Re: Programming Logic Challenge by Nobody: 11:33pm On Feb 02, 2020
resosdigital:


Listen bro, I am a very very busy guy so don't ever expect me to engage in any form of war if words with you.
Thanks
So...?? Should I weep?
Re: Programming Logic Challenge by Nobody: 11:57pm On Feb 02, 2020
makavele:


Seen that question too many times . . . Recursion is your answer !
But back to the most important stuff here to discuss:



Well, that wouldn't go down well with some people. I have no qualms with that, (maybe because I am not a developer, as you like to put it, but) because I believe, everybody should have freedom of 'expression' but verily, verily I say unto you, I have breezed through lots of books and materials in software engineering and I will tell you a secret. questions like these, are very good, to test your problem solving abilities, and perhaps scale through some interviews (99%) of the time.

But upon resumption, guess what, it's a different ballgame altogether, and all your BFS and DFS algorithm will go to sh.t
when you face the first issue for which you are to create a pull request.

Cheers.
Well, that wouldn't go down well with some people

I honestly made the post with the purest of intentions; to receive enough feedback to rate myself and know if I should be doing better than I am with my problem solving logic in my codes. I only started writing code in november and i kindof wasted december. So im really trying to double effort and make up for lost time. The question stumped me totally and knowing full well we have a lot of learning programmers like myself I wanted to see if it's easily solvable.
Really don't understand the dudes turning it to a dick measuring contest.
Yes I am very rude and brusque ewhen I meet an illogical response especially in a period of intense brain activity. Currently have my Facebook and twitter deactivated cos I'll make a bunch of enemies if I don't. But I really don't expect to make a direct post on a programming section and meet comments like "If you don't know you don't know nani", " Reconstruct for better understanding " and "What a silly question" for fvks sake.

I have breezed through lots of books and materials in software engineering and I will tell you a secret. questions like these, are very good, to test your problem solving abilities, and perhaps scale through some interviews (99%) of the time.

But upon resumption, guess what, it's a different ballgame altogether, and all your BFS and DFS algorithm will go to sh.t
when you face the first issue for which you are to create a pull request.
Yes I actually realize that but as one just coming into the field I feel like no knowledge is lost. In practice I always try to stick to projects that task me to solve problems likely to come up in a normal job scenario. I actually shelved the book the question came from for a couple months cos it was more abstract than practical.

But upon resumption, guess what, it's a different ballgame altogether, and all your BFS and DFS algorithm will go to sh.t

Is there any way you can point me to a more effective means of tackling the kinds of situations I might be meeting in a working environment? I'm self taught obviously and I rely pretty much on a combination of Brad Traversy and The NetNinjas YouTube channels and Beginning JavaScript 5th edition.

(maybe because I am not a developer
Lmao do I really know the technical differences between developer and software engineer? What language do you write in?
Re: Programming Logic Challenge by Nobody: 12:11am On Feb 03, 2020
crownedrookie:



I honestly made the post with the purest of intentions; to receive enough feedback to rate myself and know if I should be doing better than I am with my problem solving logic in my codes. I only started writing code in november and i kindof wasted december. So im really trying to double effort and make up for lost time. The question stumped me totally and knowing full well we have a lot of learning programmers like myself I wanted to see if it's easily solvable.
Really don't understand the dudes turning it to a dick measuring contest.
Yes I am very rude and brusque ewhen I meet an illogical response especially in a period of intense brain activity. Currently have my Facebook and twitter deactivated cos I'll make a bunch of enemies if I don't. But I really don't expect to make a direct post on a programming section and meet comments like "If you don't know you don't know nani", " Reconstruct for better understanding " and "What a silly question" for fvks sake.


Yes I actually realize that but as one just coming into the field I feel like no knowledge is lost. In practice I always try to stick to projects that task me to solve problems likely to come up in a normal job scenario. I actually shelved the book the question came from for a couple months cos it was more abstract than practical.



Is there any way you can point me to a more effective means of tackling the kinds of situations I might be meeting in a working environment? I'm self taught obviously and I rely pretty much on a combination of Brad Traversy and The NetNinjas YouTube channels and Beginning JavaScript 5th edition.


Lmao do I really know the technical differences between developer and software engineer? What language do you write in?
It's a hard question and I don't think it's for a beginner, beginners usually start with sorting algorithms, tower of Hanoi and some others but that question requires lots of thinking.

(1) (2) (3) (Reply)

Hi. Pls Help Me Review My Start-up / Embedded Systems And Robotics In Nigeria / In What Language Was Photoshop Written?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 61
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.