News for hackers. Stuff that matters.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by yawn_010101 on Wednesday June 27, 2018 @11:20PM (#17413819)
Having interfaced with Apple in a different way (apart from owning a new MBP and an iPhone X) 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). But the single most horrible experience I've had with Apple in the last year was trying to get software published on the App Store.

That's a department that's so large that it's become a classic bureaucracy -- middle managers run amok, pettiness, lack of professionalism, etc.

I was trying to publish a piece of software using their less extortionate subscription options and I was told by a young woman manager that I would have to have feature X in order to qualify. I added feature X in a couple days and got back to her. She was surprised (disappointed?) and then told me I'd have to have feature X + feature Y in order to qualify.

I have a couple of contacts from the "good old days" and sent a very angry email. Middle manager woman disappeared, her boss called me and apologized within a few minutes.

If I didn't have that contact I probably wouldn't have gotten past her.

What has happened to Apple that their dev teams work against devs, compile times (this is 2018 remember) are now counted in minutes for small projects, my MBP crashes when plugging in an external monitor, etc?

They've grown too fast. My contact told me that their App Store team is now interfacing with over 2 million developers. How do you grow to accommodate that?

Now, what is the answer to all of this? Fix the marketing driven culture. Thinner isn't better. The number of apps on the app store isn't a meaningful metric. New languages are cool only if you can actually pull them off. Etc.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by woolvalley on Thursday June 28, 2018 @12:21AM (#17414039)
I wouldn't really say those are the reasons why.

The app store and code signing have been fairly bureaucratic to deal with from day one. It's actually improved compared to the initial years from turn around times measuring in a day or two vs a week or two. I remember doing such tricks such as resubmitting the same binary and it getting passed. It really is a dice roll.

Compile times comes from swift and promoting it too early because it was too immature. If you write your code in objective-c, your fast compile times will come back. Swift compile times have been improving as time goes on.

They also don't pay as well compared to google or facebook. But even then I think it's more a management thing, since they determine the priorities in software dev.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by fooker on Thursday June 28, 2018 @03:28AM (#17414789)
>Swift compile times have been improving as time goes on.

Swift compile times will never be close to ObjC or C compile times, no matter how much engineering goes into it. This is because of how the language is designed, it requires a typechecker which solves an NP hard constraint solving problem.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by woolvalley on Thursday June 28, 2018 @02:01PM (#17419110)
There is a whole bunch of low hanging fruit in the swift compiler as far as compile speed goes.

What swift compiler devs complain most about is about how operator overloading causes some sort of O(n^k) or worse check, because things like the '+' operator has dozens of implementers.

If your really worried about type inference slowing you down, you can write out all of your types like you didn't have type inference. You could even do it in an automated fashion like your source code was some sort of cache.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by 14113 on Thursday June 28, 2018 @04:23AM (#17415044)
Unlike C compilers which have no NP-hard problems to solve /s
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by fooker on Thursday June 28, 2018 @08:06AM (#17416156)
You can write a C compiler without solving NP hard problems. You can even have pretty good optimizations.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:11AM (#17413999)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by cobookman on Thursday June 28, 2018 @12:28AM (#17414072)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:41AM (#17414120)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by HuggableSquare on Thursday June 28, 2018 @03:06AM (#17414693)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:20PM (#17418222)
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?

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by ovao on Thursday June 28, 2018 @12:54AM (#17414170)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by WalterBright on Thursday June 28, 2018 @01:02AM (#17414197)
People don't tolerate compiler bugs very well. I'd say there's quite a bit of overlap.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by ovao on Thursday June 28, 2018 @01:30AM (#17414310)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by lsc on Thursday June 28, 2018 @01:07AM (#17414218)
>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

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jacobsenscott on Thursday June 28, 2018 @01:25AM (#17414287)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:25PM (#17418263)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jacobsenscott on Thursday June 28, 2018 @05:54PM (#17420805)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @08:01PM (#17421443)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by justwalt on Thursday June 28, 2018 @01:52AM (#17414409)
What kinds of mistakes would someone who fits this description make?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jacobsenscott on Thursday June 28, 2018 @11:34AM (#17417727)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:27PM (#17418289)
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.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by askl56 on Thursday June 28, 2018 @01:08AM (#17414222)
> 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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by lsc on Thursday June 28, 2018 @01:05AM (#17414207)
>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.)

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by cobookman on Saturday June 30, 2018 @12:22PM (#17431389)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:49PM (#17418503)
> 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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by Kiro on Thursday June 28, 2018 @01:13AM (#17414236)
You are completely wrong. The stuff you're talking about is completely irrelevant for 90% of the jobs. Step out of your bubble.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by andreareina on Thursday June 28, 2018 @03:03AM (#17414680)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by djsumdog on Thursday June 28, 2018 @12:57AM (#17414176)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by varjag on Thursday June 28, 2018 @03:44AM (#17414853)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:34PM (#17418362)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by varjag on Thursday June 28, 2018 @02:33PM (#17419334)
I'm not sure what are you trying to argue. I never ask obscure CS trivia, you misread my post entirely.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by WalterBright on Thursday June 28, 2018 @01:01AM (#17414193)
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.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jmts on Thursday June 28, 2018 @01:10AM (#17414227)
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.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by ufo on Thursday June 28, 2018 @01:32AM (#17414317)
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.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:41PM (#17418431)
Just ensure the bits are always zero on allocation, use DFS, and ensure you re-zero the bits on the way out.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by WalterBright on Thursday June 28, 2018 @11:25PM (#17422165)
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.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Friday June 29, 2018 @08:25PM (#17428840)
The entire structure doesn't have to be visited.

We are both saying this.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by WalterBright on Thursday June 28, 2018 @01:25AM (#17414284)
You have to walk the hash table again to free it.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @01:24AM (#17414281)
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!

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by sgrove on Thursday June 28, 2018 @02:25AM (#17414528)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:46PM (#17418485)
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!

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by blub on Thursday June 28, 2018 @01:46AM (#17414387)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by danieldk on Thursday June 28, 2018 @02:14AM (#17414493)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:39PM (#17418404)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by zamfi on Thursday June 28, 2018 @12:31AM (#17414082)
> 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?

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by rleigh on Thursday June 28, 2018 @04:45AM (#17415127)
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.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by AHTERIX5000 on Thursday June 28, 2018 @04:48AM (#17415142)
I get sometimes scrambled image and sometimes normal desktop before login, it could be rendering something from uninitialized buffer.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stcredzero on Thursday June 28, 2018 @12:43AM (#17414135)
I also get the scrambled image as well. I am on the latest, last I checked. I generally keep updated.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by WalterBright on Thursday June 28, 2018 @12:58AM (#17414184)
> recent Comp Sci graduates

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

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by gaius on Thursday June 28, 2018 @01:38AM (#17414345)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mulmen on Thursday June 28, 2018 @02:15AM (#17414497)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by gaius on Thursday June 28, 2018 @03:02AM (#17414672)
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
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jimmaswell on Thursday June 28, 2018 @02:47AM (#17414603)
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

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by gaius on Thursday June 28, 2018 @02:59AM (#17414662)
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?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jimmaswell on Thursday June 28, 2018 @01:17PM (#17418760)
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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jorts on Thursday June 28, 2018 @12:39AM (#17414109)
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.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by foepys on Thursday June 28, 2018 @12:19AM (#17414029)
> 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.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Thursday June 28, 2018 @12:50AM (#17414153)
> 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?

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by OP9000 on Thursday June 28, 2018 @12:51AM (#17414158)
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.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by travbrack on Thursday June 28, 2018 @02:32AM (#17414552)
I have to disconnect and reconnect my thunderbolt display exactly 2x to get the webcam on it to work.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jimmaswell on Thursday June 28, 2018 @02:36AM (#17414565)
They couldn't even come up with the answer of keeping a hashtable of the pointers to check for duplicates?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by jkells on Wednesday June 27, 2018 @11:42PM (#17413909)
Interested to know why the gender of the manager matters?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by che_shirecat on Thursday June 28, 2018 @03:21AM (#17414751)
Most charitable explanation is that OP is just adding some color to their characterizations. Least charitable explanation is that subconciously or not OP perceives young "females" in positions of authority as being unfit for their positions and likes to add plausibly deniable fuel to that flame.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by zmix on Wednesday June 27, 2018 @11:49PM (#17413934)
If one is angry, it does!
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by Techonomicon on Thursday June 28, 2018 @12:32AM (#17414086)
Duuuuuude my work macbook freezes at least 3 times a week when connecting up, I thought this was just my issue, I feel like we're part of a brotherhood now.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by stefanfisk on Thursday June 28, 2018 @01:24AM (#17414283)
mine does it if I connect my monitors before opening the lid, try everything until you develop your own superstitios routine!
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by sandmansandine on Wednesday June 27, 2018 @11:37PM (#17413882)
Serious question: Why didn't you mention the genders of the the people from "the "good old days"" but had to say over and over again that you were dealing with "Middle manager woman"
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Wednesday June 27, 2018 @11:52PM (#17413942)
I'm confused what the point of this question is. Would you have found it more satisfying if the parent had said "I had a couple of [male] contacts from the good ol' days"?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by monktastic1 on Thursday June 28, 2018 @12:04AM (#17413978)
Why mention gender at all? Does anyone call out a "young male manager" in such a story?

Not saying OP did this, but one can imagine using adjectives to hint at competence or lack thereof here.

FWIW I have no dog in this race. Parent comment just got me thinking.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by ehnto on Thursday June 28, 2018 @12:11AM (#17413998)
People do it when subconsciously or consciously trying to paint a picture with stereotypes. So if someone wanted to illustrate they were talking about a testosterone filled ego driven 20 something, they might include the term young male manager in their descriptor.

Is it right or wrong? Probably not great. I don't do it. But I get how it happens. Probably not nefarious, just a little tonedeaf.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by monktastic1 on Thursday June 28, 2018 @12:22AM (#17414041)
True -- though when I think about it, I imagine them using a more specific male adjective like "bro" or "dude." "Young male manager" would have triggered a "why are they mentioning male?" and yet "female" slipped under my radar until another comment called it out.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by ehnto on Thursday June 28, 2018 @12:52AM (#17414163)
I wonder if that's because you have a stronger stereotype for male than for female in your mind (not to suggest that you use it, just that you have one or are aware of what others might have as their stereotype). I don't have strong generalizations either way but especially not for the term female, which is why I never understood when people got uppety about it to begin with. Now that I understand some people have a negative stereotype attached to their usage of the word I understand why people get annoyed. But it is a bummer as its all so personal and subjective that no matter how careful or sincere you are you could tread on someones toes and convey the wrong message, as I suspect the parent comment has done.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by ralusek on Thursday June 28, 2018 @12:41AM (#17414121)
Does it count as slipping under the radar if you've both called it out?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Thursday June 28, 2018 @12:31AM (#17414078)
> Why mention gender at all?

I don't know, but if that's the intended question then it'd make sense to ask that (which someone else already did, so I recommend upvoting if you're interested).

The question whose point I don't get is the one I responded to. It seems absurd to ask "why did you do X but not Y?" when doing Y would've only left you more dissatisfied.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by monktastic1 on Thursday June 28, 2018 @10:52AM (#17417303)
Ah. I interpreted it as "perhaps you prefer to identify genders in general, but that's belied by not using it here."
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by not_kurt_godel on Thursday June 28, 2018 @12:00AM (#17413969)
The subtext, whether it's intentional or not, seems to be that the gender of manager that he (yes, assuming OP's gender) spoke to is relevant to the negativity of the experience. The message can be condensed down to "female + new Apple = bad, male + old Apple = good"
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Thursday June 28, 2018 @12:40AM (#17414116)
What I'm baffled about is why the comparison was made against the contact's gender. How would involving the contact's gender have helped? Or if that's not the question that was intended, then why not ask the actual question that was intended?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by paulcole on Thursday June 28, 2018 @01:04AM (#17414204)
How does involving the manager’s gender help?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Thursday June 28, 2018 @01:06AM (#17414215)
I don't know, I never claimed it does.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by paulcole on Thursday June 28, 2018 @01:23AM (#17414279)
So you’re not baffled by the use of “woman manager”?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Thursday June 28, 2018 @01:35AM (#17414331)
In fact that question did pop up in my mind too, and hence I did upvote the other commenter's question asking about that.

But I find it curious that why you're pressing on interrogating me like this. Why the inquisition?

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by rmrfrmrf on Thursday June 28, 2018 @12:29AM (#17414075)
Quite the opposite, I would think. Removing the gender references doesn't detract from the argument, so why have them at all?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Thursday June 28, 2018 @12:35AM (#17414096)
I don't know, but what I'm asking is: if your real question is "why mention X's gender?" then why instead ask "why mention X's gender but not mention Y's gender?"?
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by saghm on Thursday June 28, 2018 @12:47AM (#17414146)
I think the point is to make the difference more stark; merely saying "why include the manager's gender" doesn't show the inconsistency between calling out the gender in the case of the employer the writer is unhappy with but withholding it in the case of the employee the writer is happy with.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Thursday June 28, 2018 @12:55AM (#17414172)
> I think the point is to make the difference more stark; merely saying "why include the manager's gender" doesn't show the inconsistency

But that's the thing -- is the GP's problem really the difference/inconsistency? Is that really what they're trying to highlight? If it is, then I agree, but that's what I was trying to clarify, because it seems more likely to me that making it more "consistent" could've left them unhappier.

Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by saghm on Thursday June 28, 2018 @01:55AM (#17414415)
I might not have been clear; GP's (GGGP's?) question was rhetorical; their point was to make a point, not to actually suggest a course of action that they preferred.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by monktastic1 on Thursday June 28, 2018 @10:57AM (#17417354)
To put it another way: suppose I ask someone "why did you forget my birthday but not his?" It's not that I want them to forget his, too (though that is one literal interpretation). It's to suggest that the answer isn't merely "I forget birthdays in general."
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by mehrdadn on Thursday June 28, 2018 @11:23AM (#17417619)
That would be weird in this situation since "I mention every gender in general" would be quite a bizarre response (and behavior)... and arguably even more fuel for subsequently accuse the speaker of sexism if that's the intention.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by Firerouge on Thursday June 28, 2018 @12:03AM (#17413977)
Your comment seems to be against multiple HN guidelines, particularly those regarding assuming good faith, not post shallow and dismissive comments, and the rule regarding ideological wars.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by paulcole on Thursday June 28, 2018 @01:06AM (#17414214)
Sexism is one of the biggest tech issues of the past several years. I don’t think asking someone to consider why they used a specific word– even in “good faith” is a problem.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by daseiner1 on Thursday June 28, 2018 @01:35AM (#17414330)
Gimme a break. Their comment is clearly not shallow, nor dismissive and is raising a legitimate, albeit fairly mundane, point in my opinion. And I’m sure we can all try to hold ourselves to a high enough standard to not initiate an “ideological debate war” over that sort of comment.
Re:Apple Engineers Its Own Downfall with the Macbook Pro Key... by gowld on Thursday June 28, 2018 @01:13AM (#17414234)
Because it's important for young women to see representation and role models in tech.

The real weirdness is why OP thought that the front line customer service drone was a "middle manager".