Live data from Hacker News

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

computerenhance.com

31–40 of 103 posts

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

#33

The second one is absolutely trivial if you've ever read K&R (even if you're not allowed to just call strcpy()), while the fourth one is also very straightforward if you know about https://news.ycombinator.com/item?id=15266331 ; but 32 years ago, knowledge definitely did not propagate as quickly as it does today. Additionally, I was allowed to store Color however I wanted — so if I needed some precomputation, I was a…

Just tried the:

y -= x >> 4;

x += y >> 4;

Certainly works, and seems to require 100 iterations to get a full circle.

Are there other approximations, taking smaller angular steps, to get a better circle?

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

#34

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.

I would far prefer getting managed C# over the Electron garbage that constitutes much of Windows nowadays.

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

#35

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…

I can tell this is from forever ago by floppy disk.

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

#36

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

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

Syntax error: variable "to" not found

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

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

Exactly! I used this question regularly. It wasn’t a gotcha question or even an impossible-without-experience question as the author thinks. It was a show me HOW you think through something question. There are a lot of ways to solve it, from scanline to sin/cos to using the circle equation, but you can _progress_ from naive to advanced solutions, and all solutions above plus the DDA or Bresenham solutions have symmetries (hint: more than four quadrants are symmetrical) that you can use to optimize it. A practiced interviewer can learn a lot about the candidate with this question.

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

#38

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…

I can tell this is from forever ago by floppy disk .

That's an IRL save icon for anyone who's wondering.

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

#39

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…

I can tell this is from forever ago by floppy disk .

Yes, but it feels like yesterday...

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

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

Exactly! I used this question regularly. It wasn’t a gotcha question or even an impossible-without-experience question as the author thinks. It was a show me HOW you think through something question. There are a lot of ways to solve it, from scanline to sin/cos to using the circle equation, but you can _progress_ from naive to advanced solutions, and all solutions above plus the DDA or Bresenham solutions have symmet…

I wonder if there's a class of people who managed to get CS degrees but really aren't that good. To them, it might feel more like either you remember the perfect and optimal but complex solution you were taught in a class, or you don't happen to remember it and are completely stuck and can't make any progress at all. I don't think I'd want to hire or work with somebody who can't come up with some sort of solution after thinking through it for a few minutes.

In fact, coming up with the CS-perfect solution immediately may be a bit of an anti-signal. I want the person who can think their way through to a solution to a problem that's new to them reasonably well. The fact that you happened to have memorized the best algorithm for this and can recite it on command doesn't tell me much useful, because nobody has the perfect algorithm for everything memorized.

Post reply on HN