Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 13 Jul 2012, 06:01
ForceHSS's Avatar
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
This see who the smart ones are

Question: Given an unsorted array of integers, find any 3 numbers that will add up to 100. For example, if the array has -77, 55, 22, 0, 2, and 155, one answer would be -77, 22, and 155.
Reply With Quote
  #2  
Old 15 Jul 2012, 18:23
ForceHSS's Avatar
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Looks like no smart people here
Reply With Quote
  #3  
Old 15 Jul 2012, 18:43
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
The smart ones avoided wasting their time on something they have no need of.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #4  
Old 15 Jul 2012, 19:12
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
Step 1: Randomly pick 3 numbers from the array
Step 2: Do they add to 100?
If Yes, DONE.
If No, go to step 1.

What do I win?
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #5  
Old 16 Jul 2012, 05:36
ForceHSS's Avatar
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Originally Posted by BirdOPrey5 View Post
Step 1: Randomly pick 3 numbers from the array
Step 2: Do they add to 100?
If Yes, DONE.
If No, go to step 1.

What do I win?
I still don't see your answer. You have just given a question and answered yourself

Last edited by Paul M; 16 Jul 2012 at 15:04. Reason: Dont push your luck
Reply With Quote
  #6  
Old 16 Jul 2012, 11:38
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
 
Join Date: Jun 2008
Real name: Joe D.
I gave the answer is pseudo-code. You didn't specify it needed to be in particular language. An algorithm is generally acceptable in computer science as anyone with a basic understanding of a language can easily convert it.
__________________
-Joe
Former vb.org Moderator. Retired.

@BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic
Note - I no longer making new VB mods, sorry.
Reply With Quote
  #7  
Old 16 Jul 2012, 12:27
Azhrialilu's Avatar
Azhrialilu Azhrialilu is offline
 
Join Date: Aug 2003
Real name: Lee
It involves numbers... I generally avoid anything involving numbers. Words are my thing. I can barely add up using a calculator
__________________
Admin Extra - The Switzerland of Community Administrator Forums
Reply With Quote
  #8  
Old 17 Jul 2012, 03:38
ForumsMods's Avatar
ForumsMods ForumsMods is offline
 
Join Date: Aug 2007
Real name: Adrian Sacchi
It reminds me of college exercises and Facebook Hacker Cup.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Adrian Sacchi - Forums Mods
vBulletin Alpha/Beta Tester
vBulletin Bug Scrubber

Last edited by ForumsMods; 17 Jul 2012 at 03:47.
Reply With Quote
  #9  
Old 17 Jul 2012, 04:01
Shazz's Avatar
Shazz Shazz is offline
 
Join Date: Jun 2006
Location: Utah
Real name: Shawn
Is it a homework question?
Reply With Quote
  #10  
Old 18 Jul 2012, 02:40
ForceHSS's Avatar
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Originally Posted by Shazz View Post
Is it a homework question?
It is for a job with very good pay. Was just seeing if anyone could work it out but have already been pmed with the correct answer and am now it talks with the member
Reply With Quote
  #11  
Old 18 Jul 2012, 13:14
Ziki's Avatar
Ziki Ziki is offline
 
Join Date: Nov 2005
Originally Posted by ForceHSS View Post
It is for a job with very good pay. Was just seeing if anyone could work it out but have already been pmed with the correct answer and am now it talks with the member
Your post made me LOL
__________________
My free mods~click here
Reply With Quote
  #12  
Old 18 Jul 2012, 16:28
ForceHSS's Avatar
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Originally Posted by Ziki View Post
Your post made me LOL
If you found out the pay it would stop
Reply With Quote
  #13  
Old 18 Jul 2012, 20:17
socialteenz's Avatar
socialteenz socialteenz is offline
 
Join Date: May 2011
Real name: Arun
Originally Posted by ForceHSS View Post
If you found out the pay it would stop
How much are people paying for this kind of tasks?
__________________
Reply With Quote
  #14  
Old 18 Jul 2012, 21:16
Ziki's Avatar
Ziki Ziki is offline
 
Join Date: Nov 2005
Originally Posted by socialteenz View Post
How much are people paying for this kind of tasks?
I don't know how much a bit of logical thinking and common sense is worth these days, but it would surely make me stop laughing







or not...
__________________
My free mods~click here
Reply With Quote
  #15  
Old 18 Jul 2012, 21:49
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
When I google the question, I find that it's a question that Facebook has asked while interviewing potential engineers. There are also lot of potential solutions, including the one ForumsMods posted above (which is an algorithm called 3SUM, http://en.wikipedia.org/wiki/3SUM). I think the point of the question is recognizing that the obvious solution (adding together every combination of 3 numbers) is not an efficient algorithm compared to other ways of doing it. I think if I wanted to hire a good software engineer I might ask some similar questions, but I'd probably wait until the interview or at least pick one that couldn't be solved so easily using a search engine.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Smart Brown miner vBulletin 3.6 Styles 23 09 Jan 2009 04:36
Black Smart miner vBulletin 3.6 Styles 20 16 Dec 2006 01:39



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 04:39.

Layout Options | Width: Wide Color: