Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Don Music
Jun 20, 2008
In a uni programming contest, where you can use any language you like, one student writes in C, and writes like this.

code:
int g[(int)1e6],o=0,n,i,j,k;

#if __LP64__
    int cmp(int*a,int*b){return *a-*b;}
#else
#define cmp main
#endif

int main(int a, char **b)
{
    if (o) return *(int*)a - *(int*)b;
    while(scanf("%i%i",&o,&n)==2&&(o*=1e7))for(k=i=!g;!k&&((i<n&&scanf("%i",g+i))||(qsort(g,n--,4,cmp),i=!g,k=n))||((i<k||!printf("danger\n"))&&(j=g[i]+g[k],(j<o&&++i)||(j>o&&k--)||(!printf("yes %i %i\n",g[i],g[k]))));!k&&i++);
    return 0;
}

Adbot
ADBOT LOVES YOU

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
My favourite part is how he tries to reuse main as his comparison function, but it breaks whenever sizeof(int) != sizeof(int *) so he has to write a separate comparison function anyway.

But then keeps on reusing main when he can get away with it, just because.

hobbesmaster
Jan 28, 2008

Since its for a contest I'm assuming hes having fun and golfing or something.

I hope so anyways.

Pilsner
Nov 23, 2002

QuarkJets posted:

How do these people manage to get programming jobs without the skills that the jobs require?
Easy - those who manage and lead programmers rarely know how to even write a Hello World application. It's so lame when you look at most other businesses and skills in the world. I'm pretty sure you have to work your way up to lead in almost every other industry.

Don Music posted:

In a uni programming contest, where you can use any language you like, one student writes in C, and writes like this.

code:
int g[(int)1e6],o=0,n,i,j,k;

#if __LP64__
    int cmp(int*a,int*b){return *a-*b;}
#else
#define cmp main
#endif

int main(int a, char **b)
{
    if (o) return *(int*)a - *(int*)b;
    while(scanf("%i%i",&o,&n)==2&&(o*=1e7))for(k=i=!g;!k&&((i<n&&scanf("%i",g+i))||(qsort(g,n--,4,cmp),i=!g,k=n))||((i<k||!printf("danger\n"))&&(j=g[i]+g[k],(j<o&&++i)||(j>o&&k--)||(!printf("yes %i %i\n",g[i],g[k]))));!k&&i++);
    return 0;
}
Looks like he's aiming to enter The International Obfuscated C Code Contest

bucketmouse
Aug 16, 2004

we con-trol the ho-ri-zon-tal
we con-trol the verrr-ti-cal

Don Music posted:

In a uni programming contest, where you can use any language you like, one student writes in C, and writes like this.

Yaayy keeping IOCCC alive :patriot:

What's this supposed to do anyways?

Goat Bastard
Oct 20, 2004

Pilsner posted:

Easy - those who manage and lead programmers rarely know how to even write a Hello World application. It's so lame when you look at most other businesses and skills in the world. I'm pretty sure you have to work your way up to lead in almost every other industry.

To be fair writing good code and effectively managing/leading people are very different skill-sets, and proficiency in the first does not imply proficiency in the second.

The problem is really more that technical people are often assessed and hired by non-technical people, or even by technical people who don't know how to assess someone in an interview situation.

omeg
Sep 3, 2012

The problem is also that programmers often climb up to managing positions and they have no idea how to manage people.

tef
May 30, 2004

-> some l-system crap ->
To be fair, many programmers stay in programming and they don't know how to write code either.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Don Music posted:

In a uni programming contest, where you can use any language you like, one student writes in C, and writes like this.

code:
int g[(int)1e6],o=0,n,i,j,k;

#if __LP64__
    int cmp(int*a,int*b){return *a-*b;}
#else
#define cmp main
#endif

int main(int a, char **b)
{
    if (o) return *(int*)a - *(int*)b;
    while(scanf("%i%i",&o,&n)==2&&(o*=1e7))for(k=i=!g;!k&&((i<n&&scanf("%i",g+i))||(qsort(g,n--,4,cmp),i=!g,k=n))||((i<k||!printf("danger\n"))&&(j=g[i]+g[k],(j<o&&++i)||(j>o&&k--)||(!printf("yes %i %i\n",g[i],g[k]))));!k&&i++);
    return 0;
}

I started reading this until I realized that life is too short for this kind of horseshit unless someone is paying me.

Dren
Jan 5, 2001

Pillbug

Volmarias posted:

I started reading this until I realized that life is too short for this kind of horseshit unless someone is paying me.

Next thing you know you'll stop reading this thread.

Zaphod42
Sep 13, 2012

If there's anything more important than my ego around, I want it caught and shot now.

QuarkJets posted:

How do these people manage to get programming jobs without the skills that the jobs require?

Have you ever tried interviewing people for a programming position? I wouldn't wish that on my enemies.

Dirk Pitt
Sep 14, 2007

haha yes, this feels good

Toilet Rascal

Zaphod42 posted:

Have you ever tried interviewing people for a programming position? I wouldn't wish that on my enemies.

Is it the process that is terrible, or the candidates that typically apply for programming positions?

I have seen some very bizarre behavioral interviews with technical candidates.

Dren
Jan 5, 2001

Pillbug

Zaphod42 posted:

Have you ever tried interviewing people for a programming position? I wouldn't wish that on my enemies.

Have you ever tried interviewing intra-company candidates who you wouldn't be interviewing if it weren't for the fact that you were doing HR a solid?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I'm convinced this is how!!'s alt account.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Dirk Pitt posted:

I have seen some very bizarre behavioral interviews with technical candidates.

There was a place that a coworker of mine interviewed at that had everyone take a two hour personality test during the interview, and all the employees cubicles had color-coded signs with their Myers-Briggs type and a blurb on how to interact with them based on their being an INTJ or whatever :stare:


He tried to leave the interview early, and they wouldn't let him. Two weeks later he declined a second round of interview, and they tried for weeks to convince him to come back, and also to send them his W2 and two pay stubs because they didn't believe his salary history :staredog:

That Turkey Story
Mar 30, 2003

Otto Skorzeny posted:

There was a place that a coworker of mine interviewed at that had everyone take a two hour personality test during the interview, and all the employees cubicles had color-coded signs with their Myers-Briggs type and a blurb on how to interact with them based on their being an INTJ or whatever :stare:


He tried to leave the interview early, and they wouldn't let him. Two weeks later he declined a second round of interview, and they tried for weeks to convince him to come back, and also to send them his W2 and two pay stubs because they didn't believe his salary history :staredog:

This sounds like the plot of a horror movie.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Otto Skorzeny posted:

He tried to leave the interview early, and they wouldn't let him. Two weeks later he declined a second round of interview, and they tried for weeks to convince him to come back, and also to send them his W2 and two pay stubs because they didn't believe his salary history :staredog:

Did they tell him what they were offering? This makes it sound like his previous/current salary was higher than his prospective manager's.

Mogomra
Nov 5, 2005

simply having a wonderful time

Otto Skorzeny posted:

There was a place that a coworker of mine interviewed at that had everyone take a two hour personality test during the interview, and all the employees cubicles had color-coded signs with their Myers-Briggs type and a blurb on how to interact with them based on their being an INTJ or whatever :stare:


He tried to leave the interview early, and they wouldn't let him. Two weeks later he declined a second round of interview, and they tried for weeks to convince him to come back, and also to send them his W2 and two pay stubs because they didn't believe his salary history :staredog:

I had to do that once. They had me take a personality test and an IQ test before I sat down with the department head who was doing my interview. It took so long that my wife called me thinking I had been abducted or something. In my defense, we had just moved cross-country and were scrambling to get jobs otherwise we'd have to pack up and head home.

That W2/paystub business is wacky though.

Off topic: That job interview was for a full-time front-end web developer, and after all the tests and the 3 hour interview, the department head told me that I "aced the tests." The IT department head happened to sit in for the interview and told me that if I didn't get the web developer job, he'd hire me for IT. In the end I was offered a freelance web design position. Total kick in the nuts.

Thinking about it, I even spent a few hours of personal time building a simple template with image slices out of a .psd they gave me, and some PHP to handle email forms before they would even give me an interview.

Some lessons are hard learned... :cripes:

Zamujasa
Oct 27, 2010



Bread Liar
Every time I look at this code from the boss...

php:
<?
$myhex = hex2bin($mybin);
$myhexarray = array($myhex);

foreach($myhexarray as $myvalue){ // yes, this iterates only once

    // boss code //
    // no control structures like break/continue are used here //
?>
:smithicide:

This is just another bit of nonsense from him that makes this thing impossible to follow. I've been trying to rewrite this thing and it's been hard; every time I start we get dumped onto some new Super Important Project that some C-level pulled out of their rear.

(I did at least manage to rewrite half of it, but the other half is much worse)

Pilsner
Nov 23, 2002

Goat Bastard posted:

To be fair writing good code and effectively managing/leading people are very different skill-sets, and proficiency in the first does not imply proficiency in the second.

The problem is really more that technical people are often assessed and hired by non-technical people, or even by technical people who don't know how to assess someone in an interview situation.
I know, but it's just curious when you look at so many other businesses where the managers have started at the bottom. I'm pretty sure every head of accounting has been a basic accountant, every owner of an auto repair shop started as a mechanic, and every captain started as a mundane seaman. In IT and software dev, I basically never see people who have worked their way up. Maybe it's because it can actually be fun at the "bottom", or perhaps the large nerd percentage in IT just never wants/is suitable to move on to management.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

DaTroof posted:

Did they tell him what they were offering? This makes it sound like his previous/current salary was higher than his prospective manager's.

They didn't say what they were offering. I've heard from other sources that the place pays slightly above average and has a sort of personality cult with the founder, who is an active (micro-)manager. They're an LLC that makes freaking fryer controllers, no idea how they subsist being as weird as they are.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Pilsner posted:

I know, but it's just curious when you look at so many other businesses where the managers have started at the bottom. I'm pretty sure every head of accounting has been a basic accountant, every owner of an auto repair shop started as a mechanic, and every captain started as a mundane seaman. In IT and software dev, I basically never see people who have worked their way up. Maybe it's because it can actually be fun at the "bottom", or perhaps the large nerd percentage in IT just never wants/is suitable to move on to management.

Plus the industry/field grew so fast in the 90s that there probably aren't enough people with enough experience* to fill all of the potential leadership slots that have opened up. I'm hoping it stays fun at/near the bottom because I'm doing some leadership/management stuff now and it's, well, less fun than coding.

* as defined by people who were doing their job for years and assume you need a crapton of management experience to manage people because they had a crapton and their predecessors had a crapton and so on

stuxracer
May 4, 2006

Munkeymon posted:

Plus the industry/field grew so fast in the 90s
This right here. "CTO at Webcompany 123" and "has never managed an actual budget"/"has never managed people" from the same candidate after interviewing. Not much time to grow and some people had no business being in the positions they were in causes interviews to be all over the place and makes finding qualified people a cluster.

kitten smoothie
Dec 29, 2001

Mogomra posted:

I had to do that once. They had me take a personality test and an IQ test
Are you in the US? From everything I've read, administering a general intelligence test in an interview is asking to get yourself sued. Skill-based testing is one thing, as it demonstrates that the test is relevant to the critical skills necessary to do the job. But a plain old IQ test means you have to show that the IQ cutoff you choose means nobody below that can do the job, and that the test is professionally developed and not biased against people in protected classes.

I have to imagine that a bona fide IQ test administered by a licensed psychologist is prohibitively expensive to use as a general employment screening tool.

more like dICK
Feb 15, 2010

This is inevitable.
Good:
My job provides "reading lists", and you can get books on the list and have work pay for them. Most are general programming books for people looking to learn in their free time, and some are "Recommended" for certain teams or projects.

Horror:
This showed up on the "Recommended" list for a new project I'm joining :unsmigghh:

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Dren posted:

Have you ever tried interviewing intra-company candidates who you wouldn't be interviewing if it weren't for the fact that you were doing HR a solid?

Oh, this wasn't a joke about how they were probably just as competent.

For all the guff that Atwood gives/gets, I'm really getting tempted to actually ask fizzbuzz and see what happens.

God of Mischief
Oct 22, 2010

Volmarias posted:

Oh, this wasn't a joke about how they were probably just as competent.

For all the guff that Atwood gives/gets, I'm really getting tempted to actually ask fizzbuzz and see what happens.

You will lose your faith in humanity. It will start small, with you wondering how people with 10+ years of experience don't know what the modulus operator is. Then it will grow, with you wondering how people with 10+ years of experience don't know what a for loop is. Then will come the day when someone writes 100 println statements on the whiteboard and still have a bug in the implementation.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Volmarias posted:

Oh, this wasn't a joke about how they were probably just as competent.

For all the guff that Atwood gives/gets, I'm really getting tempted to actually ask fizzbuzz and see what happens.

Be careful with fizzbuzz, because it doesn't really help with screening out the degree mill graduates who study those "interview questions" and can regurgitate an answer, but still don't actually know how to program.

You probably want a similarly-trivial programming problem that no-one else uses as an interview question.

Opinion Haver
Apr 9, 2007

Ask them how to write a generalized fizzbuzz given a map from divisors to strings, where the original problem is {3: "fizz", 5: "buzz"}.

ymgve
Jan 2, 2004


:dukedog:
Offensive Clock
Unless you want "buzzfizz" to be an acceptable answer for 15, you should probably specify some ordering of the map too.

Jonnty
Aug 2, 2007

The enemy has become a flaming star!

ymgve posted:

Unless you want "buzzfizz" to be an acceptable answer for 15, you should probably specify some ordering of the map too.

Give them the original problem, then ask them to generalise it given the map, then ask them if the generalised version of the original problem is the same as the original problem as a lesson in the perils of requirements elicitation and integration with existing systems.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Jabor posted:

Be careful with fizzbuzz, because it doesn't really help with screening out the degree mill graduates who study those "interview questions" and can regurgitate an answer, but still don't actually know how to program.

You probably want a similarly-trivial programming problem that no-one else uses as an interview question.

My "go to" question is asking them to remove an element from a linked list, where they give the linked list structure beforehand as a convenience.

Is this really so much to ask? I want "can give the correct answer" to be the bare minimum but so many can't even handle that :cripes:

hobbesmaster
Jan 28, 2008

I like "swap two variables" because you flag the people that don't know anything and the people that think stuff like xor swap belong in modern C++.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
What would you want? The naïve solution?

C++ code:
template <typename T>
void swap(T &x, T &y)
{
    T swap;
    swap = x;
    x = y;
    y = swap;
}

Sinestro fucked around with this message at 01:59 on May 7, 2013

Volte
Oct 4, 2004

woosh woosh
The naive (and correct) solution is std::swap(a, b);

Captain Cappy
Aug 7, 2008

Volte posted:

The naive (and correct) solution is std::swap(a, b);

Actually it's:

using namespace std;
swap(a, b);


:smug:

hobbesmaster
Jan 28, 2008

Sinestro posted:

What would you want? The naïve solution?

C++ code:
template <typename T>
void swap(T x, T y)
{
    T swap;
    swap = x;
    x = y;
    y = swap;
}

1. Its std::swap - always use the build in library functions in real code ffs.
2. You're wrong.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.
I haven't written C++ in forever. Let's just imagine those ampersands have always been there.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Captain Cappy posted:

Actually it's:

using namespace std;
swap(a, b);


:smug:

The actually correct answer is
C++ code:
using std::swap;
swap(a, b);

Adbot
ADBOT LOVES YOU

That Turkey Story
Mar 30, 2003

Plorkyeran posted:

The actually correct answer is
C++ code:
using std::swap;
swap(a, b);

boost::swap(a,b);

:c00lbert:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply