Live data from Hacker News

The four programming questions from my 1994 Microsoft internship interview (2023)

computerenhance.com

11–20 of 103 posts

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#11

void CopyString(char *From, char *To) { /* Fill this in */ } The only correct answer to this interview question is "No."

Hey, in 2026 strcpy is still part of the C standard library (much to the chagrin of anyone security conscious).

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#12
post #10

The circle outlining one seems interesting to me. I definitely didn't read the algorithm ahead of time, and I'm probably not as smart as a revolutionary genius computer scientist, but I thought of 2 basic algorithms in a few minutes. You could iterate over the degrees 0 to 360, use trig functions to figure out where the point at that angle is, and plot the closest point. Might need to be a bit tricky about the step s…

Spoiler: https://gist.github.com/denkspuren/df24bf57ae3a44310631

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#13
post #2

It's pretty amazing to me that, if your goal is to check that the intern candidate can write plain C, the questions still look pretty reasonable to me even in 2026, maybe except for the question related to colors which will probably confuse the majority of the interns (2 bits per color? how is that possible). For the circle drawing exercise, it just seems that the interviewer did not do a good job hinting the author.…

It seems the first two questions are coding ones, and the second two ("flood fill" and circle drawing) are more thinking ones. The flood fill color detection one would be fastest with a look up table returning a bitmask of colors contained in the byte, with the Color param also as a bitmask, then the result is just lut[Pixel] & Color. The circle drawing one only needs you to know basic trig to get from radius and ang…

The circle one is fishing for sonething clever. 90s without floats means no trig

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#14
post #6
post #2

It's pretty amazing to me that, if your goal is to check that the intern candidate can write plain C, the questions still look pretty reasonable to me even in 2026, maybe except for the question related to colors which will probably confuse the majority of the interns (2 bits per color? how is that possible). For the circle drawing exercise, it just seems that the interviewer did not do a good job hinting the author.…

> (2 bits per color? how is that possible) Assuming high colour depth, yes, but wouldn’t it have been specified as part of the question that ‘this was for four-color CGA mode’? I think 2 bits per colour for 4 colours total seem pretty sensible even in 2026. :-)

Their point, I believe, is that someone (just about any younger person in 2026) who has never seen indexed color modes, or colors taking less than one byte per pixel to encode, could reasonably be confused by the notion of "two bits per pixel".

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#15
post #2

It's pretty amazing to me that, if your goal is to check that the intern candidate can write plain C, the questions still look pretty reasonable to me even in 2026, maybe except for the question related to colors which will probably confuse the majority of the interns (2 bits per color? how is that possible). For the circle drawing exercise, it just seems that the interviewer did not do a good job hinting the author.…

It seems the first two questions are coding ones, and the second two ("flood fill" and circle drawing) are more thinking ones. The flood fill color detection one would be fastest with a look up table returning a bitmask of colors contained in the byte, with the Color param also as a bitmask, then the result is just lut[Pixel] & Color. The circle drawing one only needs you to know basic trig to get from radius and ang…

I don't believe you need trig for that, it actually makes it harder if you try to iterate the angle. I believe the expected solution is to start at (R, 0) which is known belongs to the circle, and go left/top, choosing the pixel closest to the circle on each step, which does not require any floating point arithmetic.

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#16
post #13

Earlier quoted context omitted.

It seems the first two questions are coding ones, and the second two ("flood fill" and circle drawing) are more thinking ones. The flood fill color detection one would be fastest with a look up table returning a bitmask of colors contained in the byte, with the Color param also as a bitmask, then the result is just lut[Pixel] & Color. The circle drawing one only needs you to know basic trig to get from radius and ang…

The circle one is fishing for sonething clever. 90s without floats means no trig

So use sin/cos lookup tables?

As the author notes, it would certainly be a massive ramping up in difficulty if they were expecting you to reinvent the midpoint algorithm on the spot.

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#17

void CopyString(char *From, char *To) { /* Fill this in */ } The only correct answer to this interview question is "No."

Hey, in 2026 strcpy is still part of the C standard library (much to the chagrin of anyone security conscious).

The key point (which I believe static analysers these days can easily check for) is to check the sizes of the source and destination.

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#18
post #10

The circle outlining one seems interesting to me. I definitely didn't read the algorithm ahead of time, and I'm probably not as smart as a revolutionary genius computer scientist, but I thought of 2 basic algorithms in a few minutes. You could iterate over the degrees 0 to 360, use trig functions to figure out where the point at that angle is, and plot the closest point. Might need to be a bit tricky about the step s…

An optimal algorithm is shockingly simple

https://en.wikipedia.org/wiki/Midpoint_circle_algorithm

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#19
This is a fun article. As a current Principal at MSFT I've never seen these type of questions being asked in interviews. I don't think it's fair or accurate to say "If you’re an experienced programmer, you already know how to do all of them". So many of the SWEs and candidates at Microsoft are just studying leetcode using python, joining the company and writing managed C# code.

Re: The four programming questions from my 1994 Microsoft internship interview (2023)

#20
The author’s memory is remarkable. I hardly remember my own name that far back, LOL. Back then, I knew I would always struggle with those types of interviews, so I always carried a floppy disk with me to them. The disk contained a few programs I had written, and I would simply tell the interviewers, “Don’t give me a quiz. I’m terrible at it, so if you do, I’m out.” However, if they were willing to look at my capabilities, I would share a few of my programs. That approach actually worked most of the time and got me the jobs. The good old days!
Post reply on HN