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
Linear Zoetrope
Nov 28, 2011

A hero must cook

feedmegin posted:

Asking how to tell whether they're on a little or big endian machine is another good one.

Dumb question: doesn't this rely on the processor's atomic unit size for LE (sometimes being octets and sometimes being double-octets/16-bits)? I think almost all processors nowadays do 16-bits but I recall this coming up at some point making it kinda tricky as a C question.

Linear Zoetrope fucked around with this message at 12:04 on Apr 23, 2018

Adbot
ADBOT LOVES YOU

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

Cirofren posted:

For all the talk it gets has anyone here actually been asked to buzz a fizz in an interview?

(Sorry-not-sorry to bring this topic back up but someone mentioned it here last week and on the weekend my friend showed me an absolutely brilliant/disgusting JavaScript fizz buzz he wrote that contains neither 'fizz' nor 'buzz' literals by abusing base 36 toString)
I was asked to fizzbuzz a couple years ago.

In Flask.

Thanks, USA Today.

Joda
Apr 24, 2010

When I'm off, I just like to really let go and have fun, y'know?

Fun Shoe
I overheard management discussing interview questions, and they talked about a simple tree search on an unbalanced tree. They also mentioned that the only good solution was to use recursion, and mentioned having used that as a definitive filter. Pretty glad I avoided that considering my first instinct would be to use a queue

Hughlander
May 11, 2005

Cirofren posted:

For all the talk it gets has anyone here actually been asked to buzz a fizz in an interview?

(Sorry-not-sorry to bring this topic back up but someone mentioned it here last week and on the weekend my friend showed me an absolutely brilliant/disgusting JavaScript fizz buzz he wrote that contains neither 'fizz' nor 'buzz' literals by abusing base 36 toString)

We do initial phonescreen with a video app, the last question is basically 'share an editor and implement this trivial java functions' that I call, "Basically our fizzbuzz" The only purpose is to confirm that yes you do know java like your resume claims and then we move on to scheduling an onsite where we can skip trivia and get to problem solving and soft questions.


Linear Zoetrope posted:

Dumb question: doesn't this rely on the processor's atomic unit size for LE (sometimes being octets and sometimes being double-octets/16-bits)? I think almost all processors nowadays do 16-bits but I recall this coming up at some point making it kinda tricky as a C question.

My first thought would be union int and char[4] and set the int to 65535. is char[0] 0 or 255?

Hughlander fucked around with this message at 13:56 on Apr 23, 2018

feedmegin
Jul 30, 2008

Linear Zoetrope posted:

Dumb question: doesn't this rely on the processor's atomic unit size for LE (sometimes being octets and sometimes being double-octets/16-bits)? I think almost all processors nowadays do 16-bits but I recall this coming up at some point making it kinda tricky as a C question.

Not sure what you mean by atomic unit size?

You'd say e.g.

uint32_t foo = 0xdeadbeef;

Write code to deduce from foo whether you're big or little endian.

feedmegin fucked around with this message at 15:13 on Apr 23, 2018

fantastic in plastic
Jun 15, 2007

The Socialist Workers Party's newspaper proved to be a tough sell to downtown businessmen.
I've never gotten actual fizzbuzz but I've gotten some "reverse a string" and "return nth fibonacci number".

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
Its been a long time since Ive seen FizzBuzz at an interview, but during my last round of job hunting I did see a lot of find the biggest drop and identify a palindrome, which function the same as FizzBuzz in that theyre pretty straightforward algorithms.

Although the biggest drop threw me for a loop once when it was phrased as a question of when to buy and sell a stock. I didnt recognize the basic problem, and I couldnt get the idea of shorting out of my head. Just goes to show you that everyone screws up on occasion.

Vincent Valentine
Feb 28, 2006

Murdertime

fantastic in plastic posted:

I've never gotten actual fizzbuzz but I've gotten some "reverse a string" and "return nth fibonacci number".

I'm told someone asked "reverse a string" as an interview question at my company a few months before I was interviewed, the guy just said out loud: "dot split, dot reverse, dot join???" and did a heavy shrug. They apparently stopped asking that question after that.

Eleeleth
Jun 21, 2009

Damn, that is one suave eel.
I wanna hire that guy

Slimy Hog
Apr 22, 2008

Vincent Valentine posted:

I'm told someone asked "reverse a string" as an interview question at my company a few months before I was interviewed, the guy just said out loud: "dot split, dot reverse, dot join???" and did a heavy shrug. They apparently stopped asking that question after that.

If they let you to do it in any language you can do it in Ruby
code:
'string'.reverse!

qsvui
Aug 23, 2003
some crazy thing
code:
std::reverse(std::begin(str), std::end(str));
:unsmigghh:

geeves
Sep 16, 2004

ultrafilter posted:

I think this is conflating a couple things. There's seniority in terms of years of experience, and then there's seniority in terms of job function. There are plenty of people who've been programming for much longer than 7-10 years who don't have the experience necessary to be a senior engineer in the latter sense, and there's a much smaller number of people who are acting as senior engineers despite not having that many years under their belt.

I would prefer that the term senior engineer be reserved for the second sense, but I think that battle's been lost a long time ago.


There are plenty of companies that don't have roles for senior engineers. You may be working for one. If you stay too long, that will limit your career growth in the long run.

You bring up some really good points and I agree with both. There are exceptions to every rule and how to apply the title and maybe I need to rethink. So maybe there's different type of senior in those who want to lead vs. research vs. be an explicit expert.

Maybe I'm just biased at the moment, because I want to find another "Me" for the company and I'm realizing that an impossible task.

Shirec
Jul 29, 2009

How to cock it up, Fig. I

I'm trying to distract myself waiting for results from the job interview/audition stage. If I get rejected, I just want to rip the band-aid off so I can mourn and keep trying. :sigh: The company is so perfect for what I want and my personality. I have mild hopes but honestly, I've been so brutally let down by things this past year or so, I don't want to keep getting crushed.

geeves posted:

You bring up some really good points and I agree with both. There are exceptions to every rule and how to apply the title and maybe I need to rethink. So maybe there's different type of senior in those who want to lead vs. research vs. be an explicit expert.

Maybe I'm just biased at the moment, because I want to find another "Me" for the company and I'm realizing that an impossible task.

It's interesting that titles and their responsibilities can differ so from company to company. In my time as an accountant, those responsibilities would be much more in line with the principal title.

So what's been the problem with the potential "You"s? Not enough skill, drive, people skills?

Jyrraeth
Aug 1, 2008

I love this dino
SOOOO MUCH

So I've been looking at jobs that are primarily engineering jobs (my degree is in electrical engineering, though my current job history is stupid) a but they have a large component of software stuff in them. What sort of things should I (re) learn to kind of be able to say "yes I know how to do a few different things in C/C++, python, etc."

I've done a few hackerrank challenges for all 3, but I feel like fizzing the buzz doesn't really test if I know anything. Since I didn't really do much software in school I never really did anything with algorithms or trees. I vaguely know the different between an array and a list, but mostly because I've done some assembly/C/hardware stuff and you have to think about registers. I just feel like I'm missing something from not doing any algorithms or data structures courses.


Also lol @ all the job postings I find that ask for 1 year experience and "mastery of C/C++"

Vincent Valentine
Feb 28, 2006

Murdertime

Shirec posted:

I'm trying to distract myself waiting for results from the job interview/audition stage. If I get rejected, I just want to rip the band-aid off so I can mourn and keep trying. :sigh: The company is so perfect for what I want and my personality. I have mild hopes but honestly, I've been so brutally let down by things this past year or so, I don't want to keep getting crushed.

The best way to distract yourself, the best way to not be crushed if it goes poorly, is to just keep applying to jobs. Don't stop just because you have a promising interview. Don't stop even when someone says "You are for sure getting this position." Keep going, keep applying, and you won't even notice the letdowns.

I don't mean to say "Be pessimistic, it really works!" I mean to say that if you just keep busy you won't spend so much time focused on things that might not work out.

Linear Zoetrope
Nov 28, 2011

A hero must cook

Hughlander posted:

My first thought would be union int and char[4] and set the int to 65535. is char[0] 0 or 255?

That's a common way but IIRC it's secretly undefined behavior to read a union field that wasn't the last one you set (even if it basically always works). The better way to do it is pointer reinterprets which as I understand it is allowed by the C99 spec as long as the size of the type you're casting to is the same size or smaller and their alignment is the same.

feedmegin posted:

Not sure what you mean by atomic unit size?

You'd say e.g.

uint32_t foo = 0xdeadbeef;

Write code to deduce from foo whether you're big or little endian.

What I mean is there's two ways 0xABCDEFGH can show up in LE:

0xGH EF CD AB
or
0xEFGH ABCD

I had an old Macbook about a decade ago I recall doing the latter, much to my surprise, because I always assumed the former until I looked it up. Apparently some processors order the bytes in 16-bit chunks rather than 8-bit?

Wikipedia has a section showing the two different sizes, but it's not much more than what I put here:
https://en.wikipedia.org/wiki/Endianness#Examples

My point was more with weird stuff like that I'd hesitate to use it as a question, unless it's not really relevant in 2018 anymore.

Linear Zoetrope fucked around with this message at 09:35 on Apr 24, 2018

Xarn
Jun 26, 2015
As far as aliasing is concerned, just memcpy the data.

feedmegin
Jul 30, 2008

Linear Zoetrope posted:

That's a common way but IIRC it's secretly undefined behavior to read a union field that wasn't the last one you set (even if it basically always works). The better way to do it is pointer reinterprets which as I understand it is allowed by the C99 spec as long as the size of the type you're casting to is the same size or smaller and their alignment is the same.


What I mean is there's two ways 0xABCDEFGH can show up in LE:

0xGH EF CD AB
or
0xEFGH ABCD

I had an old Macbook about a decade ago I recall doing the latter, much to my surprise, because I always assumed the former until I looked it up. Apparently some processors order the bytes in 16-bit chunks rather than 8-bit?

Wikipedia has a section showing the two different sizes, but it's not much more than what I put here:
https://en.wikipedia.org/wiki/Endianness#Examples

My point was more with weird stuff like that I'd hesitate to use it as a question, unless it's not really relevant in 2018 anymore.

So the order of the bytes is 0xef, 0xgh, 0xab, 0xcd, and if you point a char * at the first byte and increment it 3 times you'll read them in that order? I have to say I've never seen that. It would be nice if the Wiki article gave some hardware examples.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

hendersa posted:

When I interview candidates for entry-level C positions, I always ask fizzbuzz. My next question is for the candidates to implement strcpy(). In both cases, its on a whiteboard with me giving the function prototype, open/close curly braces, and maybe declaring one or two variables at the top of the function as a hint.

I've filtered out a lot of candidates this way, which I lose no sleep over whatsoever. A lot of those filtered out are Java programmers that claim they know C/C++, but actually don't. They can fizzbuzz, usually, but the pointer stuff in strcpy() just completely blindsides them. I even ask for just a straightforward explanation of how a strcpy() implementation would work, and they can't get it.

The embedded world just isn't meant for everyone, I suppose. :shobon:

Isn't whiteboard strcpy a one liner?
code:
while (*s++ = *t++);

Shirec
Jul 29, 2009

How to cock it up, Fig. I

Got rejected for the job I had posted about earlier. Not much else to say atm

Vincent Valentine
Feb 28, 2006

Murdertime

Shirec posted:

Got rejected for the job I had posted about earlier. Not much else to say atm

Just keep at it dude. Every day you keep at it your odds improve because especially on paper, on resumes, you're a better person than you were yesterday.

fantastic in plastic
Jun 15, 2007

The Socialist Workers Party's newspaper proved to be a tough sell to downtown businessmen.

Shirec posted:

Got rejected for the job I had posted about earlier. Not much else to say atm

Slimy Hog
Apr 22, 2008

Shirec posted:

Got rejected for the job I had posted about earlier. Not much else to say atm

Bummer! I'm sorry! If it makes you feel better, I've been kinda thinking about leaving that company anyway. (Hence the reason that I'm in this thread)

hendersa
Sep 17, 2006

Bruegels Fuckbooks posted:

Isn't whiteboard strcpy a one liner?
code:
while (*s++ = *t++);
Yes, it is. The majority can't manage to reason their way to this end result, though. There are a ton of variations on this theme using temp variables and the like, but this solution is the most compact. You'd be surprised at some of the "working" solutions for this that I have seen. I had one guy that iterated through the source string until the NULL, while counting the iterations, and then called memcpy() on the source and dest pointers using the count as the size.

Aside from seeing something that kinda-sorta works, the important thing about this question is where you go next with it. You ask the candidate (usually a student about to finish a bachelors degree) how the function can then be hardened to avoid as many crashes as possible and log such conditions. A lot of students never really think about making software robust. They just want to make software that's done. You look for suggestions like checking for NULL inputs, specifying a range parameter a la strncpy(), making sure the source/dest pointers are more than the range apart to avoid overlaps, etc. You ask how you'd go about debugging a crash involving this function.

Testing how well a candidate can implement complex data structure algorithms off the top of their head is silly. My concern is finding a candidate with the right mindset, not one that memorizes trivia. If you're going to implement some complex thing, pick up a book or find a sample implementation. If you're really writing something so amazing there isn't an existing explanation/implementation of it, that's a sign that you're being far too clever for your own good.

... or that you should publish a paper on your amazing technique. :science:

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

hendersa posted:

Yes, it is. The majority can't manage to reason their way to this end result, though. There are a ton of variations on this theme using temp variables and the like, but this solution is the most compact. You'd be surprised at some of the "working" solutions for this that I have seen. I had one guy that iterated through the source string until the NULL, while counting the iterations, and then called memcpy() on the source and dest pointers using the count as the size.

Aside from seeing something that kinda-sorta works, the important thing about this question is where you go next with it. You ask the candidate (usually a student about to finish a bachelors degree) how the function can then be hardened to avoid as many crashes as possible and log such conditions. A lot of students never really think about making software robust. They just want to make software that's done. You look for suggestions like checking for NULL inputs, specifying a range parameter a la strncpy(), making sure the source/dest pointers are more than the range apart to avoid overlaps, etc. You ask how you'd go about debugging a crash involving this function.

Testing how well a candidate can implement complex data structure algorithms off the top of their head is silly. My concern is finding a candidate with the right mindset, not one that memorizes trivia. If you're going to implement some complex thing, pick up a book or find a sample implementation. If you're really writing something so amazing there isn't an existing explanation/implementation of it, that's a sign that you're being far too clever for your own good.

... or that you should publish a paper on your amazing technique. :science:
https://twitter.com/jacobian/status/988515858887491584

Deki
May 12, 2008

It's Hammer Time!
Had a real fun experience today on a follow-up call. Turns out my ex boss (who was my boss for like a month, out of a total of four years at this company) gave horribly negative feedback on a reference call. I wouldn't have even listed her, but this place wanted to get in touch since I was there so long. Bit me in the rear end, but my other references from work, internships, and professors was apparently very positive, so all might not be lost.

Pixelboy
Sep 13, 2005

Now, I know what you're thinking...

Deki posted:

Had a real fun experience today on a follow-up call. Turns out my ex boss (who was my boss for like a month, out of a total of four years at this company) gave horribly negative feedback on a reference call. I wouldn't have even listed her, but this place wanted to get in touch since I was there so long. Bit me in the rear end, but my other references from work, internships, and professors was apparently very positive, so all might not be lost.

Why on earth would you list someone who you didn't know exactly what they would say because you already talked to them about being a reference

huhu
Feb 24, 2006

Pixelboy posted:

Why on earth would you list someone who you didn't know exactly what they would say because you already talked to them about being a reference

If you did talk to them then what happened? If not then... Seconding this.

geeves
Sep 16, 2004

Shirec posted:

I'm trying to distract myself waiting for results from the job interview/audition stage. If I get rejected, I just want to rip the band-aid off so I can mourn and keep trying. :sigh: The company is so perfect for what I want and my personality. I have mild hopes but honestly, I've been so brutally let down by things this past year or so, I don't want to keep getting crushed.


It's interesting that titles and their responsibilities can differ so from company to company. In my time as an accountant, those responsibilities would be much more in line with the principal title.

So what's been the problem with the potential "You"s? Not enough skill, drive, people skills?

All three? We've interviewed a lot of "cogs" and if we were a bigger organization, that may be okay.

But when we've interviewed "Senior"-level candidates, they had no idea how to effect change with technology or even expressed interest in driving the direction of a company's technical decisions (or even thought about it). We ask a very open-ended question: If you had a great idea and wanted to start a new company or project, what would start with technology-wise. They. Have. No. loving. Clue.

I'm also full stack. My standards are high here because interviewing someone claiming to be full stack and can't construct a a SQL query that requires some simple JOINs, GROUP BY and HAVING or don't understand the foundations of JavaScript and the simple foundations of Java and / or python / PHP is hilarious.

Vincent Valentine
Feb 28, 2006

Murdertime

I also have no loving clue what I would start with technology wise on something that hasn't existed in my head until the moment I was asked what technology I would use for it.

huhu
Feb 24, 2006
I have a great idea for a website... Let's see I know React and Django pretty well... Yupp probably going to build it in React and Django.

Gildiss
Aug 24, 2010

Grimey Drawer

huhu posted:

I have a great idea for a website... Let's see I know React and Django pretty well... Yupp probably going to build it in React and Django.

Rejected:
Reason - Not enough drive

huhu
Feb 24, 2006

Gildiss posted:

Rejected:
Reason - Not enough drive

Why would I spend several months learning two new technologies and creating a inferior product. Technical debt from the first minute.

No you - you're rejected.

Volguus
Mar 3, 2009

geeves posted:

If you had a great idea and wanted to start a new company or project, what would start with technology-wise. They. Have. No. loving. Clue.

If they would have had a clue they would have started the company already. So would you. Other than that, wise people would implement that new project for their new company in the technology they know and are mostly familiar with. It'll be boring as hell, probably with little to learn technologically, but the only sane way.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


geeves posted:

We ask a very open-ended question: If you had a great idea and wanted to start a new company or project, what would start with technology-wise.

What does a candidate's answer to that question tell you about their ability to do the job? Please be specific.

CPColin
Sep 9, 2003

Big ol' smile.

ultrafilter posted:

What does a candidate's answer to that question tell you about their ability to do the job? Please be specific.

Oh, good, it's time for one of these aggressive challenges again. I forget if this thread or the Oldie thread had the last one.

Portland Sucks
Dec 21, 2004
༼ つ ◕_◕ ༽つ

Volguus posted:

If they would have had a clue they would have started the company already. So would you. Other than that, wise people would implement that new project for their new company in the technology they know and are mostly familiar with. It'll be boring as hell, probably with little to learn technologically, but the only sane way.

Nah. You are way over simplifying what it takes to start a company if you believe this. I've had more than one idea working in my industry that I'm very confident could sell, is not being done, and I know how to make it. I just don't have time at work to do it and the additional on the clock time to get it done would detract from things I could be doing that add more value.

Why don't I do it? Marketing, sales, contract acquisition, all the rest of the junk that goes into owning a business. I have zero interest in dealing with any of that poo poo. I really like just showing up to work and forgetting about it when I go home. It takes a lot more than just coming up with an idea to turn it into a company.

If you've been in any industry long enough to call yourself senior and you haven't had at least one idea like this you are probably not actually paying attention to the things that matter for your company.

Volguus
Mar 3, 2009

Portland Sucks posted:

Why don't I do it? Marketing, sales, contract acquisition, all the rest of the junk that goes into owning a business. I have zero interest in dealing with any of that poo poo. I really like just showing up to work and forgetting about it when I go home. It takes a lot more than just coming up with an idea to turn it into a company.

Which is why you choose the technology that you know and is the most boring to you. The last thing you need is headache from the one thing you do control and have power over.

Shirec
Jul 29, 2009

How to cock it up, Fig. I

I am really really god drat sick of my boss interrupting me talking about solving a problem or trying to contribute and dismissing it with "You have a business background so you don't understand". I think he really loving resents that I had a career before this and I'm not some wet behind the ears early 20s something he can bamboozle cause it's their first job. I am not exaggerating when I say that it comes up multiple times a week, ESPECIALLY if a spreadsheet is involved.

edit: Oh, before I forget. Boss has a fun new thing he does where he doesn't directly talk to me anymore, unless he doesn't have a choice. He'll talk to co-worker (the one that's assumed the mantle of team lead) and say "Coworker, do you think Shirec can do this today? Is this a complicated thing for Shirec? It's not that complicated, just pulling in some stuff. Whats the timeline..." and so on and so on about whatever I'm working on/is slated for the week. He doesn't do this with anyone else. This is added to his normal behavior of excluding me from any conversations about big refactors/sea changes for how we are doing something. So then I get to look dumb when I don't know/am doing it the old way

edit edit: Oh! And for a detail, he never dismisses my other co-worker who was formerly a machinist in that way. It's business (or me) that is bad

Shirec fucked around with this message at 19:41 on Apr 26, 2018

Adbot
ADBOT LOVES YOU

LLSix
Jan 20, 2010

The real power behind countless overlords

Shirec posted:

edit edit: Oh! And for a detail, he never dismisses my other co-worker who was formerly a machinist in that way. It's business (or me) that is bad

It's him.

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