Want to hire a php programmer

Discussion in 'Programming' started by cutiepie1, Sep 14, 2009.

  1. #1
    Hi,

    I am looking to hire a programmer. The applicant must possess tangible experience with php programming.

    To help us evaluate your capacities, you will go through a series of 3 tests. For the first one, you must write a program that can sort all the lines of the attached file in alphabetical order, case insensitive, and removing the duplicates.

    File is attached. Please PM me the code as I do not want other applicants to copy your code.
     

    Attached Files:

    Last edited: Sep 14, 2009
    cutiepie1, Sep 14, 2009 IP
  2. Fizzadar

    Fizzadar Well-Known Member

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    111
    As Seller:
    100% - 0
    As Buyer:
    100% - 2
    #2
    Putting coders through tests is ridiculous, why not ask for a portfolio? Or a guarantee of sorts, not stupid tests, anyone could code that, but the difference is in the way that its coded.
     
    Fizzadar, Sep 14, 2009 IP
  3. lui2603

    lui2603 Peon

    Messages:
    729
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    I'm aware this may be a con to get free work but since the 'test' is simple enough I'll go along with it ;)

    
    <?php
    
    $data = file_get_contents("data.txt");
    $array = explode("\n", $data);
    $array = array_unique($array);
    sort($array);
    
    $newdata = "";
    foreach($array as $item){
    	$newdata .= "$item\n";
    }
    file_put_contents("data.txt", $newdata);
    
    ?>
    
    PHP:
    ...and the final output:
    
    Ochre
    Office green
    Old Gold
    Old Lace
    Old Lavender
    Old Rose
    Olive
    Olive Drab
    Olivine
    Orange (RYB)
    Orange (color wheel)
    Orange (web)
    Orange Peel
    Orange-Red
    Orchid
    Pale blue
    Pale brown
    Pale carmine
    Pale chestnut
    Pale cornflower blue
    Pale magenta
    Pale pink
    Pale red-violet
    Pale taupe
    Papaya whip
    Pastel green
    Pastel pink
    Payne's grey
    Peach
    Peach-orange
    Peach-yellow
    Pear
    Periwinkle
    Persian blue
    Persian green
    Persian indigo
    Persian orange
    Persian pink
    Persian red
    Persian rose
    Persimmon
    Pine Green
    Pink
    Pink-orange
    Platinum
    Plum (web)
    Portland Orange
    Powder blue (web)
    Prussian blue
    Psychedelic purple
    Puce
    Pumpkin
    Purple (HTML/CSS)
    Purple (X11)
    Purple Taupe
    Raspberry
    Raw umber
    Razzmatazz
    Red
    Red (RYB)
    Red (pigment)
    Red-violet
    Rich carmine
    Robin egg blue
    Rose
    Rose Madder
    Rose Taupe
    Rose pink
    Rose quartz
    Royal blue
    Royal purple
    Ruby
    Russet
    Rust
    Safety orange (blaze orange)
    Saffron
    Salmon
    Salmon pink
    Sandy brown
    Sangria
    Sapphire
    Scarlet
    School bus yellow
    Sea Green
    Seal brown
    Seashell
    Selective yellow
    Sepia
    Shamrock green
    Shocking Pink
    Sienna
    Silver
    Sky Blue
    Slate gray
    Smalt (Dark powder blue)
    Spring bud
    Spring green
    Steel blue
    
    
    Code (markup):
     
    lui2603, Sep 14, 2009 IP
  4. cutiepie1

    cutiepie1 Active Member

    Messages:
    349
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    I've already had people with good looking portfolios that couldn't even do a few simple tasks (like the one I posted here). I've had portfolios which were montage of examples from php.net.

    A test also indicates if someone pays attention to details and can follow instructions. They also show how they think.
     
    cutiepie1, Sep 14, 2009 IP
  5. lui2603

    lui2603 Peon

    Messages:
    729
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    So did I pass your test??
    What's next?
     
    lui2603, Sep 14, 2009 IP
  6. cutiepie1

    cutiepie1 Active Member

    Messages:
    349
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    No one has yet to give a 100% correct answer as the requirement of it being case insensitive is missing from the answers that have been submitted.
     
    cutiepie1, Sep 15, 2009 IP
  7. AdnanAhsan

    AdnanAhsan Well-Known Member

    Messages:
    601
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    <?php
    $file = file_get_contents("sample_data.txt");
    $arr = explode('\n',$file);
    natcasesort($arr);
    print_r($arr);
    ?>
     
    AdnanAhsan, Sep 15, 2009 IP
  8. Mr_Kumar

    Mr_Kumar Notable Member

    Messages:
    2,561
    Likes Received:
    374
    Best Answers:
    1
    Trophy Points:
    265
    Articles:
    4
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    I think I have some real brains in my team, but I'll put their time with you test only when I see it is worthwhile. So, please let me know a bit about your project you'll give after passing test. What price? Looking for long term coder or not? Hope you understand. Thanks in advance.
     
    Mr_Kumar, Sep 16, 2009 IP
  9. cutiepie1

    cutiepie1 Active Member

    Messages:
    349
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #9
    Only one person got the complete answer. The best solution, however, is:

    
    <?php
    $array = file("sample_data.txt");
    $array = array_unique($array);
    natcasesort($array);
    print_r($array);
    ?>
    
    Code (markup):
     
    Last edited: Sep 19, 2009
    cutiepie1, Sep 19, 2009 IP
  10. reesylou

    reesylou Peon

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #10
    Well, you didn't specify natural sort order, only alphabetic :) that's why I only sent you array_multisort not natcasesort. I considered using natcasesort, but it was more than specified, and you explicitly asked for attention to detail :)
     
    reesylou, Sep 19, 2009 IP