Interview Challenge (Word Reversal)

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2004
Posts: 7,848
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 754
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: Interview Challenge (Word Reversal)

 
0
  #51
Jul 15th, 2007
>I decided to approach it, assuming that I knew absolutely nothing about the type of Token ...
Nice. In fact, I'll accept that as a viable solution. I also would have accepted a recursive solution:
  1. #include <iostream>
  2. #include <sstream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. typedef string Token;
  8.  
  9. void push_frame_arg ( Token tok )
  10. {
  11. cout<< tok <<'\n';
  12. }
  13.  
  14. bool add_arguments ( istream& tokenizer )
  15. {
  16. Token tok;
  17.  
  18. if ( tokenizer>> tok ) {
  19. add_arguments ( tokenizer );
  20. push_frame_arg ( tok );
  21. }
  22. }
  23.  
  24. int main()
  25. {
  26. istringstream tokenizer ( "arg1 arg2 arg3" );
  27. Token tok;
  28.  
  29. add_arguments ( tokenizer );
  30. }
>Which would lead to the question "if not the standard library, what
>library are we to use and where can we find the documentation for it?".
Which would be a good question.

>But you would have to accept a solution using the standard library
>given your stated requirements since they lack mention of
Nope. The point of many of these questions is to figure out exactly what the requirements are before trying to come up with a solution. Vague requirements are very common with clients, and you're basically saying that I (as the client) have to accept your solution as final even if it's your fault that the solution is worthless. How many clients do you think would pay if you tried to pull that?
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 505
Reputation: Bench has a spectacular aura about Bench has a spectacular aura about Bench has a spectacular aura about 
Solved Threads: 51
Bench's Avatar
Bench Bench is offline Offline
Posting Pro

Re: Interview Challenge (Word Reversal)

 
0
  #52
Jul 15th, 2007
Originally Posted by Narue View Post
>But you would have to accept a solution using the standard library
>given your stated requirements since they lack mention of
Nope. The point of many of these questions is to figure out exactly what the requirements are before trying to come up with a solution. Vague requirements are very common with clients, and you're basically saying that I (as the client) have to accept your solution as final even if it's your fault that the solution is worthless. How many clients do you think would pay if you tried to pull that?
Indeed - if this thread has taught me one thing, its to question every word of every sentence, and to question every assumption that results .. I guess the old adage reigns true - You only truly understand the problem around the time you've finished creating the solution
¿umop apisdn upside down?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Interview Challenge (Word Reversal)

 
0
  #53
Jul 16th, 2007
Visual Basic is considered the most concise and well implemented computer language currently in existence
By whom? Not by anyone with a grain of intellect...
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Interview Challenge (Word Reversal)

 
0
  #54
Jul 16th, 2007
Says the net and just like father Christmas and Bill Clinton, the net never lies.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Interview Challenge (Word Reversal)

 
0
  #55
Jul 16th, 2007
ah, so another fictional delusion?
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 759
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Solved Threads: 35
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: Interview Challenge (Word Reversal)

 
0
  #56
Jul 16th, 2007
Originally Posted by jwenting View Post
ah, so another fictional delusion?
basically.

hahah would not be supprised if billy gates himself wrote that.

i'm not a windows basher but billy gates sure does love his visual basic even though it works better for scripting.
Dont forget to spread the reputation to those that deserve!
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,580
Reputation: Infarction has a spectacular aura about Infarction has a spectacular aura about Infarction has a spectacular aura about 
Solved Threads: 52
Infarction's Avatar
Infarction Infarction is offline Offline
Battle Programmer

Re: Interview Challenge (Word Reversal)

 
0
  #57
Jul 16th, 2007
Originally Posted by Killer_Typo View Post
i'm not a windows basher but billy gates sure does love his visual basic even though it works better for scripting.
Are you trying to make an ass out of yourself?
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,273
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 544
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: Interview Challenge (Word Reversal)

 
0
  #58
Jul 16th, 2007
VB isnt a scripting language you fool.

VBScript is a scripting language (a pretty crappy one). Its not very much like VB.

Regular VB can be used for Server Side Web Page Scripting though (ASP.NET)
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,055
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: Interview Challenge (Word Reversal)

 
3
  #59
Jul 16th, 2007
People who even think there's a clear line between 'scripting languages' and other languages are the true fools.

Are we allowed to call people fools on this forum?
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 759
Reputation: Killer_Typo will become famous soon enough Killer_Typo will become famous soon enough 
Solved Threads: 35
Killer_Typo's Avatar
Killer_Typo Killer_Typo is offline Offline
Master Poster

Re: Interview Challenge (Word Reversal)

 
0
  #60
Jul 16th, 2007
Originally Posted by Infarction View Post
Are you trying to make an ass out of yourself?
here try this one then. VB sucks, the language is weak and there is no supprise that VB works better as a scripting language (dur VBScript) than VB works as a software language. hope that clears things up for you
Dont forget to spread the reputation to those that deserve!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum


Views: 9511 | Replies: 62
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC