Hacker News new | ask | show | jobs
by stcredzero 2920 days ago
I'd say the issue is, and continues to be, growing pains.

They're certainly losing the lead in software engineer talent (giving it away to whom, I'm not sure).

I keep on interviewing recent Comp Sci graduates who have a 3.75 or a 4.0 and who can't tell me how to implement cycle detection -- to the extent that they could write a pseudocode function signature or some kind of concretely implementable design. Many of the same grads try to tell me that a null pointer in a C structure uses no memory and other nonsense like that. You know what I think? I think the CA grad student population no longer knows those things, so they are producing undregrads who know even less.

my MBP crashes when plugging in an external monitor, etc?

When my Macbook Pro is "locked" it flashes an image of the desktop screen just before switching to the login prompt.

11 comments

Those things aren't taught in CS programs as the majority of companies don't need those skills. Most want application development such-as a web or iOS app developer.

However Computer Engineering programs teach those concepts as the focus is on low power micro controllers.

Those things aren't taught in CS programs as the majority of companies don't need those skills. Most want application development such-as a web or iOS app developer.

This sort of thing is very relevant for someone writing an application or a server process. Programmers who can write their own compiler are much better C and C++ programmers, because they have relevant background. Programmers who understand the low level stuff can write faster code when it's important, and they know better where to look when optimizing. Since when has our "field" become so flubby that we're now eschewing the notion of background knowledge?

Are you telling me that we are churning out Comp Sci grads who couldn't write their own low level libraries or compilers? Tech people should have at least a working knowledge of how their own tools work, to the extent that if civilization fell, they could have a good chance of recreating primitive versions of those things.

However Computer Engineering programs teach those concepts as the focus is on low power micro controllers.

Also relevant to high performance code. Also relevant to game engines. Also relevant to interfacing servers with legacy code. Also relevant to technology like WASM. Whoever decided to relegate stuff like that to Computer Engineering seems guilty of the same ignorance I see in these recent students.

I'm just going to throw in my experience here as someone who never went to college but currently writes software for a living.

I do mainly frontend web development with EmberJS, and occasionally work on our backend which is also JS, and I've been doing that for a little over 2 years now.

I never went to college and so a lot of the stuff you guys have been talking about in this thread goes right over my head. I've never written a compiler, the last time I wrote any C++ was high school, and I would so easily fail a lot of these interviews if those were the questions being asked. With all of that said, I think I do a good job at what I do without all of that knowledge. The industry is increasingly heading towards web/app dev in a lot of positions as other people mentioned, and I think it's very elitist to judge people for not knowing everything you do, even if you think it's important. The fact that this industry is becoming so open to so many people is amazing. Me being able to find a good job without a college degree just because of my knowledge of computers is what I love about tech. I think mindsets like yours are what help drive people away from it because they think they need a ton of knowledge to get an entry-level job, and that's just simply not true.

I don't want to sound like I'm accusing you of being malicious, I just wanted to share my point of view as someone who is relatively new to the industry and never went to college and doesn't have the knowledge that you are suggesting is very relevant. Maybe it is relevant and I just haven't figured that out yet, but from where I'm sitting that feels like something that could be taught instead of a hard and fast rule for hiring.

I never went to college and so a lot of the stuff you guys have been talking about in this thread goes right over my head...I think it's very elitist to judge people for not knowing everything you do, even if you think it's important.

Fair enough. However, if someone did go to college, they should at least know what they know, and know what they don't know. If someone is applying to a job with a 3.75 GPA where they might be doing some C++ and they go into an interview and try to tell you that a null pointer takes up no data, they haven't been well served by their education. They should at least know what they don't know, and not waste everybody's time.

However, you should know that these things are important. There are levels of knowledge deeper than being just a user of something.

I think mindsets like yours are what help drive people away from it because they think they need a ton of knowledge to get an entry-level job, and that's just simply not true.

So a generalist Comp Sci degree just needs to shrink into Web Development because of your feelings? Look, Web Development is a fine job, but it's not the same as a generalist field of knowledge like Comp Sci. Should mechanics expect that a Physics degree only be limited to their knowledge because of their feelings? They're applying Physics, after all. (Warning: don't you go and denigrate mechanics! That would be elitist.)

The very fact that you can have a job in tech without a Comp Sci degree isn't a justification for the dumbing down of Comp Sci. It shows that it happened needlessly!

Maybe it is relevant and I just haven't figured that out yet, but from where I'm sitting that feels like something that could be taught instead of a hard and fast rule for hiring.

Let's say you discovered an interviewee thought that a 404 meant the request never made it to the server. Let's say they also got a 4.0 GPA at some Web Development coding academy with a great reputation. Wouldn't you at least be scratching your head?

These are things that used to be taught in a Computer Science degree. Now they aren't taught, and companies are going to have to teach new graduate hires this stuff that people used to take multiple semesters to learn? It also used to be that Freshmen in college were expected to know how to conjugate verbs and compose grammatically correct sentences. Now TAs (I used to be one) are expected to teach these things to Freshmen. How is this not a decline in standards?

The question becomes: to what extent does acumen for writing a compiler overlap with the acumen for writing reliable code productively?

I think, generally speaking, the overlap in a Venn diagram of that would actually be relatively small.

People don't tolerate compiler bugs very well. I'd say there's quite a bit of overlap.
I think you're arguing that without good compiler authors, a typical application developer would be inherently unproductive. Which is true — compilers are necessary tools, and it's necessary that they be good.

But what I was suggesting is that one does not need to be capable of being both a compiler author and an application developer (if, for the sake of discussion, we avoid any semantic arguments and treat these as generally different things) to be of good value. I don't know how to, say, write a proper lexer, or write any assembly worth any salt at all, but I can write what I consider to be good, reliable application code at a reasonable level of productivity.

>People don't tolerate compiler bugs very well. I'd say there's quite a bit of overlap.

I don't see how your first point is related to the second. The goal for most webapps is to get something that works most of the time. Most software engineers simply don't need to worry about their third nine, much less their fourth

My school's primary languages were C and C++, and a smattering of java because it was just getting popular. Certainly the low level understanding that comes from writing a lot of code in those languages is helpful.

But the imperative/procedural mindset that it drills into you leads to some really terrible application code, and it takes a lot of exposure to higher level languages to break out of that mindset. It took me years. Switching to ruby was like starting from scratch.

By all means hire a C++ programmer to write your web app. They'll be able to debug your performance issues ricky tick. But also be prepared for some heinous procedural js/ruby/php/clojure/elixer/whatever.

By all means hire a C++ programmer to write your web app.

No one is advocating that anyone write web apps with C++. There are other kinds of servers. The complaint is that the once generalist value of a Comp Sci degree is now dumbed down, and grads are missing background knowledge they once had.

But also be prepared for some heinous procedural js/ruby/php/clojure/elixer/whatever.

This is yet another failing of Comp Sci degrees.

I think you are making a few assumptions that don't hold anymore based on your own CS education (I'm obviously making an assumption there...). I got my CS degree in 98 and there was a strong emphasis on C, C++, algorithms, and systems programming at the time because that's where the jobs were. We only had a cursory overview of other programming languages and paradigms, and no assembly - there were no jobs there. Scripting languages were for unwashed systems administrators, and no real programmer would touch them. Functional programming was a weird little academic thing with no future. OO was "if it is a noun make it a class".

There was a fairly good chance you would end up needing to write your own data structures, algorithms, sockets code and come up with a network protocol. You would run compilers, linkers, etc. Basically systems programming lined up with the job market.

Naturally after that I thought that was the "proper" way to teach CS. It worked for me. I got a jobs doing things I learned.

20 years later, I literally haven't run a compiler in years. I use libraries for data structures. I don't need to worry about allocating memory, billion dollar industries run on scripting languages. People are passing functions to functions that return functions like that's how it's always been.

I guess my point is "generalist" education needs to evolve with the industry. That means spending less time on low level details so you can spend more time on the tools, techniques and concepts used today. It isn't a "dumbing down" - it is changing the mix. You can only do so much in 4 years. What was "generalist" 20 years ago is "specialist" today, and it should be.

It isn't a "dumbing down" - it is changing the mix.

When it's leaving out background information, it's dumbing down. Programmers should at least know the basics of how indirection works. Why is it that so many interviewees with gold-pated GPAs would tell me null pointers used up no memory? Do they have the foggiest idea what happens when they add a member in a Python/Ruby program and how that differs from adding a pointer to a struct?

There's a difference between having the background information and treating everything as if it's hazy magic. It's excusable for the buyer of a car to treat the product they've bought as a magic black box. It's inexcusable when a "mechanic" or "engineer" is incapable of doing anything but treating things like magic black boxes.

Scripting languages were for unwashed systems administrators, and no real programmer would touch them.

But all of the smarter people in my program knew two or more of them.

no real programmer would touch them. Functional programming was a weird little academic thing with no future. OO was "if it is a noun make it a class".

I worked for a company that had to fight against those prejudices and low levels of knowledge to sell licenses. We sold licenses to Fortune 500 companies so they could run billion dollar businesses on a "scripting language." You know what prepared my for working there? A generalist Comp Sci education!

20 years later, I literally haven't run a compiler in years. I use libraries for data structures. I don't need to worry about allocating memory, billion dollar industries run on scripting languages.

But you are a savvy user of those libraries because you have the background knowledge. You don't usually need to worry about allocating memory, but you know what the gotchas in extreme corner cases are. And if you had to have a custom library written in C++ for your dynamic language application, you'd know how to spec that out and hire for that while looking out for the details. I had at least a foggy idea past the buzzword level when I graduated. How about the kids who are graduating nowadays?

I got my CS degree in 98

In 98 I was in grad school.

You can only do so much in 4 years. What was "generalist" 20 years ago is "specialist" today, and it should be.

Here is what I see in way too many recent grads with a 3.75 GPA. They don't know any of the background, past a handwavy level. They have misconceptions that are outright wrong. Many of them seem to spend 4-5 years doing nothing but using libraries and gluing stuff together. Hell, we learned that stuff too -- but we learned a bunch of other stuff at the same time, plus we learned what we didn't know and what to do about it. Then again, there was a contingent who only cared about learning X-Windows, because there were lots of coding jobs in X-Windows. Aren't the people who only learn particular technologies that are in the job market the moral equivalent?

Comp Sci is dumbing down to the level of consumers of magic tech. I know engineers and physicists who would have some idea of how to begin to recreate the tech they use if civilization would fall. I think a lot of Comp Sci graduates, if they wound up with nothing but machines running machine code, would qualify for Golgafrinchan Ark Fleet Ship B.

What kinds of mistakes would someone who fits this description make?
Deeply nested if/else logic, very long functions. Imperative logic that could be better written by higher level constructs like function composition, complicating code with micro-performance hacks, etc. In general inflexible code.

Of course not all of this is because I leaned C first. A lot of it was simply due to being a new programmer. But this kind of code is more prevalent in general in the C world. Just browse some opensource C projects.

I believe a lot of this stems from the "systems programming" mindset that goes along with learning C and C++. The requirements are very precise and well known, and don't change often. There is often a fairly precise "right answer" for how to do something where the "right answer" is some combination of performance metrics. Compilers are like that, file systems are like that, tcp/ip stacks are like that, etc. The programming boundaries tend to be very bright.

The "systems programming" mindset is a liability when writing business apps where a sales person can blow up every assumption and design decision and boundry in one day. The "right answer" is not clear, and not easily measured. The "right answer" has more to do with writing code that is flexible and easy to change. That is hard to measure and a totally different way of thinking.

But what you are citing here isn't a problem with learning C and C++. It's a failing of a generalist education. You might have known enough to avoid the gotchas of concurrency, but just out of school, you didn't know what you didn't know about business application development.
> Since when has our "field" become so flubby that we're now eschewing the notion of background knowledge?

I think the issue is more that the skillset follows the money. If you are a top web developer who can work in adtech/fintech/e-commerce and contract then you will make far more money doing that than you ever would in pure systems engineering. It's not so much that background knowledge is fluff, moreso that their focus is probably a lot more scattered than it used to be, and their background knowledge is perhaps in other places.

>Programmers who can write their own compiler are much better C and C++ programmers, because they have relevant background.

Sure, sure. But how many companies care about that sort of thing? C is rather my best language, and as far as I can tell, that helps me out as a sysadmin, but I need to be good at some EMCAscript based framework if I want a higher-paying Software Engineering job, at least outside of the embedded space (and I'm not that good at C. Also, most of the embedded types I know don't get paid SWE level salaries.)

In school I had to make my own assembler & emulator in C. I learned more about Software Engineering doing that than any other assignment.

I'd also mention I've never had to write an Assembler or Emulator in my work nor have the majority of my peers have had to do that.

> but I need to be good at some EMCAscript based framework if I want a higher-paying Software Engineering job

Then I should hope you know enough VM-fu to be able to optimize a JavaScript application.

You are completely wrong. The stuff you're talking about is completely irrelevant for 90% of the jobs. Step out of your bubble.
A Computer Science program that doesn't teach cycle detection is a bad Computer Science program. It might still be a good engineering program.

I enrolled in a CS program as a self-taught programmer specifically because I wanted a better grounding in the theoretical foundations.

I knew CS graduates who loved parsing theory and could implement some basic C compilers, and I knew some who didn't know what a SCSI controller was. You get out of your education what you put into it.

I had someone in an interview in Berlin ask me to write a garbage collector. In CSC 202, our professor talked about using reference counts. Reference counts can get leaks if you have two objects referencing each other with to path to either, but what I didn't realize is that Java hasn't used reference counts in a really long time. It does a search from each root (typically a thread) down the object tree; and it breaks things into young/old (eden space and .. something else) so long lived objects don't get searched as often.

I learned all of that during the interview lunch break when I looked it up on my phone. One of my good friends wrote a compile time GC for GO and did this PhD dissertation on it, and he probably would have got this question right. But if it's not in your field, well the problem space for problems is pretty fucking large.

Cycle detection? Man I could probably tell you back when I studied minimum spanning trees and wrote this thing to implement Dijkstra's shortest path:

https://penguindreams.org/projects/graphmapper/

Off the top of my head, I'd hope each node had a unique identifier and I guess I'd mark them/store the keys in a hash table. I'd move breath first and error out if I discovered the same hash/unique key .. which of course would give me a hash the size of the tree. Unless there's a way to mark the data structure, you now have a second structure the size of your key space.

I'm sure there are better solutions, but I wouldn't expect a senior program to know them off the top of their head, unless you're hiring really specifically for a position writing routing algorithms or looking for a senior airport transit architect.

When people say they expect someone to implement cycle detection, they usually mean Floyd's algorithm.

https://en.wikipedia.org/wiki/Cycle_detection#Floyd%27s_Tort...

If you come up with something else (like tagging nodes), you get a strike for inefficiency.

It looks simple enough to feel smug about once you know it, at the same time there's near zero chance the interviewers could come up with this algorithm independently without prior knowledge.

When people say they expect someone to implement cycle detection, they usually mean Floyd's algorithm.

Not necessarily. Sometimes the dataset only has on the order of 10k nodes, and you just want to warn users if they create a cycle, or keep particular routines from going into an infinite loop.

If you come up with something else (like tagging nodes), you get a strike for inefficiency.

A few days ago, I implemented cycle detection in an event notification system where the graph size is relatively small in just 4 lines of code, which should be immediately understandable by any competent programmer. That you should mandate Floyd's algorithm in all cases gives you a strike for pedantic design without regard to cost/benefit.

I'm not sure what are you trying to argue. I never ask obscure CS trivia, you misread my post entirely.
I just set a "visited" bit in the data structure while the code walks it. There's a cycle if the bit is already set. It's the same algorithm as yours, but a lot cheaper.
Perhaps cheaper in space, but you will have to do an initial pass over the entire structure to zero your visited bits first, so it may not be cheaper in time.
The GC already needs to sweep through the whole allocated memory to find the unreacheble objects to be freed. Flipping a bit while doing this isnt a big deal.
Just ensure the bits are always zero on allocation, use DFS, and ensure you re-zero the bits on the way out.
Since the first pass quit when it finds the first marked node, the zeroing can traverse the structure, erasing marked bits, and stopping at the first 0. The entire structure doesn't have to be visited.
The entire structure doesn't have to be visited.

We are both saying this.

You have to walk the hash table again to free it.
I had someone in an interview in Berlin ask me to write a garbage collector. In CSC 202, our professor talked about using reference counts.

Jeez. I think my profs covered ref counting as an introduction, then also went on to cover mark/sweep and generational collectors. We also covered compaction, copying and bump allocation. I don't think it took that long. If I were running a shop that focused on, say Java, I would want to know if my new hires knew background information relevant to optimizing code running on the JVM.

Cycle detection? Man I could probably tell you back when I studied minimum spanning trees and wrote this thing to implement Dijkstra's shortest path:

Someone should have given you breadth first search and depth first search, then ran you through how those are components to other algorithms. You should have been left with those as a "toolbox" such that you automatically spend a second thinking, "what would happen to that graph if I did DFS or BFS on it." That kind of toolbox is powerful and gives you all sorts of useful insights. You are not the only one around here to say, "Man I could probably tell you back when..." What you should be thinking now is that you were not well served by some of your teachers. Fortunately, this sort of thing is easily rectifiable.

Off the top of my head, I'd hope each node had a unique identifier and I guess I'd mark them/store the keys in a hash table.

Well good on you. You just did better than most of my last 6 interviewees.

Unless there's a way to mark the data structure, you now have a second structure the size of your key space.

This is the DFS/BFS part right here. Is the 2nd part of your statement likely to be true, and how often would it be true? Good call on the marking. (EDIT: Just thought of it: Bloom filter.)

I'm sure there are better solutions, but I wouldn't expect a senior program to know them off the top of their head

Cripes! Freshmen used to be able to do this stuff!

unless you're hiring really specifically for a position writing routing algorithms or looking for a senior airport transit architect.

How about you don't want programmers who will end up debugingg an infinite loop induced by a data cycle every single time?

EDIT: I actually just wrote cycle detection for my side project in golang the day before yesterday. It took me 4 additional lines of code. If you have a shop that uses gob or some kind of object serialization, this may well be very relevant!

I had someone ask me the cycle detection question once, and I didn't care for how they phrased it. Specifically, should I find it immediately upon entering the first cycle (at a higher memory/time cost) or should I just eventually detect it (e.g. turtle/rabbit)? It was on me to clarify, but as a newb to the industry, I felt like I should just know which was expected.

And either way, if I were to ask this question, I would spend a lot of time helping the person along the way to make sure they were able to make the logical leaps that made sense to them, not to me.

Here's how I asked the question. I would present the data for a 2 node cycle and ask what would happen to this routine. Here's a response I would get far too often: A conditional clause detecting a 2 node cycle. Then I would present a 3 node cycle, then ask how to detect an n node cycle, period.

Lots of 3.5+ GPA grads can't make that logical leap!

You're trying really hard to find a connection between implementing a GC and debugging memory leaks... and failing.

The whole freaking point of a GC like say Java's is that an average programmer can use it without having to understand how exactly it's implemented. Of course it won't hurt to know that, but it's not at all mandatory knowledge.

One just has to know which situations the GC can't cope with and avoid them. For Java there's at least one open source dedicated tool for finding leaks, it nicely explains what one needs to know.

One just has to know which situations the GC can't cope with and avoid them.

Unfortunately, many programmers believe that since Java uses garbage collection, you do not have to think about GC and ownership at all.

Oracle had to replace the fast implementation of substring that just returns a slice of a String (O(1) time) by a copying implementation (O(n)), because too many programmers do not know the basics of ownership/garbage collection and would accidentally hold on to larger strings.

Seeing the implementation details of reference counting, mark-sweep collection, and perhaps a generational collector once, makes you more aware of memory and ownership issues, even if you forget the nitty gritty details later.

You're trying really hard to find a connection between implementing a GC and debugging memory leaks... and failing.

I spent years at a vendor for a Virtual Machine. That you would compose such a sentence shows that you are ignorant of some aspects of optimization. You don't even know what you don't know, and projected that ignorance on another.

The whole freaking point of a GC like say Java's is that an average programmer can use it without having to understand how exactly it's implemented.

One of my company's most frequent consulting tasks was helping clients optimize to maximize throughput for the generational GC. That you jumped to the conclusion that I was talking about memory leaks is pretty damning.

> When my Macbook Pro is "locked" it flashes an image of the desktop screen just before switching to the login prompt.

This used to happen to me and I was very annoyed. Felt like a major security hole.

But now I get a scrambled image before the login prompt. Are you on the latest macOS?

I got this just two weeks back, fully up to date 2015 MPB. I was shocked that this could happen; I could even click around on the desktop for a few seconds before it locked up, and I had to hit Esc for the login screen to appear. I didn't even realise it was locked the first time it happened. A very visible reminder about software quality at Apple.
I get sometimes scrambled image and sometimes normal desktop before login, it could be rendering something from uninitialized buffer.
I also get the scrambled image as well. I am on the latest, last I checked. I generally keep updated.
> recent Comp Sci graduates

I knew some back in the early 80's who didn't know what a CPU register was.

who can't tell me how to implement cycle detection

You should read this before asking that again http://www.nihlos.com/2009/05/04/stupid-interview-questions/

When my Macbook Pro is "locked" it flashes an image of the desktop screen just before switching to the login prompt.

Same with my Mac Mini on the lock screen. Very easy to start a camera going (say an iPhone) waggle the mouse and get a screenshot of any locked Mac.

I think this is because the Mac doesn’t lock at all by default. The actual behavior seems to be “prompt for password after screen saver is interrupted” so that flash is the time it takes the OS to realize the screensaver just turned off and it’s time to ask for the password on the lock screen.

When I leave my Mac I always do a ctrl-shift-eject/power to force the lock immediately.

The saving a screenshot and immediately showing it is a UI trick to make waking up/unlocking look faster, gives the user something to look at while the apps are actually restoring to running state. Just they didn’t think this one through or test it adequately
This sounds like the kind of applicant who would complain that fizzbuzz has no real world application. Despite the attitude in that article, there are real applications of cycle detection.

https://en.wikipedia.org/wiki/Cycle_detection#Applications

It sounds like the kind of applicant who understands the problem far better than the interviewer. So go on then: once you have detected it, what algorithm would you use to repair it? Wouldn’t you consider its existence to be a bug in the way the list was constructed?
It depends too much on the context to give a general answer what to do with it. It can easily not even be an "error," like in the first example on this link where you're simply testing the strength of a PRNG. Another would be if you're writing something to represent reals in decimal and you want to see where your number loops, like 1/7 = 0.(142857).

Examples where it's not desired, and what to do: Detecting infinite redirects in browsers and stopping the loop. Detecting thread deadlock and terminating the process. Detecting looping references in an Excel spreadsheet and showing #ERROR in the cells instead of letting the process hang forever.

My MacBook does the same. I was messing around earlier this week taking a video of it as I thought you could capture private info from it and while I couldn’t do it from my iPhone with a couple of tries I’m fairly certain you could with a higher quality camera. It’s a ridiculous security vulnerability.
> When my Macbook Pro is "locked" it flashes an image of the desktop screen just before switching to the login prompt.

It's the same thing on Android when you are switching users. How something like this can get QA is crazy to me. That is certainly not the way it's supposed to work.

> You know what I think? I think the CA grad student population no longer knows those things, so they are producing undregrads who know even less.

Any data points on the grad students specifically? Or is it just a guess based on how the undergraduates performed?

Finally someone else who noticed this! I took video and it is indeed realtime. There has to be a way to exploit this obvious oversight. This is with filevault on as well.
I have to disconnect and reconnect my thunderbolt display exactly 2x to get the webcam on it to work.
They couldn't even come up with the answer of keeping a hashtable of the pointers to check for duplicates?