Esoteric/low-level .NET questions, also fundamental compsci theory

On my current interview rounds, I'm encountering some questions on .NET that are a lot more 'low-level' than I'm used to. If not for these interviews I probably would never even have heard how much in-depth information there is out there on these topics.

Things like intricate details on memory management, how the garbage collector works behind the scenes, entry points into assemblies, things like that.

Is there a comprehensive resource where I could read about this stuff, without having to trial-and-error through each time I encounter a new low-level question on another interview?

Also, another problem area I'm hitting against is fundamental data structure and algorithm problems. I don't have a formal academic background in theoretical computer science, so any knowledge I have in this area is just from pure self-study and research. I can tell you what some common data structures are, how some common algorithms work, but beyond simple stuff it's all greek to me...

I did try to read up on some commonly recommended literature, such as the Intro to Algorithms (Cormen) and the (supposedly easier) Algorithm Design Manual (Skiena), but beyond the stuff I already know, I am seriously befuddled.

So I feel I have the super-basics down, but am having trouble taking the leap to the advanced-basic or intermediate level. What would be some good resources to learn here?

For the basics of data structure, algorithms, and asymptotic analysis, Sedgewick's textbook is a pretty good starting point. From there, there's a softer-hitting algorithms textbook that I like to refer people to. Besides the two texts you listed, the Kleinberg & Tardos algorithms textbook is also quite commonly used.

A lot of these questions are attempting (in some cases by design, in other cases by dint of just "find people like X" where X is someone they know is good) to ascertain if you have absorbed this knowledge via some degree of experience, rather than simply by book learning.

The esoterica stuff is somewhat dangerous[1] to ask without leaving it reasonably free form, so the candidate can display those areas they have had to dig into, rather than happening to know something about a specific "pet" area of interest to the interviewer.

I'm not interested in someone being able to implement, say a Hash table, in an interview (though I would hope they could make a decent stab at it) simply because someone could memorise that. I am interested in them knowing *when* to use one, and crucially when not to. Obviously having an understanding of them is required for that, but hopefully you get the idea of the ability I'm trying to test for.

I have no individual book for .Net esoterica, though I would consider myself reasonably well informed[2] on parts of it. This is largely through seeing something and going "how does that work?" then googling/experimenting till I find out. That said I have huge gaps on things that don't matter to my needs (the security model for example). I would almost certainly not be interested in a job that viewed my lack of knowledge in that area as a negative, unless they advertised such a thing as relevant.

Ultimately you may be interviewing at companies that do want genuine experience (as opposed to merely 'time' experience) so your lack there is being effectively checked. Getting experience then can be a catch22, but asking about it here is a good sign you can get it.

There have been a couple of threads on here before about good blogs to read, many of them were relevant to .Net (I recommend Eric Lippert's in particular from the point of view of the compiler, and the various type systems in play). Reading and groking much of them will help.

MSDN has some excellent articles on specifics of the JIT, GC and more, though you will find far more direct, practical info on the blogs in mos cases. Just take care to look at he posting date to see if it may have been invalidated by later releases.

I've not seen a great article on generics (warning, this is way more complex than it looks behind the scenes, think about how this interacts with static variables given the shared backing post JIT implementation for all reference types for example), though the PDF from Andrew Kennedy at MSResearch on that is excellent if you can handle the academic style.

I haven't linked any of those resources, sorry about that, this is a) because I'm on my iPad and switching tabs will lose this textbox's contents and b) digging them up will likely take you down some interesting paths. But really it's (a)

1. high chance of false negative if asked badly, *very* dangerous would be high false positive2. a pet peeve of mine I try to suppress is annoyance at people who call themselves "expert" at something when they're competent at best. If you call yourself a c#/.Net expert on your CV you better know much more about it than me. I'd say Meta counts as an expert for example./begin rantI would expect someone who has spent several years working with managed code to understand quite a bit about how GC works in their platform. It is depressing the number of people I see who think java/C# do reference counting. Even more depressing is when you ask them "so what happens to cyclic references" and they just look flummoxed. If your job depends on a platform for correctness learn something about it! For interests sake if nothing else./end rant

I guess my main point of frustration is that most/all of the positions I'm applying for are not too different from what I've been doing for the past decade (and quite well at that based on my ability to get stuff done and performance reviews). I've never encountered any of these topics during the course of my job, but now they are coming out of the woodwork on these interviews I've been going on. I guess it might be that I'm being considered for more senior positions than those I was interviewing for several years ago.

However, I did run some of the questions - both general and specific - to my friends who work in the roles/positions/seniorities that I'm targeting, and virtually all of them either drew complete blanks, or could only stammer something along the lines of "uhm..I think I heard about it in college/X years ago but I don't remember". I'm assuming these guys are doing great at their jobs, as some of them have been at their firms for years and in pretty cut-throat environments at that.

My conclusion has been that the set of knowledge to be a great interviewer to get into these kinds of positions is not exactly the same as that to be actually good working in the role once hired. Of course, they aren't mutually exclusive, and a good knowledge base on theory and underlying mechanics is never a bad thing. But I definitely sense a (big) disconnect.

My conclusion has been that the set of knowledge to be a great interviewer to get into these kinds of positions is not exactly the same as that to be actually good working in the role once hired. Of course, they aren't mutually exclusive, and a good knowledge base on theory and underlying mechanics is never a bad thing. But I definitely sense a (big) disconnect.

As someone who has just started interviewing for their company, this is true.

However, any good company would not want people who simply do their job really well. They want people who, (1) take initiative and go beyond their jobs (2) can handle extraordinary situations when things aren't working right (3) can be relied upon when you need to design/develop products with tight requirements (speed/low memory, etc).

I guess the theory is that if you know the fundamentals of comp sci, show an ability to think out of the box, and an ability to learn new stuff, the combination will pretty much help you with any development related scenario you may find yourself in.

I am not sure how accurate that is. In reality, interviewers ask these questions because these were the questions they were asked in their interviews.

I am not sure how accurate that is. In reality, interviewers ask these questions because these were the questions they were asked in their interviews.

I came up with my own question based on some work I was doing (years ago).

Meant the different approaches were fresh in my mind and that I wouldn't punish people for initial missteps because I could remember mine. Also allows me to guide them along when they get stuck. Interview questions where the candidate has to basically make one "leap" and can't get anywhere without that are evil.

In my line of work, when TSHTF you have to break-out windbg and go full X-Files on your 3rd-party mixed-mode assemblies.

Are you curious? Are you a hacker or a user? Do you know why the tools you use allow you to be so productive? Are you, within reason, concerned about what your choices entail for the system? How do you familiarize yourself with a new api? Docs? Google? Reflector? Tell me how you work!

Dick-swinging, or sometimes I just like to be mean. As in "Describe the IL emitted for a branch on a short-circuit binary OR operator. OK, now for a XOR.

I'm a sysadmin. We recently raked our developers over the coals because their code was running slow and then tried to blame it on us. We were able to prove to them that it wasn't our servers, but in fact how their code was doing memory management (or lack thereof). Without going into too much detail (I honestly don't remember all the details), their code, while efficient in number of lines, was doing thing in such a way as to prevent garbage collection from happening automatically. This caused an eventual slowdown as things were constantly being paged to disk. As more and more things got paged, then reread, it got slower and slower.

When we took our findings to them, their response was along the lines of "memory management? What's that? Why is that important?". My bosses head hit the desk at that point in despair.

Is it possible they've identified a lack of knowledge in their team and want to correct it?

I'm still a lowly college student trying to work my way up to be worthing of posting help here, however, I would suggest you take some time, and look at some of the courses you can find for free online... (good search mooc), here are some listings of algorithm http://www.mooc-list.com/tags/algorithm (that appear to already in process...) but there, and coursera is another good place to look. https://www.coursera.org/courses?search=algorithms Reading a book is good and all, but IMO until you really implement these solutions yourself in an arbitrary language, you won't really get a good handle for them...