[Milan-pm] Milan-pm Digest, Vol 2, Issue 8

marcos rebelo oleber at gmail.com
Fri Jan 16 01:44:46 PST 2009


you can get another question.

which is the fasts and the slowest subroutine:


sub unique1 {
    return keys(%{{map {$_=>1} @_}});
}

sub unique2 {
    my %a;
    @a{@_} = ();
    return keys(%a);
}

sub unique3 {
    my %a;
    return grep {not($a{$_}++)} @_;
}

sub unique4 {
    my %a;
    $a{$_}++ foreach @_;
    return keys(%a);
}

to test:

use Benchmark;

my @test_array = map {int(100*rand)} (0..100000);

timethese(1000, {
    'unique1' => sub { unique1 @test_array },
    'unique2' => sub { unique2 @test_array },
    'unique3' => sub { unique3 @test_array },
    'unique4' => sub { unique4 @test_array },
});

The results can surprise.




Let's say that until now 5 persons have done the test, more the ones
in here. Just one had 100%, the cog.


Best Regards
Marcos Rebelo



On Fri, Jan 16, 2009 at 9:47 AM, Giulio Bertani <gbjgiulio at gmail.com> wrote:
> Hello To All,
> Fun test , I think Could be an argument to month meeting answering
> about the "wrong" answers.
> Good job ! And Good Fun !
>
> I won't say my score because this isn't an exam or a test but only a fun !!!
>
> Bye
> Giulio
>
> 2009/1/15  <milan-pm-request at pm.org>:
>> Send Milan-pm mailing list submissions to
>>        milan-pm at pm.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>        http://mail.pm.org/mailman/listinfo/milan-pm
>> or, via email, send a message with subject or body 'help' to
>>        milan-pm-request at pm.org
>>
>> You can reach the person managing the list at
>>        milan-pm-owner at pm.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Milan-pm digest..."
>>
>>
>> Today's Topics:
>>
>>   1. Perl Test (marcos rebelo)
>>   2. Re: Perl Test (Oha)
>>   3. Re: Perl Test (Oha)
>>   4. Re: Perl Test (Stefano Rodighiero)
>>   5. Re: Perl Test (marcos rebelo)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Thu, 15 Jan 2009 15:05:17 +0100
>> From: marcos rebelo <oleber at gmail.com>
>> Subject: [Milan-pm] Perl Test
>> To: milan-pm at pm.org
>> Message-ID:
>>        <319d96980901150605q4bc7037chad8e6aa60e189dd7 at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Some time ago I was demanded to do a simple test to check the quality
>> of the Perl Developers candidates into a Company and I did this one
>> (without javascript):
>>
>> http://milan.pm.org/perl_test.html
>>
>> You can try it for fun and set the results in here.
>>
>> Best regards
>> Marcos Rebelo
>>
>> --
>> Marcos Rebelo
>> http://oleber.freehostia.com
>> Milan Perl Mongers leader http://milan.pm.org
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Thu, 15 Jan 2009 17:48:23 +0100
>> From: "Oha" <oha at oha.it>
>> Subject: Re: [Milan-pm] Perl Test
>> To: oleber at gmail.com, milan-pm at pm.org
>> Message-ID: <200901151648.n0FGmNn8030274 at vivaldi21.register.it>
>> Content-Type: text/plain;       charset="iso-8859-1"
>>
>>
>>>----- Original Message -----
>>>From: oleber at gmail.com
>>>To: milan-pm at pm.org
>>>Data: Thu, 15 Jan 2009 15:05:17 +0100
>>>Subject: [Milan-pm] Perl Test
>>
>>>Some time ago I was demanded to do a simple test to check the quality
>>>of the Perl Developers candidates into a Company and I did this one
>>>(without javascript):
>>>
>>>http://milan.pm.org/perl_test.html
>>>
>>>You can try it for fun and set the results in here.
>>>
>>>Best regards
>>>Marcos Rebelo
>>>
>>>--
>>>Marcos Rebelo
>>>http://oleber.freehostia.com
>>>Milan Perl Mongers leader http://milan.pm.org
>>>_______________________________________________
>>>Milan-pm mailing list
>>>Milan-pm at pm.org
>>>http://mail.pm.org/mailman/listinfo/milan-pm
>>>
>>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Thu, 15 Jan 2009 17:48:42 +0100
>> From: "Oha" <oha at oha.it>
>> Subject: Re: [Milan-pm] Perl Test
>> To: milan-pm at pm.org
>> Message-ID: <200901151648.n0FGmgeP028329 at vivaldi28.register.it>
>> Content-Type: text/plain;       charset="iso-8859-1"
>>
>>>http://milan.pm.org/perl_test.html
>>
>> doh, 67%!
>>
>>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Thu, 15 Jan 2009 18:01:04 +0100
>> From: Stefano Rodighiero <stefano.rodighiero at gmail.com>
>> Subject: Re: [Milan-pm] Perl Test
>> To: milan-pm at pm.org, Oha <oha at oha.it>
>> Message-ID:
>>        <699026fb0901150901h6b74a86ds588bd270af92339b at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> On Thu, Jan 15, 2009 at 5:48 PM, Oha <oha at oha.it> wrote:
>>
>>> doh, 67%!
>>
>> 89% !
>>
>> (but I have my doubts on this kind of tests during interviews)
>>
>> S.
>>
>> --
>> www.stefanorodighiero.net
>>
>>
>> ------------------------------
>>
>> Message: 5
>> Date: Thu, 15 Jan 2009 19:43:14 +0100
>> From: marcos rebelo <oleber at gmail.com>
>> Subject: Re: [Milan-pm] Perl Test
>> To: milan-pm at pm.org
>> Message-ID:
>>        <319d96980901151043j385ad55ald5ae7e917a76626f at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> This test was just doing a filtering.
>>
>> The person was requested to give a 1 to 5 evaluation of her knowledge
>> in diverse areas, in the case of having a 4 or 5 in Perl, he was doing
>> a test similar to this one. Less the 50% was setting the person out of
>> the process, between 50% and 75% was having a fast interview with a
>> expert in the area, more then 75% was passing directly to the final
>> interview.
>>
>> The last interview was having 5 persons doing questions in diverse
>> areas, all this was being done in 3 to 4 hours.
>>
>> Some normal question where:
>> Describe one of the algorithms:
>>   Quick Sort
>>   Merge Sort
>>   Bucket sort
>> When shall we use Bubble Sort? (my preferred question)
>> How to count the repeated lines in a file?
>> ...
>>
>> It was the most difficult interview that I had until today, but at the
>> end we where having 100 developers of the best in Portugal.
>>
>> Best Regards
>> Marcos Rebelo
>>
>>
>> On Thu, Jan 15, 2009 at 6:01 PM, Stefano Rodighiero
>> <stefano.rodighiero at gmail.com> wrote:
>>> On Thu, Jan 15, 2009 at 5:48 PM, Oha <oha at oha.it> wrote:
>>>
>>>> doh, 67%!
>>>
>>> 89% !
>>>
>>> (but I have my doubts on this kind of tests during interviews)
>>>
>>> S.
>>>
>>> --
>>> www.stefanorodighiero.net
>>> _______________________________________________
>>> Milan-pm mailing list
>>> Milan-pm at pm.org
>>> http://mail.pm.org/mailman/listinfo/milan-pm
>>>
>>
>>
>>
>> --
>> Marcos Rebelo
>> http://oleber.freehostia.com
>> Milan Perl Mongers leader http://milan.pm.org
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> Milan-pm mailing list
>> Milan-pm at pm.org
>> http://mail.pm.org/mailman/listinfo/milan-pm
>>
>>
>> End of Milan-pm Digest, Vol 2, Issue 8
>> **************************************
>>
>
>
>
> --
> Giulio Bertani
> www.perquelliche.it (In definizione ...)
> _______________________________________________
> Milan-pm mailing list
> Milan-pm at pm.org
> http://mail.pm.org/mailman/listinfo/milan-pm
>



-- 
Marcos Rebelo
http://oleber.freehostia.com
Milan Perl Mongers leader http://milan.pm.org


More information about the Milan-pm mailing list