What are the best programming interview questions you've ever been asked?

What are the best programming interview questions you've ever been asked?

Other urls found in this thread:

gwan.com/blog/20160405.html
twitter.com/AnonBabble

I'll answer the question when you say who this is

When can you start?

>What's your greatest weakness?
>Where do you see yourself in five years?
>Do you know JavaScript?
>How many gas stations are there in the United States?
>If you could be any kind of animal, what animal would you be?

Can you write a 1 liner recursive function in C++ to print out the contents of a c-string in reverse?

Do you have cumpute on your cumputer?

Do you masturbate?

Sort 2 billion 64-bit integers on 4MB of RAM.

I'd hit it.

>How do you ensure your comments are inclusive?
Seriously I was asked this by 2 Fortune 500 companies and 3 start ups in the Bay Area

wut

"It says here that you're proficient in C and C++, is that correct?"
"Yes, that's what I used at blah blah blah from blah blah blah to blah blah blah."
"Remember malloc?"
"Yeah, of course."
"Great. I want you to write malloc on the whiteboard."
I laughed out loud. "Nigga are you serious?"(I'm Black)
He laughed too. "Yeah! We'll do free if we have time."
As I went to the board he said, "you might want to describe the design first."

So I described a heap, and wrote some code to allocate from it. It kept me busy for a good long while and it gave the two of us a lot to talk about. There are a lot of decisions to be made about what to optimize for, and how to do it. We occasionally talked about how free() would work, but there wasn't really time to write it on the board (I wonder how many of his candidates got that far).

The element of surprise at the beginning is part of what makes it such a great question. My first thought was "that's preposterous," and when I laughed, he laughed too. So that broke the ice, put both of us in a good mood, and helped to keep the whole thing fun.

Here is a loo. Show me that you can poo in it.

i've seen dat pasta before

saved

What does that even mean? Do they want comments to just have random "diverse" words in them?

>I really have enjoyed this product. It has really helped with my productivity and I would really recommend it to others, especially those who identify as trans, Muslim or non-binary. Great work as always, Apple!

>nigga
I'm surprised you even got to the whiteboard
>I'm black
I'm surprised you even got to the malloc question

Something like this

Would you want IT to setup your laptop with Windows, or would you do your own install of Linux?

Only one answer would have passed that interview question btw. And thanks to g, I nailed it. Install Gentoo

tfw autistic shitposting gets you a job

This, nobody has answered it yet

Someone is hiring for a six-figure position to actually build and develop a working product and they spend their time on shit like this. Blows my mind.

>"What is variable Jew?"
var Jew = 6000000;

"Would you like to use my body for your pleasure, user?"

oh look dis again

>Why aren't you using javascript promises

I approximated that there should be about 200 000 gas stations in the us. Google tells me there are 168 000. What the fuck.

how

I live in Portugal and I know there are 4 gas stations around me. Assumed there should be 10 times that (40) between Sintra and Lisbon. Figured I could times that by 10 (400) to get the gas stations in the country. I have no idea but I assumed a state is usually 10 times bigger than my country so I multiplied by 10 (4000). There are 50 states so I multiplied by 50 and got 200 000.

I think he meant how did you Google that

Yet they are still being exclusive to Africans, Indians and Muslims. Where they are from the cuisine is mainly eaten with your hands.

I'm not sure if it's a good question, but the company I work in likes to ask potential employees "How many people in the world are shitting at this particular moment?"

>>If you could be any kind of animal, what animal would you be?

If you get asked something like this, that's a tell-tale sign the interview is a farce.

Either they have a candidate already in mind (likely someone internal) and are -- for whatever reason -- legally required to hold interviews, or they're just going through the motions of interviewing people and pretending no qualified candidates exist so they can hire pajeets.

Kek

>What's your greatest weakness?
Honesty
>I don't really think honesty counts as a weakness
I don't give a fuck what you think

Do you want something to drink?

"well there's one in this room but I'm not saying who!"

I'd say around 50 million?

Why aren't you currently working at a software company?

I was fired because I refused to call my boss' wife's son a "she".

muh dik

9/10 would fucking destroy

because full stack is easier, and I don't have to have a boss

Sauce?

But the red one is infinitely more inclusive, "they" could be a fat black crippled dyke

explain how to invert a binary tree without any code like i was 10 years old

...

>Changing they to she
>Inclusive

WTF. If someone in my company did this, I'd go home, update my LinkedIn and resume and start applying.

>open file
>select-all
>edit>invert

:^)

Sauce?

Hack this pen.

The best neckbeards in the world can install Gentoo in 60 minutes.
*whips out laptop*
Unfortunately, I need one who can install Gentoo in 60 seconds.

A Java job interview:

> What is the most common reason for problems in software?

Me: ehm.. From my own experience I'd say that has to be bad, or simply non-existent documentation.

> Wrong, it's the use of global variables.

He didn't like my response after that, so I didn't get the job.

Download a ready to go Gentoo VMware box from osboxes or something.

>but that's not what we meant

Uh, no complaints. You asked for Gentoo, you've got Gentoo.

That's a nice one. Good way of recognizing those that can think beyond comfortable abstractions.

Or they're retarded

Well... at least they made it very clear to you whether you want to work there or not.

>disqualifies 80% of candidates immediately

Yeah, that's the point the satire is trying to make. That people bitching about equality are actually generally supremacists.

I was once asked "are there any pet peeves you have about people you work with?"

After I started working there, it turns out they ask everybody that question because one of the programmers is a legit autist who freaks the fuck out whenever someone is eating anything at their desk.
I was munching on a bag of chips once. He threw his keyboard at me.

Is there supposed to be an efficient way of doing this? I can only thing of a wildly inefficient way that involves a lot of reading and writing to disk as you can only hold ~500,000 64-bit integers in memory.

it's some sort of nigger that relies on her chesticles to get everything and more

>with a shovel
me too, user, me too.

>throws keyboard
Can't they fire him for that? I mean, besides freakouts like that, autists are pretty much always a pain to work with anyway. I'm working with an aspi right now who freaks out when things don't turn out exactly the way he imagined it (even though he doesn't communicate, so it's always out of the blue). All the things he builds are like freaky rube-goldberg machines. They work, but don't ask how.

I've suggested getting rid of him a bunch of times, but even when he plays entire afternoons with his 3d pen (or his trains) instead of doing work, they just keep protecting him. I don't get it.

Worked with some good aspi's too, thank god, but it's always a gamble with them.

If you want to get rid of autists you have no place on 4 chan. Go back to normie reddit and facebook.

You missed a turn
is your containment board

Sup Forums was never a place for normalfags. Your normie views will always be attacked here. So shut up, normo.

It's a trick question. You can just use a sorting algorithm that utilizes disk memory instead of ram, for example bucket sort.

Some 3D slut

I didn't know that those existed. Now I know, thanks.

>What makes you want to work at [corporation]?

"Because you're hiring?"

>By not writing comments
:^)

>how did you hear about us?
>I say your ad online
>You saw our ad online?
>Yes
>awkward silence
>looks at me
>awkward silence

WHAT THE FUCK DO YOU WANT ME TO SAY

Also, that was sorta what I was thinking of how it would be done. So there's that at least...

a guy asking me some obscure javascript question about promises, then explained it to me.

It was apparently a way of weeding out know it alls, and showed how easily someone could grasp a new concept in 3 minutes.


I got the job.
dont be afraid of saying "i dont know" sometimes.

based niggra poster

Variable "Jew" is sometimes a solid and sometimes a fluid, so it makes it difficult to determine.

...

gwan.com/blog/20160405.html

>google's director of engineering hiring test
>what is the name of the KILL signal?
>Me: SIGKILL which #define is set to 9.
>Recruiter: no, it's "TERMINATE".
>Me: SIGTERM (15) is different from the KILL signal (9).
>Recruiter: that's not the answer I have on my sheet of paper.

I don't see why you wouldn't immediately switch jobs.
Autists with anger control problems are the ones who go postal and shoot up the place when they get fired.

That's your cue to continue talking about how you've always wanted to work at [company] and how you're a [insert 10 adjectives verbatim from your resume here].

and people want to work for this company

This. And say "I know [company name] has been included in [x] awards/top lists and that you [insert company mission statement or goal]"

>captcha: whiteboards

oh hey is one of those daily "look at this not disgusting brown girl" with couple with an inane tech question threads

the arrogance of you dimwits to think no one is noticing your """subtle""" conditioning is honestly sickening

>>>reddit
>>>leftypol
>>>bunker
and please tell whatever discord group you're coordinating your wannabe KGB style subversion in to kill themselves

So under8d holy shit what the hell is wrong with nu/g/

Reject code review as 'no code was actually changed'.

>Do you know what Vim is/how to use it?

It was in an interview for an internship, with the primary task being writing an ENTERPRISE web application in javascript for managing health-insurance data.


At the time, I was a GUI baby, so I said I knew the basics, like how to exit it.
That went over well.

Do you want to work with this framework? We think that could be something for you. Take the next few weeks to liase with your colleagues to get into it.

I think you mean minus 6000000

fanfic

that's pretty easy, Deepak

I'm surprised you are so much new

>look out of the window
>see a dozen people pooing in the street in front of the company

None are good:

>fizzbuzz
>1942 game in Unity
>write a colour class (I basically made it a vector class lel)
>if you could change one thing about an animal what would it be

that's a fake, you sperglord

I understand this was a shitstorm, and remember seeing it.

So, why the fuck can't I find any other source of it? Looks like it got deleted from github, and any mention of it from rbt.

>Have you ever worked in a team using COBOL?
>Yes
>Nice, do you like cocaine and bitches?
>fuck yeah, my first boss took us all out to a titty bar to do body shots and sushi with some bitches after we migrated an account & holdings system from a bank back in the day
>Sweet. You are hired.

reddit

Thanks. I fucking needed that laugh.

I thought I was immune to 3D by now. Can't win against the dick.

>a guy asking me some obscure javascript question about promises, then explained it to me.


What was the question?

Ugly

Anime is also ugly