article

title

[WHAT]

  1. http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/ using tiny problems

[WHY]

  1. ] so i had to try it and of course i stumbled
    1. ] didnt know the operator for modulus,( googled it )
  2. ] I came up with a fairly non elegant untested
    1. ] solution-v-001
  3. ] this took me approx
    1. ] 10ish minutes
  4. ] author assert that "most programmers" should be able to write this program
    1. ] in under a couple of minutes ...
    2. *] couple is = 2 ?? 
  5. ] also claims that most computer science graduates
    1. ] cant write it
    2. ] self proclaimed "senior programmers" take 10-15 minutes to write it 
  6. ] the author is not saying that
    1. ] that these people "cant write good code" just that "it will take them longer" and in a business environment thats exactly what you dont want
    2. ] it will identify good programmers, just that it will weed out the bad ones
  7. ] comments
    1. ] offered up some implementations

[WHERE]

  1. ]

[WHEN]

  1. ]

[EXAMPLE]

  1. ]
  2. ] if (i % 3 == 0){
    echo ‘Fizz’;
    }
    if (i % 5 == 0){
    echo ‘Buzz’;
    }

[HOW-TO]

  1. ]

[REFERENCE]

  1. ]

 

 

Write a program that prints the numbers from 1 to 100.

But for multiples of three print “Fizz” instead of the number and
for the multiples of five print “Buzz”.

For numbers which are multiples of both three and five print “FizzBuzz”.

] solution-v-001

script

var fizz, buzz, fizz-buzz ;

for (x=0, x<100, x++){

 if ( x % 3 == 0){
    fizz = true;
  
 }

 if ( x % 5 == 0 ){

  buzz = true;
  
 }

 if ( fizz === true && buzz === true){
 
  console.log("fizzbuz");

 }
 if ( fizz === true && buzz != true){
    console.log("fizz");
 }

 if ( fizz != true && buzz == true){
    console.log("buzz");
 }

 if  ( fizz !=== true && buzz !=== true){
 
  console.log(x);

 }

}

 

/script

 

 

Details Photos Edit more

Details

ID: 2542

NAME: using-fizzbuzz-to-find-programmers-who-grok-coding

DESCRIPTION: ] by Imran Ghory, - An older article(2007) about using a fairly simple coding test to separate those who can code from those who can't,

AUTHOR: article.author/s

EDITOR: article.editor/s

PUBLISHER: article.publisher/s

STATUS: Write

PRIORITY: 0

OWNER ID: 75

Content Photos Edit more

photos

page_photo

actions

Email Email-Owner SMS and