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.
 
  • Locked thread
feedmegin
Jul 30, 2008

KaiserSchnitzel posted:

Also, I got a write-up from HR because I said "ten little indians."

While that is a bit harsh, it does have some p unsavoury associations you know - https://en.wikipedia.org/wiki/Ten_Little_Indians

'It is generally thought that this song was adapted, possibly by Frank J. Green in 1869, as "Ten Little Niggers", though it is possible that the influence was the other way round, with "Ten Little Niggers" being a close reflection of the text that became "Ten Little Indians". Either way, "Ten Little Niggers" became a standard of the blackface minstrel shows.[2] It was sung by Christy's Minstrels and became widely known in Europe, where it was used by Agatha Christie in her novel of the same name. '

The Agatha Christie thing is what first came to my mind.

Adbot
ADBOT LOVES YOU

feedmegin
Jul 30, 2008

Pixelboy posted:

You probably dodged something awful. Have a beer, and move on. Don't worry about it.

This. If nothing else a CEO who would be that flat-out rude to a job applicant is likely to be the sort of sociopathic CEO who would happily gently caress you over as an employee. I've worked for people like that and it's hell.

feedmegin
Jul 30, 2008

Sex Bumbo posted:

Back in the dark ages of DirectX, where to be fair everything was extremely lovely but DirectX was definitely no exception.

He's the quintessential boring male midlife crisis haver: http://www.alexstjohn.com/WP/2013/01/06/getting-fired-from-microsoft/

I'm shocked, shocked I tell you that he had a bad divorce.

(Genuinely shocked he found someone to marry in the first place, tho)

feedmegin
Jul 30, 2008

Space Whale posted:

Lack of feedback is a lurking, sneaky horrorshow from the interview-ee side.

Went to an interview, ran into "How would you compute the sum of all odd numbers from 1 to 1000?"
Instead of "don't worry about syntax just notepad it" as suggested, I use csharppad and make a method that actually has some logic to handle inputs, bumps up the start of the sequence if it's even and bumps down the end if it's even, make sure the start is less than the end, bla blabade bla. I then call it and show the actual sum to everyone, and they're impressed. Then they go "AHA!" when I get around to the drat % operator.

Then I use jsfiddle for the "can you do basic web stuff" thing. Hell yeah bootstrap cdn.

Didn't know of a "(T-)SQL pad" so I did that in notepad. Probably hosed up some syntax there. If one exists that would be the poo poo.

Was told that I did well, and then "nah we want more experience thanks though." Nothing specific, nothing particular, just nah.

Why modulus? In C its just for(count=1; count<1000;count +=2) { sum += count; } or similar...

feedmegin
Jul 30, 2008

Also, and this is a small thing, but I assume C# has the usual logic operators, in which case '(foo & 0x1) == 1' is probably better than foo % 2. I mean, a decent compiler should optimise the latter to the former anyway, but at the hardware level modulus is either a lot slower than an and (on x86 for instance) or not even in the ISA (for ARM).

feedmegin
Jul 30, 2008

I did say it was a small thing! Maybe it's because I tend to do low-level stuff a lot but the bit-twiddling approach looks better to me. I certainly wouldn't hold it against a candidate if they did the modulus version.

feedmegin
Jul 30, 2008

b0lt posted:

Aside from not working for negative values, yeah, this works.

If I were giving this as an interview question, it'd be as the first stage of a multistep problem, though. How would you make this faster?

POPCNT in SSE4, VCNT in NEON, through whatever intrinsic your compiler supports or inline assembler.
(I wouldnt have known the instruction name without looking it up but I knew it existed).

feedmegin
Jul 30, 2008

Walh Hara posted:

That actually doesn't surprise me, because I've never learned about bitwise operators at all in my studies. Java, Haskell, Graph theory, advanced algorithmic datastructures, data analsysis, bio-informatics, etc, where all considered more important than bitwise operators by my university.

Then your course sucked. They are the L in ALU. Bitwise instructions are one of the few fundamental things a CPU is for. Im amazed you can go to uni for comp sci and not be given a basic course in how a CPU actually works.

Edit: you saw this guy was talking about senior-level coding positions, right? These are definitely guys who should know this stuff.

feedmegin fucked around with this message at 13:34 on Jun 19, 2016

feedmegin
Jul 30, 2008

ultrafilter posted:

If none of the senior level developers you're interviewing are familiar with a topic, then you have to examine the possibility that it's just not that important in practice.

Just like senior level developers in C-like languages being able to write fizz buzz is unimportant, right? Im sorry but this isn't obscure or anything, it's a basic part of the language.

feedmegin
Jul 30, 2008

Centripetal Horse posted:

I'm not an optimization expert, but the only obvious improvement I see is to get rid or reduce the iterations of the loop.

My other thought if popcnt etc aren't available would be to do something like e.g. if (x & 0xffff0000 == 0) { // don't bother counting the top 16 bits), which is pretty much what you're talking about here. Assuming you have some knowledge of how big the number can be and how likely it is to be small/large.

feedmegin
Jul 30, 2008

MrMoo posted:

Similarly there is still quite a consistent hatred of std::string due to memory usage, the Qt project I believe has written their own versions of a lot of containers to reduce memory usage in KDE.

Qt has had its own containers since the year dot (well, like 1995) because it ran and still runs on a lot of platforms, with a lot of compilers, some of which that far back were ropey at handling templates at all (hello gcc 2.8) let alone having the STL even available let alone bug-free. And now they're used all over the libraries, why rip them out and put STL ones in its place, forcing everyone porting to a new version of Qt to do the same?

Also, QString has been since Qt 3? I think, specifically 'a bunch of Unicode codepoints' rather than std::string's 'a bunch of bytes', which is handy and important when you're a library that's strong on internationalisation cross-platform.

Adbot
ADBOT LOVES YOU

feedmegin
Jul 30, 2008

hobbesmaster posted:

Unions are also classes if we're talking about C++ trivia.

I have no idea why.

At a language implementation level they're quite similar; it's just that the offset from the memory address of the variable for all their members is 0 and the size is the largest size of any given member rather than the sum of the sizes of the members (modulo alignment adjustments).

  • Locked thread