Live data from Hacker News

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

computerenhance.com

61–70 of 103 posts

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

#62
post #58

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 capabili…

Why did that approach change?

Surely the modern equivalent to that is having public git repositories.

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

#63
post #9

Earlier quoted context omitted.

2bpp is indexed obviously, question in 1994 would be is it bitplane or packed

CGA was very limited, and didn't even support full per-color indexing - instead you got to choose one of two palettes (i.e. one of two different sets of 4 predetermined colors). CGA was followed by EGA which supported 16 individually indexed colors (with a palette of 64 colors). With dithering you could display "faded polaroid" quality photos.

CGA is even more nuanced than just two palettes. You can choose from three palettes, and each can be set to low intensity or high intensity, so you can effectively choose from six. On top of that, the background colour for each palette (colour 0 which defaults to black) can be set to any colour from the full CGA 16 colour palette! I wrote a sample program for a friend recently to demonstrate this https://github.com/samizzo/cgasample

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

#64
post #54

This brings back memories! I could easily pass this interview today, because I used to write code like this all the time 25 years ago doing gamedev (and so did everyone else to some extent). But the really interesting thing is that I just realized I haven't written code like this in a long, long time. Programming has changed over time, but the change has been so gradual I hadn't even realized this until this article.…

The circle one would have gotten me. "There's a neat algo for this. The name starts with B, and you just get an oracle that tells you if next y ==current y or y-1. And then you loop x, and you have to mirror that to do all octants of the circle with mirroring and flipping by -1 for some octants" Writing that oracle after 20+ years would have been left as an exercise to the reader.

Fair, I wouldn't have been able to write Bresenham back then (or now, off the top of my head). I'd have written a simple trig-based one. Maybe I'd have failed the interview :D

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

#65
A friend of mine interviewed for MS around the same time, albeit for a senior-ish position, and his question required knowing Fibonacci trees.

It wasn't an abstract CS flex on interviewer's part either, because apparently the fib trees were actually used in some part of the FrontPage.

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

#66
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). this is probably a rhetorical question, but lemme answer anyways: By packing the colour channels into a single byte. So, for example, you'd have RRGGBBAA within a single byte, for each pixel. Giving you 64 possible colours, with 4 steps of alpha. Or if you don't need to have alpha, you could pack it even further down to RRGGBB in a byte, which leaves 2 bits left over for th…

A modern example of odd color schemes is 18bit color which is still often used in small cheaper displays (666/18bit vs 565/16bit) keeping the maximum color space available for all colors on these displays. If you are lucky you only have 16bit bus available and also need to do 3:2 packing, but that allows you to use 24bit in code and ramming the bytes in sequence over the 16bit bus without any modification (since they ignore the extra two bits per color).

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

#67

Earlier quoted context omitted.

/* YOLO */ while (*to++ = *from++) ;

Syntax error: variable "to" not found

Upper case is for compile-time constants. I couldn't make myself do it.

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

#68
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…

Your second one is somewhat in the right direction, I think. My guess would be that you split the circle into eights, that keeps the tangent slope between zero and one. Then you can go along one axis from 0 to sin(45°) times the radius and the value along the other axis will always either stay the same or change by one as the derivative is between zero and one. As you move along your primary axis, you generally keep the value along the secondary axis unchanged but you accumulate the error. When the error crosses 0.5, you move one pixel along the secondary axis and adjust the error accordingly. And of course you always draw eight mirrored and rotated pixels. In some way an adaptation of the Bresenham algorithm for drawing lines.

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

#69
post #62
post #58

Earlier quoted context omitted.

Why did that approach change?

Surely the modern equivalent to that is having public git repositories.

Perhaps, but has "I'm not doing your whiteboard challenge - check out my git repositories instead!" ever worked for you?!

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

#70
post #62

Earlier quoted context omitted.

Surely the modern equivalent to that is having public git repositories.

Perhaps, but has "I'm not doing your whiteboard challenge - check out my git repositories instead!" ever worked for you?!

Haha, for some reason when phrased like that I get a bad feeling about the outcome of the interview.
Post reply on HN