Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems

404 points by cs0 ↗ HN
Hi HN.

My fianceè is currently enrolled on CS50 Introduction to Computer Science online.

I'm a programmer and have been for around 5-6 years, I started with VB.NET since I first started learning, then progressed onto Web Development at a large agency for 4 years (PHP, JS, React) and I'm now back with VB.NET.

I've worked with a few "complicated" (they were to me) projects in the past, but now I'm being tasked with guiding my fianceè with this course.

Some of the problems which she is expected to solve are pretty simple problems, but I just can't seem to get the hang of any of them on my own.

I would have thought that my last 5-6 years of experience would at least help me here. I can point out basic syntax errors and help with debugging, but when it comes to me trying to solve these problems on my own, I don't know where to start.

It makes me question how I was hired in the first place.

Sorry for the rant, but I was just wondering if anyone else felt like this.

308 comments

[ 2.6 ms ] story [ 286 ms ] thread
No
OP didn't ask a specific yes/no question.

This isn't reddit. Low effort comments are looked down upon.

This isn't too surprising. There's a lot of CS stuff that is rarely used in practical programming so you can get pretty far without knowing it.
sure, for the first 20 years that I was a programmer, I really couldn't wrap my head around algorithms at all. It took concerted effort (I'm a slow learner) and repeatedly reading books, talking to people, writing code and having it reviewed before I felt comfortable with hash tables, etc.
I spent 10 years doing web development that eventually lead into a few years of systems and network programming before I went to college for a CS degree. Many CS problems were still challenging even with all of that experience.
i think a lot of the problems you are expected to solve in a CS course are things that are already provided or have workable alternatives in higher level languages. VB and javascript already provide for many different data structures where you might need to know them and be aware of them in the lower-level languages

Also due to the data structures provided in higher level languages you are often less aware of how long something will take to run which i find is a big part of many CS courses

Programming has become so generic activity that the word "programmer" tells very little of what people are doing and what their skills are.

From the description of what you have done, you are working in "software assembly" type programming job. You clue things together and get the job done. You know the API's and some standards. Most of the programmer jobs are what you are doing. It's very different from the classical algorithmic programming type jobs and programming.

People who build machines have wide variety of job descriptions: mechanic, welder, machinist, mechanical engineer, and so on. But somehow it's assumed that if you can do "web development", you can do do it all.

There's a common belief that you can learn everything you need to program through practice. And that is true in the sense that you can eventually learn how to write working programs. But understanding the theory behind programming and algorithm design is a very different thing.

As a concrete example, while in high school I participated in programming competitions. One of the questions required writing a parser for a context-free grammar. Being completely unaware of recursive descent parsers I managed to fudge together an awful program with probably disgusting algorithmic complexity. After taking an "intro to CS" course (as an extra curricular activity), I immediately knew how to write basic parsers for CFGs correctly. It's not that I was suddenly much better at programming, it's that I now had learnt some theory that helped me know how to approach a problem.

You can't really "pick up" algorithms. You have to learn it through some kind of study (self-study is also acceptable). There are thousands of man-years that have been spent on algorithms. It's probably not a good idea to start out from scratch. In this respect, I would argue that programming is far closer to mathematics than engineering.

Hah, you must be the one who wrote the system I’m now rewriting.. :) just kidding. I went through the same thing- I thought I was a pretty coder too till they hit me with the towers of Hanoi problem in college. When I saw how simple the solution was to that problem, the scales fell from my eyes!
Think of it this way: application development, software engineering, and computer science (and data science and ... etc) sometimes use the same tools but are all different disciplines.

Universities traditionally focused on Computer Science and their graduates would often need a lot of grooming before they could really be independently and reliably productive in the commercial words of application development or software engineering. Importantly, it was less grooming than someone who studied something like English or Sociology or History, but it was still a different discipline than what the job market demanded.

You jumped into the job market directly. You learned to develop applications, research API's, study trends, and participate as a team member in development workflows under commercial pressure. You don't know how to compose and compare sort functions for abstract sets of N elements because you never needed to. You just use sort().

And that's okay! Inventing new algorithms with theoretical significance is not your job! You have other skills and they're of much more immediate value!

seconding this, creating value is orthogonal to knowing CS. see the creator of homebrew, Max Howell infamously failing to invert a binary tree in an interview: https://mobile.twitter.com/mxcl/status/608682016205344768?la...
I have yet to see a definition of what “invert a binary tree” even means.
I think "mirror" is a more intuitive description of the problem, but essentially you reverse all of the left and right subtrees. This Quora question [1] has a few different approaches listed.

[1]: https://www.quora.com/What-is-the-algorithmic-approach-to-in...

That doesn't sound like "inverting". If that is what it means then it is indeed a bad name.

I always thought it means making one of the leaf nodes a root of the tree. Physically, it would look like taking one of the leaf nodes with your fingers and "hanging" the tree off of it.

Inverting means inverting the sort order. The easy answer is to encapsulate the tree in a new structure and add a Boolean flag called “inverted,” since you’re just reinterpreting the meaning of left and right children.

What you describe is called “rotation,” and is used to rebalance.

invert: to reverse in position, order, or relationship
I'm confused. Doesn't the operation described in those answers just rename each node's properties, but leave the topology of the data structure unchanged?

Meaning one could just have the code accessing the tree swap which names it accesses, and the tree would behave as "inverted" with no actual need to invert anything?

It's when you swap the left and right branches of every node, e.g.:

    def invert(node):
        if node is not None:
            left = invert(node.left)
            right = invert(node.right)
            node.left = right
            node.right = left
        return node
Or simply

    node.left, node.right = map(invert, (node.right, node.left))
Coalescing those four lines onto one is fine, but writing:

    map(invert, (node.right, node.left))
is definitely not simpler than:

    invert(node.right), invert(node.left)
Indeed - I just wanted to write it in a form that could easily be mapped to languages which don't support multiple simultaneous assignments :)
(comment deleted)
I read it, tried it out and it didn't took me long to understand and solve that issue.

If you hack around for a long time and you never ever felt the need or motivation to understand very simple tree algorithms, okay. But don't rant when a company like google expects that from you.

He also answered, after a few years on a website about it:

https://www.quora.com/Whats-the-logic-behind-Google-rejectin...

(comment deleted)
What's the difference between application development and software engineering?
You can apply software engineering to develop an application, but you can also do application development without any proper software engineering.

Software Engineering is a design discipline, management discipline, and engineering discipline. Application development is (principally) the act of building an application by writing code. It doesn't require design, management, or engineering discipline to accomplish. But it's better if you've done those things (minimally, the engineering and design portions).

At the same time, a junior software engineer may not be responsible for anything but the writing of code, where others have determined the design and engineering aspects and are conducting project management for them. Or with only limited responsibility (such as developing tests for the aspects they're responsible for developing, which is a part of the engineering discipline: V&V).

In practice, the main difference is the pay / relative "rank" within a company. Employer's perspective: Want to hire a software engineer but don't have the budget? Create a new role, call it something else, now the pay difference is justified.

Context - I'm a software engineer by title but my job is application development. Which is hard, mind you! It looks like simple coding but it involves prioritizing, making smart decisions, and making all stakeholders happy.

Nothing. It sounds like this person is inventing their own dichotomies.
I've worked in both of those environments, where my titles were literally "application developer" and "software engineer". In the former, we did a lot of things without process and worked on a wide variety of applications and in the latter I worked in an Agile environment focusing on a core product.
As with most HR departments, it could be a classification required for salary, which also highly depends on work experience and not necessarily school background.

- Someone who's job title is much fancier than otherwise necessary

>And that's okay! Inventing new algorithms with theoretical significance is not your job! You have other skills and they're of much more immediate value!

Except when it comes to getting a job. Forget any of the rest of your skills, because we all know the only thing that matters when interviewing is an ability to recite CS algorithms out of memory and solve obtuse puzzles while pretending you've never seen them.

As a self-taught programmer who doesn't have a CS degree, my experience has been that this is not a significant hurdle to any workplace that I would seriously consider applying.
Where do you find jobs to apply to? I am also a self-taught programmer without a CS degree, and it seems that a surprisingly large portion of companies use obtuse algo/whiteboarding interview questions. My objection is less that I don’t know or can’t learn them and more that it seems like a waste of time to prep for stuff that isn’t useful.
Those companies aren't hiring, they are just sifting market for rock starts. I have seen this in numerous places already — when a company has enough product leaders, but still enough money/time to hire a couple more, they begin whiteboarding people. Several years later those product owners will leave, and suddenly the interviews are reduced to "you worked with <insert technology name>? Know what <insert technical term> is? Accepte^W erm, I mean we will contact you tomorrow!"

Several weeks after passing the interview you start asking colleagues about their own interviews. And everyone has wastly different experience. Some were hired after being harrassed for hours. Others got job thanks to friendly tip...

this is false, you can’t blanket companies like this. the job i’m currently at required me to find all palindromes in a set of strings. the company makes media management software.
As a self-taught programmer who doesn't have a CS degree, my experience is substantially different. There are many places where I would seriously consider applying (FAANG) that this would be a significant hurdle.

I've taken to competitive programming as a way to prepare myself, but I'm a long way away from being at a level where I'm comfortable applying to the companies I'd like to work for.

I think a lot of people like you and I pretend to make the choice of, "I'd never work there" when the reality is, "They'd never hire me", and it does everyone a disservice to continue to perpetuate that lie. It's not a problem or a negative thing that FAANG would never hire me/you, it's just the truth.

FAANG would never consider hiring you or me as-is, but if we worked really hard for awhile, they would. This has nothing to do with our ability to do the job they'd hire us for, but that's the game, they want their candidates to be good at the game, and I'm at least willing to play. You aren't willing to play, and that's fine, but don't pretend like you're being the discerning one here.

As a person without the degree that works at one of these companies, I can honestly say that it's incredibly difficult to get in. What I haven't seen anyone talk about is how it haunts you constantly. Not necessarily coming from other people, but knowing that if someone wanted to call you incompetent, it'd be on you to prove otherwise since you dont have the degree to back up your knowledge. I wish I could go back and get a CS degree just to tame the thought that it could all fall apart so easily.
(comment deleted)
Exactly, you took the words right out of my mouth. I'm 6 years in as a web dev and still feel the downsides of not having that paper. There is that constant, need to prove feeling that lingers in my mind. I'd love to work for a big company but I am stuck in my country. Visa approval requires that paper to prove you're skilled. Stuck with opportunities that pay really less, compared to Europe/USA. Don't know about you but, I recently decided to bite the bullet and join a CS degree on the side. Going to be tough 3 years, but it'll be worth having that paper once in for all.
> Visa approval requires that paper to prove you're skilled.

There are ways to go around that - in some countries, US among them, you can count some years of specialized work experience in the field in lieu of formal education ("degree equivalence" - I believe). I got a work visa in Canada on that basis, and later L1, H1B, and finally a green card in US, without any degree.

With respect to US specifically, google for "USCIS three-for-one" for more on this.

Yea, but was it a relatively easy process? I've heard of USCIS too, but the process looks complicated.
I don't really know - in my case, it was all handled by my employer and their lawyers; all I did was gather the documents they told me they'd need (basically whatever is necessary to prove said work experience).
I am self-taught and work at Apple and the interview process is team by team. My team doesn't care whether or not someone has a CS degree and we don't ask algorithms questions. We care a lot about software engineering as a craft, though, and ask architecture questions.

Of FAANG, I only know of Google having a standard interview for all software engineers across the company (and one that is algorithms-heavy).

Plug: If you do iOS engineering, we are hiring: https://twitter.com/conradev/status/1035244142488506368

I have to point out something that I haven't seen anybody say here -- there is a huge amount of variety in the difficulty of these sorts of interviews.

I assume that all FAANG interviews for entry-level software devs are akin to the standard Google interview, for which you are expected to study your ass off. I have not interviewed for one of those companies, but of course I know how much people study for them, and it disgusts me. However, I have had plenty of interviews which did have an algorithm-type section (the majority of interviews I've had have had something like that), and I no longer hate on companies for doing _that_. Plenty of the problems are relatively easy, once you figure out how to talk about them -- and being able to talk through your work is a legitimately valuable skill.

But, companies that expect applicants to put in the kind of work Google expects in order to stand a chance truly are not companies I want to work for. To some extent, it's just shitty; this "game" is mostly a test of how much time you have to spend. That cost is a lot higher for people who are less well off, which irks me, but that's true of most things in life.

The thing is, you talk about being "willing to play" the game. I don't want to work in a company of people who played that game.

First -- Playing the game means sacrificing important things; you can't spend all your free time studying which data structures to use for esoteric string manipulation problems, etc. AND spend all your free time learning the fine point weaknesses of different databases, good programming patterns, etc. By the time I started interviewing for my second job, I'd nearly burned myself out making certain I was learning how to do things right, learning how to be a good programmer. My free time was spent polishing the things I was working on and endlessly reading about how to do it even better. And then I was able to go into interviews for the jobs I was interested in and do what you're suppose to be able to do in most other interviews (programming or otherwise); actually talk about the company, their pain points, possible solutions they hadn't thought of but I had experience with, etc. At that time, I could not identify anything but the simplest algorithmic complexities... but to learn more than that would have been to choose studying useless information over useful information.

Second -- What makes a person willing to play the game, when there are plenty of other companies with interesting problems to solve and good salaries (maybe not AS good)? I can't help but feel there is a cult-like love of these big companies (or maybe it's the desire to prove oneself, since only RealProgrammers work for Amazon). And I don't want to work with a bunch of people who are extra excited about something I just don't value.

Maybe I haven't been reading the right stuff, but I just don't see the appeal. I don't particularly care for any of them as companies. Sure, if Amazon decided to pursue a pilot project aimed at providing its customers with low-carbon-footprint foods, I might want on board that project -- but not just to Amazon as a whole. Yes, these companies are large and well-known, but I don't particularly care if it's one million or one billion people who download an app I worked on. I know that getting a job in one of those companies doesn't mean you're going to do something interesting or big. I've had classmates get jobs at Google and I've worked with Google employees on certain projects, giving feedback etc. There's nothing I've seen about their jobs or projects that were particularly amazing or wonderful, except for the part where you then get to say you work(ed) for Google.

To play devil's advocate, "which data structures to use for esoteric string manipulation problems, etc" is the kind of thing that interests me (and presumably some others) a lot. If I wanted to go for a FAANG interview I'd love to brush up on the algorithms and data structures stuff that fascinated me in college and I haven't had much cause to think about since. There are certainly other things I'd rather be doing, but it wouldn't at all be a miserable chore like you're describing. So maybe they're looking for people who think about these problems more like I do (and I'm not by any means saying I'd pass the Google interview) and less like you do. They have the pick of the litter after all.

On the other hand, there's the well-known story of the Harvard MBA answering Orkut support tickets so Google probably doesn't need that level of talent. But if they can get it, why not?

I am self-taught, no degree whatsoever. I didn't have a problem landing a job at Microsoft regardless, with a few years of mostly C++ experience under my belt. Wouldn't even say it was hard. And no-one at work had asked me if I have a degree, ever since that first interview.

Now, that's not FAANG, technically speaking (although FAANG was always about stocks, not job culture). But for what it's worth, I've had recruiters from Google, Facebook and Amazon try to lure me over. None of them indicated that my lack of degree is an issue for them.

Maybe that's team-specific, I don't know. But it's certainly not true that they'd never hire someone without a degree.

I think people are over-emphasising the importance of a degree when it comes to CS (obviously some workplaces filter by "do you have a degree" but I wouldn't want to work in such a place -- clearly they don't care about you as an engineer).

Sorry to be a bit old-fashioned, but a degree isn't the most important part of going to university -- it's the education you get. I would argue that it is very difficult for someone to learn about data structures and algorithmic complexity (+ algorithm design) without taking a university course or doing some pretty intense self-study. It's not something you can pick up on the job. And this is knowledge that I think more folks in our industry should have.

So you might be doing totally fine without a degree, and that's great, but I imagine that you also have some CS knowledge that OP doesn't have -- and maybe you picked it up from somewhere or did some study on your own to gain it. If I was a hiring manager I wouldn't filter on degree, I would filter on some sort of working knowledge of CS (and, for reference, inverting binary trees on a whiteboard is not an example of "working knowledge").

Oh, absolutely. When I say "self-learned", that includes bits and pieces of CS. E.g. I wrote a BASIC-to-C++ transpiler back when I was 14; and to do that, I had to learn things like recursive-descent parsing, for example, or how hashtables work (because I wanted my dialect of BASIC to have them) etc. None of it was from CS courses or books - just looking stuff up on the Internet as needed, often reading others' code. This kind of learning from experience is not a well-organized process, and the results were often a lot messier than they really needed to be - and would likely be with more formal education like SICP! - but it works.
I need to tap your brains. Contact please
Hey, just wanted to say I think you have a very fair perspective here, and I'm not sure why you got downvoted (perhaps your comment was perceived as rude.)

I'm actually not interested in working at FAANG. I don't want to live in California, I don't want the long hours, I don't want the stress, and the products and culture are not very interesting to me. The salary is pretty much the only selling point IMO.

However, you make a fair point: If I _did_ want to get into one of those companies, I would need to study CS (academically or non-academically).

I think you may be selling yourself a little short.

Many, though perhaps not all, FAANG interviews do not involve needing to know THAT much CS trivia. The common topics (for many interviews, it depends on the company, and at non-homogenized companies, on the team) are:

- What’s a graph? What are some interesting strategies for walking a graph? Any gotchas to look out for?

- What is algorithmic complexity? How do you measure it? Why does it matter?

- Are you conversant with middle-school level arithmetic and geometry?

- Can you describe the strengths and weaknesses of the 4-5 most common simple data structures?

- Can you listen to problems as they’re described, and ask good clarifying questions (the most common problem is here, people didn’t bother to take the time to ask clarifying questions)?

- Once you’ve nailed down the problem, can you structure a few nested for-loops with relevant tests and perhaps a few simple auxiliary data structures?

- Once you have a potential solution, do you test your work? Do you skip over your mistakes pretending they don’t exist? Do you take hints when your mistakes are pointed out to you?

- Do you admit when you don’t know, then try exploring anyway?

Seriously, this is the entirety of what I see most FAANG interviews covering. If you’re a competent self taught programmer, you need to study a tiny bit about data structures and algorithms, stay calm, ask lots of questions, and just execute.

I get that there are lots of horror stories out there, and I genuinely feel for people who get super anxious when asked to work with an audience.

But if anxiety isn’t your problem, I encourage people to try different teams/companies if they’ve mastered what I’ve listed. FAANG really don’t want to put the bar absurdly high, they want a relatively easy level of CS knowledge.

Except when it comes to getting a job. Forget any of the rest of your skills, because we all know the only thing that matters when interviewing is an ability to recite CS algorithms out of memory and solve obtuse puzzles while pretending you've never seen them.

I’ve been a professional developer for 20 years and have never had to recite CS algorithms or solve obtuse problems.

My last three jobs I had to whiteboard an architectural diagram of a system, come up with a 90 day plan to create a software development team (I didn’t know I was applying for a lead position), and describe how I would introduce Devops, redundancy, traceability, etc into a system

The closest I came to a CS style interview was my second job out of college when I had to explain high level different data structures. That was actually important since we were writing cross platform, C that had to be highly optimized.

I’ve gone on lots of interviews with only two rejections - the rest I took my name out of the running once I got the job.

I came up as a traditional computer geek - learned how to program in Basic and assembly on an Apple //e in middle school, fell in love with C, spent way too much time on comp.lang.* groups etc.

One of my best friends who I worked with across three jobs graduated from one of those infamous for profit schools, for years wouldn’t know an algorithm if it hit him in the face, but spent a lot of time on side projects, reading best practices from books, etc. and is one of the best architects I know.

I am guessing you don’t work in the Bay Area.
Nowhere near it - and neither do most other developers in the US.
Wasn’t trying to imply that’s the case. I’d love to move out of the Bay Area, just to get away from the whole “leetcode or GTFO” interview style, but the fact that there are so many opportunities around here keeps me here for the moment. Well, that and I can actually make enough money to pay my student loans while living somewhat comfortably and saving a little money. If I knew anyplace that had decent weather where I could do those things, I’d be looking at the next flight out.
Give SoCal a shot. You can get very competitive salaries when compared with NorCal right down here, and the cost of living is not quite as bad.

I'm hiring Ruby devs down in Costa Mesa, and I don't ask any algorithm questions :)

You should email me. It's in my profile. I have... questions. :)
https://en.wikipedia.org/wiki/Plano,_Texas#Economy

That is just Plano. There are arguably more opportunities around each of North Dallas and Addison. The cost of living here is a third of the bay area and that isn't including the size of house. This is why California is bleeding 60k people a year to north Texas.

Yep, quite the burgeoning tech scene in Phoenix as well. Compared to California it's quite affordable if one can put up with four months of pretty extreme heat per year.
Houston, Austin, and San Antonio have quite a few jobs and decent cost of living, too.
This is something I'm struggling with right now. It seems like there are endless opportunities but are they really opportunities if you can't get past the "leetcode or GTFO" barrier? And even if you do get past it that only gets you in for a full day of being grilled on other arbitrary measures with zero feedback as to why you didn't get the offer. I feel like spending time trying to be able to solve these coding "challenges" only detracts from time I could be spending learning more useful ways to code or actually, you know, building applications.
Good for you, but your interview experiences would be atypical these days
Right. Having my own companies and hiring people over the last 20 years has jaded me. lol
you most definitely seem to be. i’ve both had and seen interviews requiring solving by hand various encryption algs using only a whiteboard. maybe you don’t require it but there are plenty of places that do
I've had two successful exits since the early 2000's, most recently one that of a company that I built, wrote the product for and sold to a company in 2014 (all modern web based stacks, technologies etc). The last one, I ran engineering which had 25 developers and we shipped a brand new product to market and I helped sell that company (the company that bought me out) to a larger company. All the while, still writing code, building product, etc.

I had a three year earn out, finished that and decided to get back into the workforce and get a job at a senior or above level (thinking Director, Manager, etc). Guess what, not only did my age hinder me (I'm 53), but my lack of CS math background seemed too in an interview process. Various interviews had me solving what I consider not only impractical, but almost silly puzzles / math problems that not only didn't apply to the company I was interviewing with, but didn't apply to anything real-world -- it felt like it was a way to:

- Weed me out because of my age - Make the company seem like their vetting process was "Google like" and "trendy" - Make the interviewer feel entitled or the company be "elite" in their process

Part of me realizes that some of this is to see how well someone problem solves. I get that. However, I had one interviewee actually bungle up the questions, in fact, I had to point out at one point that it appeared that they described the problem wrong. When I got my answer wrong, and then asked for the answer, the interviewee clearly realized he setup the whole problem incorrectly.

Oddly enough, this is the part that bothers me the most. I've been asked many times for my GitHub. I have lots of solid examples to see my work. I've also been asked to do a programming challenge, which almost always I nail 100%. But it's always these "trap" CS challenges that I feel are used to eliminate someone based on either HOW they solve it or a way to justify them out and not hire them based on other factors (age, fit, etc.)

I actually had one that was a whiteboard session where the CTO asked me to solve the problem on the board "using code of your choice", so I stated, "Look, since I know multiple languages, I'll use pseudo code to walk through the problem and explain the answer"

When he described what he wanted me to solve (badly I might add), I wrote the pseudo-code on the board and described the problem as being solved by using regression. Which was 100% the right answer but because I chose to use pseudo-code not say, Python or JavaScript -- he told the recruiter, "he couldn't solve the problem I was looking for him to solve." When pressed by the recruiter about the solution, he gave a link to the problem in his Github, which of course was verbatim of what I described but in Python -- using regression.

What I've learned from this is that I should contract and consult. Most of these smaller companies want what they want in the way of an employee and are seeking the 10X developer, culture fit and someone in their own age group...

Brilliant comment. Shouldn’t you be building startups yourself instead of trying to fit into these teams? I think your skill set speaks for itself.

Recently I joked with the interviewers over Skype screen sharing that I probably wouldn’t be fast enough to get a pair programming exercise done with 3 of them watching me. And that often these things you either see right away or struggle with. They all laughed and agreed.

I wanted to test a particular function after setting everything up, installing jest etc. But was told not to because deconstructing xpath was an implementation detail. No one could see what was wrong with my working and all three of them said it’s the way of working and not if you happen to get the answer on the day.

Of course they failed me saying I was too weak at programming. I won’t be doing coding over Skype screen sharing again and with more than one person in the room, it’s just too stressful and random.

I've done many startups and I have to say I love it, but the struggle to fund it properly (to it right) is what turns me off. I'd rather bootstrap myself (these days) and go the "indie hacker" route and not have to deal with fundraising -- build a product myself, sell it and roll it all on my own. That wasn't possible 20 years ago, it is now.

So yeah, I've focused on the executive level, CTO, VP, etc, But with that, you have to either give up coding and just manage or go to a tiny company to be the "key player", but then you're typically at a smallish company with little to no funding. I've been doing that lately, I'm at a small start up running engineering, but I'm an "employee", not a founder.

There seems to be a clear bias with VC companies against someone my age and background. Not to say I don't have a network I could probably work and get funding, I could. But I also wanted to get back to square one and work with people again and NOT have to deal with things like Healthcare, stock options and "hey, that person needs a week off because their cats sick." -- I'd rather just CODE and learn more, enjoy the art of buildings things without the pressure of an investor looming over you.

I've made enough money to be comfortable, but I still need to earn a living -- I haven't made that "FU" money and my wife laughs and jokes that for as much success we've had, even if I did get the "FU" money, I'd still want to work 70 hours a week and write code... ;-)

About your Skype coding comment. Yeah, new trend is to "pair" with someone online in an interview process and go through programming challenges. I'm OK with that, but I don't work well that way. I work better in a situation where I can think and spend the time myself on the problem. My brain isn't wired for "fast and rapid", it's more of a "trial and error" until I get it working, then later on optimize and make it better. I do terrible at that first pass, always been more of an interactive developer who starts with something that works and then over time perfects it. That style SUCKS on a pair programming exercise.

As has been said here many times, these puzzles test for corporate compliance, not for problem-solving ability. You're being assessed on your willingness to spend x months studying to a certain industry-wide norm, and to then pliantly follow interview instructions to reproduce one of the stock answers on demand in the format requested.

If you deviate from the rather arbitrary requirements you will be considered a no-hire.

Other industries have a formal study, exam, and professional certification process. Developers don't. [1]

In the absence of that, these interview play-throughs are treated as an ad hoc substitute. They're a passable fit for generic ass-in-chair juniors, but a very poor fit for anyone looking for good seniors or a CTO.

[1] In the UK you can become a Chartered Engineer via the British Computer Society. I don't think there's anything equivalent in the US, and I'm not sure how many shops in SV even recognise Chartered Engineer as a professional qualification.

Since we're sharing anecdata, I'm a professional developer and still use recursion, building/traversing various types of tree data structures, and a few other CS degree requirements.

That said, for algorithms (e.g. sorts, etc), understanding what the options are and trade-offs is certainly more useful than knowing how to implement them, since there's a good chance someone has implemented it already in your language of choice.

What percentage of developers do you think are solving “hard problems” compared to ones that are just doing CRUD apps or yet another SAAS app?
I would risk to say 95-5% Mostly researchers are creating those solutions for hard problems, and, in the industry, only a few have to bash them. The rest of us are concerned with keeping APIs responsive and getting that damn button the correct shade of blue.
No idea, but based on other comments here it seems that a significant number of HN users who commented here are in the CRUD apps and/or yet another SAAS app category.
"Hard problems" are risky business ventures. In my career, we've done a couple of things that would be considered "hard", but in each case we've leaned heavily on papers published in academia. The best example might be when the team I was on did shape recognition from hand drawn shapes to shape objects in a drawing application. I've occasionally been asked to solve some hairy caching/concurrency problems, but again I've gone straight to the literature.

My brother worked in a company that was doing circuit board design (simulating crosstalk, etc). Their work was highly theoretical, but they had electrical engineers doing the research (and were actively collaborating with a university). His job was 99% implementing code.

I feel that programming is more about handling complexity than it is about solving other problems. You sometimes dip your toes into solving problems in other domains, but the biggest value you can give as a programmer is in creating a code base that is both simple and sustainable (and keeping it that way). This is the hardest problem I've ever worked on by far. It dwarfs any of the other problems I've tried to solve. I sometimes get a bit depressed that others don't consider it a "hard" (and therefore interesting) problem.

Sometimes boring CRUD apps turn into interesting CS problems due to the data model and ways that the customers expect to visualize the data, while keeping the application responsive.
In my experience, less than 5% are actually writing algorithms and solving harder problems. I work at a consulting firm with 100 or so developers, and most seem to do "simple" stuff most of the time.

The most complex thing I have heard of is someone who wrote a kalman filter thing for some part of a nuclear reactor. To me it seemed hard since I don't understand the math, and apparently people around him was happy with his solution.

Also here in Sweden I don't think the CS algorithms are very important at all when getting a job. I have just not seen it that much, which is sane since nobody seems to really need it anyway...

I googled kalman filter https://www.bzarg.com/p/how-a-kalman-filter-works-in-picture...

Looks interesting!

And obviously the standard CS books tell you little about numerical and stability issues you get to solve to have an actually really working and accurate Kalman filters.

It might be touched upon in doctoral or post-doc courses...

Whereas electrical engineer gets drilled about noise, stability and uncertainty all the time. Rarely even about mathematical chaos and chaotic systems.

The big secret is that everything is a CRUD app. It doesn't mean that the C, R, or U steps can't involve hard problems.

I had to implement a quadtree from the ground up, because existing solutions didn't work, when working as an SAP consultant on some dashboarding tool (I also had to know what a quadtree was!)

I now work in a generic unsexy role doing release engineering. About half my job is generic software engineering, but the other half is comparatively academic. I was reading academic papers on Aho-Corasick derivatives last week and writing statistical tests in jupyter notebooks this week.

And my interview questions are generally inspired by problems I've had in my work, just normally somewhat simplified since the way I phrase them justifies the need for a specific class of solution much more clearly than whatever nonsense I encountered in the first place.

Literally just pushed this up yesterday https://github.com/pmarreck/mega_xml This is the first time I've been able to convert one tree data structure encoded as a binary string into another form native to the language at hand, in a functional language. One of the hardest things I've ever done as a developer lately, having no CS degree (I did take some electives, though) and just learning-by-doing.
well your experience is highly atypical.
> I’ve been a professional developer for 20 years and have never had to recite CS algorithms or solve obtuse problems.

I'll see your twenty and raise to 38 on the same basis. In fact no one I know has ever had to solve the algorithm problems that seem so common now (in the US at least). The nearest I came to it was in a previous career as an electronics engineer where the interviewer gave me the circuit for a simple common emitter amplifier and asked me to describe it's characteristics. He was very apologetic afterwards and said that experience had taught him that recently qualified electronics graduates often had so little practical experience that he could not afford to employ them as it took them too long to get up to speed; so he used this simple test, and it was very simple, to sort out those who could be gently shown the door immediately to avoid wasting his and their time.

If it helps any, I’ve been one for 10, and I hadn’t seen any problem like it until I started applying to startups.

The crap I was asked was pretty insane to be honest.

> Forget any of the rest of your skills, because we all know the only thing that matters when interviewing is an ability to recite CS algorithms out of memory and solve obtuse puzzles while pretending you've never seen them

This attitude only seems to exist in companies that are seen as 'top n'. Want to stop interview in this manner? Stop applying to these companies.

Unfortunately if you want to get the paycheck that comes from these types of companies, you have to play their games. You can't complain the interview system is broken and then only apply to jobs that offer 150k total comp and have brand name recognition.

For every FAANG with a broken interview system, there are 5 other decent companies with intelligent people that don't do this crap.

I agree with you to some extent, but I do think sometimes this point of view is taken too far. Some basis in theory is useful, not so much because you'll directly apply something you learned in a CS class, but because it helps you learn how to think about difficult problems. Most real world work is indeed just putting pieces together to get the result you need, but there are occasionally things that really are difficult, especially to do efficiently. I think it could legitimately be a concern if an experienced programmer couldn't pass an introductory CS course.

To the OP, presumably your fiancé has study materials as well as just questions—why not audit the course, and learn how to solve the problems you're having difficulty with? (Then write a Tell HN and update us on whether you feel you learned anything useful!)

I think I have my geek bona fides, but, studying subjects like Domain Driven Design, Clean Architecture, Patterns of Enterprise Application Architecture etc.

The hard problems that I think most people end up solving are more often business, people and process problems than computer science problems.

What are the differences you consider when making a distinction between application development and software engineering? It seems to me that application development is a subset of SE.
I heard somewhere that a computer science degree is actually a history degree in how we have solved problems in the past. Programming is a creative problem solving process, but certain problems took decades to solve and it’s only by knowing the history that people are able to resolve some of these hard problems. Don’t beat yourself up for not knowing all of history and give yourself a break for not being able to immediately solve problems that took dedicated researchers their whole careers in the early days of computing.
Knowing things like binary trees, heaps, B-trees, queues etc. are not history. They are fundamental to writing applications. Using one data structure or a particular sort method will make your application much faster. Supposed you have had a billion elements to sort, but you knew every element in that array is between 1-100. I mean a bucket sort would be much much faster than using a quick sort.
> They are fundamental to writing applications.

That's funny, I must not have written any applications in the past 14 years. (Seriously though, I read one algorithms book when I was 16, and used those algorithms approximately... five times... in the past decade and a half)

It's certainly good if you know how trees and linked lists are implemented, but as you point out most app devs are working on a higher level of abstraction. All of that nitty gritty implementation details are already available to application developers in convenient, well tested wrappers. You can easily go through your entire career without ever having to worry about how doubly-linked lists or B-Trees actually work.
> most app devs are working on a higher level of abstraction.

Until they don't, because for some reason the abstraction cannot be applied in a particular scenario (or actually could be, but it's not understood), or just does not scale anymore.

Serious question: How do you know that in the applications that you have written in the past 14 years, there aren't any spots that could be considerably improved in runtime behavior and cost?

I remember being a programmer before studying formal computer science, I definitely wrote some slow and bad code that I just didn't know could be much better, and/or simpler.

How do you ever know that there aren't spots that can't be considerably improved? Does it matter that much? Any inefficiency apparently wasn't bad enough to stop it being shipped.

I actually struggle more with not treating every problem like some algorithmic puzzle to be solved in one pass with O(1) extra memory and just writing stupid, slow, straight-forward code.

This remains a serious problem on my team- Over half my team members don’t have CS degrees. They get an enormous amount done, but there is often a perf or maintainability cost.

I have no intention of swapping them out because they ultimately provide enormous value, but it’s noticeable.

Is it the algorithmic efficiency that's the problem, or the ability to scale the application?

I've seen things some people wouldn't believe. mod_perl 1.4 on Apache 2.0 handling 350,000 hps dynamic traffic on twenty archaic 1U's. Five tiers of caching, serialized objects on local disks, NFS in production. C-beams glittering in the dark near the Tannhäuser gate. Who cares about inefficiency if it scales?

Putting aside the damage that issues with correctness can cause, the problem is exactly that if you e.g. wrote something that grows with n^2 instead of n log n, you cannot scale by "brute force" anymore, as the inefficiency very quickly outgrows the amount of resources you can add. Seriously, your thinking that "algorithmic inefficiency" can be countered by "scaling" is almost proving the point.

CS is by far not just about runtime complexity, but it's one thing that can bite you.

Also, all the components you mentioned were likely written, at least in significant parts, by people knowledgeable about computer science.

Scaling an application's operation does not directly relate to its algorithm's efficiency, is my point. Of course a really inefficient application can eventually become unusable, but even terribly performing applications can be "worked around" and thus scaled higher.

Say your app is using bubble sort. Egads!!! What a shit design. Clearly this is going to become a nightmare in real world scenarios. But wait - we can theoretically get to O(n) if the list is already nearly sorted. How can we achieve this? By monkeying with the dataset, queueing and batching operations, invalidating operations that take too long, artificially limiting the number of requests per second, or just passing the request to a completely different app depending on use case. It sounds insane, but if you can perform any of these things quicker than redesigning your app, so that it can continue performing under load, that's an example of "scaling" despite the application's poor performance.

Another example is the "scalability" of application development. Say you have an application which is basically O(1), but one day you find a bug in it. Even after you write and commit the one-line fix for the bug, if it takes you between four hours and two days to deploy it to production, or the validation process takes a month... You still have a bug in production for hours, days, or weeks. "Scaling" the development process can significantly reduce the amount of time needed to solve problems, or complete new features. It can be more beneficial to be able to ship code faster and more reliably, even if it isn't the most efficient code.

but even terribly performing applications can be "worked around" and thus scaled higher. [...] How can we achieve this? By monkeying with the dataset, queueing and batching operations, invalidating operations that take too long, artificially limiting the number of requests per second, or just passing the request to a completely different app depending on use case.

And that's a good thing? Part of my point is that this can be avoided, or at least have a higher probability of being unnecessary, if the proper basics were learned.

Wouldn't you wish the author would have just known how to properly sort a list[1] in the first place?

"Scaling" the development process can significantly reduce the amount of time needed to solve problems, or complete new features. It can be more beneficial to be able to ship code faster and more reliably, even if it isn't the most efficient code

Agreed to that, but as said, computer science is not just about runtime complexity. Knowing computer science might help you avoid those situations, or resolving them quicker.

I know that shitty stuff can work, even work "well enough", but going back to my original comment: Maybe it could work much better, simpler, more profitable if that's your favorite metric, with just the application of some basics, if they are known.

[1] Noting that "sorting a list" is a stand-in for all sorts of tasks that benefit from CS-knowledge.

Yes, absolutely it all could work better with CS knowledge. But CS is also definitely not a prerequisite to having functioning apps that can scale well.

CS can help you design the software equivalent of a Formula 1 race car. But most of us only need to work on things ranging from a Honda Civic to a semi truck. It's interesting how little of an education you need to work on a semi truck, even though it's a complex machine that does a tremendous amount of work, compared to the education you need to work on Formula 1 cars.

In the US, we have a big lack of tech talent, and I think part of the reason is the way people propose the requirements or education required to do these jobs. If it's a Honda Civic-level programming task, people shouldn't go through the expense and difficulty of a CS degree.

I think we managed to get on the same page then, I can agree to all of that.
It’s algorithmic efficiency and at a basic level- things like 9 levels of nested loops, each loop pass generating an http call (admitadly some of this is the platform we are using fault)
You are, in this case, better off just using the ultimate bucket sort: shove it into a histogram.

    hist = [0]*100
    for x in xs:
        hist[x-1] += 1
Epsilon algorithmic knowledge required.
My point wasn’t that they aren’t important, just that the OP didn’t need to feel bad about not learning about them yet. It was meant more to point out that learning the history of how other people solved problems can inform the way we approach new challenges, but that everything was unknown before it was discovered.
I believe that parent's point is that knowing things like binary trees, heaps, B-trees, queues is exactly like knowing history - in the example problem you give, you're not supposed to invent a solution and design an algorithm, you're supposed to know the (many!) historical approaches to historical problem, know their properties so that you can pick the most appropriate one, and directly use these methods (invented by others, studied by you) as-is instead of inventing your own solution from the basics.
>history degree in how we have solved problems in the past.

I like that, that's a cool way to think about it.

I've often thought it should be called "computational" science or maybe "skills in logical problem solving." Regardless of whether one pursues a career in software, a computer science degree is really good at teaching a person how to think.

Djikstra called it "computing science"
Interesting, I think a CS degree does not equal a programming job unless you prepare in addition to your CS degree.

CS programs focus more on the abstract parts of the field. For example, you can finish a programming project without having to program a sort function, this is a built in function in most languages, yet that's a basic part of a CS program.

I think generally there's a disconnect between what employers need and what CS programs provide.

Don't get me wrong there are jobs that could not be done without the knowledge CS programs provide but for the average programming job there's a disconnect and you'll have a hard time if you don't have that in mind.

So, yes, I can see how you can have a programming job without being able to solve a CS class problem.

That's akin to being a whiz at high school calculus and expecting to breeze through rigorous courses in real/complex/functional analyses. Possible if you're a prodigy.

You already got the practical programming down. Now if you take a course titled "intro to proofs" or "intro to discrete math", you'll be well prepared to kick any CS class' ass.

Computer science is not the same as professional software development, even though it makes for a good educational foundation. Often even those of us who studied computer science are separated from it by enough years or abstractions such that we have to take a step back and think about fundamental problems when they are presented. So don't feel bad, unless you believe this actually indicates an area for professional growth.

Said another way - I haven't needed to write <sort> in twenty years, so if I had to, it would take me just as long as it takes you.

> but when it comes to me trying to solve these problems on my own, I don't know where to start.

How do you expect to know where to start when you haven't been taught anything yet? Your short resumé does not indicate that you have any background in Computer Science. That's not bad, it's just different.

> Some of the problems which she is expected to solve are pretty simple problems, but I just can't seem to get the hang of any of them on my own.

So what are some examples of those problems? No one can really tell you if this is something unusual or not without having an idea of what the problems are. And CS courses and algorithms vary from pretty simple to actually really hard.

Probably something like implementing a red-black tree or merge sort, stuff no one does in the real world :)

There is a considerable disconnect between programmers who have a CS degree and those who don’t.

I’ve run into programmers who’d never heard of the term “boolean algebra” before and knew about regular expressions but didn’t know what a state machine was.

For the most part it doesn’t matter, but it’s always a little surprising when you find someone who knows AWS very well and then you find a huge gap in their fundamental knowledge.

Well, red-black trees and merge sorts don't grow on trees (ahem), even in a real word :)

But yeah, those are gonna be tough to just come up with on the spot without actually studying them. On the other hand, OP could be talking about stuff like tree traversal and similar simple stuff that is also included in introductory CS courses.

Edit: OP chimed in elsewhere in the comments, it's not even about CS stuff.

(1) Programming and Computer Science are not the same thing.

(2) Doing similar things over and over may not transfer experience to other things.

It's an unfortunate fact of life: You don't know what you don't know ;-) Especially as a programmer, you have to have the attitude that there is no shame in not knowing, or not being able to do things. 30 years or so in this industry and there are lots of things I'm not good at. In fact, as I spend more time, I discover more and more things that I don't know at all.

I've used this analogy before. When you first start, imagine that you are standing on the ground. There are lots and lots of things you can see. There is a lot to learn. Eventually, you get pretty good at everything you can see. But as you get better, hopefully you start travelling upwards. It broadens your horizons and you can see more.

Often this is an unsettling feeling. You think, "I've worked so hard, and there is still more???" Some people give up, "I'm fine doing what I was doing. This other stuff isn't necessary!" However, this will lead to an early exit from this career. Being a programmer is about always learning and always expanding. Things change so fast and you have to keep up.

As you learn more, you keep travelling upwards, expanding your view even more. It's amazing because when you thought there was a lot when you started, as you move upwards, the amount of new stuff you can see starts to accelerate. It's easy to get overwhelmed. Don't worry, though. Just pick stuff you are interested in. Don't rush. You have plenty of time. However, don't stop either.

Eventually, you will get so high that the earth is just a round ball. For a long time nothing will seem to change. You'll probably think, "I've learned everything! I'm amazing!". And then you will run across the moon. "Woah... I know nothing". That's what it's like when you start to get more senior. You keep expanding your view, but things don't seem to change, until you see some new island of stuff that you never really imagined before. Again, it's easy to give up and to think, "I'm a senior developer and I'm world class in X. What do I need with the moon?" But that's a trap. It's the easiest way to ensure that you are seen as the strange old doofus in the corner using crappy, ancient techniques. Learning, learning, learning every day for the rest of your life. That's what being a programmer is.

I hope that helps!

80% of all software is glueing frameworks together to do CRUD. There's an art to do that right as well, especially very large systems with lots of legacy. Readability, SOLID, safety. It's not something everybody has a talent for.

But it doesn't need particular deep CS knowledge. There are people that program for 30 years, get paid six figure salaries and "never needed that shit". And they're really good at their jobs. But sometimes (less often than it's required to pass for an interview) you're really expected to dig that deep because you need to solve problems that existing frameworks and libraries don't handle.

Background: learning basic CS stuff after 20 years of programming professionally. You will never learn it on the job.

Thank you to everyone who has replied to my rant.

I felt of low value for not being able to provide immediate help for most of the problems that she's being taught to work on.

Some of the examples (since some of you were asking for them): https://github.com/cs50/docs/blob/master/_pages/2018/x/psets...

https://github.com/cs50/docs/blob/master/_pages/2018/x/psets...

I realise that I may have written my original post a little hastily as I was feeling quite strong about having inadequate knowledge to solve these problems.

You've all been super nice to me, and I can understand where you are all coming from.

Again, thank you.

As an aside, the problem that I was stuck on earlier, I managed to solve through a bunch of trial and error, so I'm chalking that one up as a win for tonight.

Is there a particular part of these problems that is stumping you? Perhaps breaking them down into smaller sub-problems? Where is it something else?

Based on your original description I was expecting something more heavy on straight CS theory. “how do you sort an unordered binary tree in place“ kind of thing.

I've never been so great with figuring out loops to iterate over things and the like.

And some of the questions being posed (which are all expected to be solved in C) are a little tricky for me to figure out on my own without some of the niceties which I have been exposed to in higher level languages.

Perhaps the hardest of these was the Credit Card Validation example.

I was stuck for such a long time on trying to figure out how to utilise an array with for loops to multiply every second number of the card backwards.

This is Introduction to Computer Science and all of this is from week 1, so I was pretty much falling at the first hurdle.

Can you solve these problems in your language of choice then? How can you write business logic at work without loops?
I tried looking up various solutions in languages which I knew a lot better, so, and example of one of these would be Go.

The logic was there, but I still couldn't understand most of what was going on, unfortunately.

Through trial and error, I eventually managed to get something working.

>How can you write business logic at work without loops? It's not that I don't use them, it's that I have a hard time figuring out how to use them in the context of solving the problem.

I would be very interested to hear about some examples of real-world contexts that have proven tricky. As much detail as possible is preferable.

Incidentally I describe my problems with math almost the exact same way - virtually nonexistent fundamental understanding, and so huge issues with abstracting out even the simplest real-world tasks. (My wake-up call was when I was basically just mashing buttons on my calculator one day when I realized I didn't know how to compute how much of X I could buy given that it was $Y per weight.)

Have you tried writing it out on paper as a flowchart? Sounds old school, but can help with visualising what's happening.

Loops become super simple when you see them as series of steps with a yes/no question of whether to stop or go through your steps again.

Draw up some boxes for every variable you think you're going to need, give them labels and add the labels to the flowchart.

This then allows you to run through the flowchart step by step changing the values in each box as you go.

Personally, I would feel trying to find the solution by parsing other people's code would be way more complicated than just coming up with your own solution.

I would forget about C, though, and try to do it in a language you already know to begin with.

To be honest I also find it very difficult to relate, as especially the Cesar Chiffre seems like such an easy problem. I only have to read it and my brain already maps out the solution. (I guess you could call it a No-Brainer, except that it seems to be a "Brainer" :-)

I honestly can not imagine how you usually code.

However, I want to say I remember my first year of studying mathematics. Many of the exercises also seemed very hard back then, but looking back on them the following year, they actually seemed quite easy (well, most of them). So practice and experience really can work. No guarantees, though.

Personally I like "Project Euler" for programming problems: https://projecteuler.net/ I actually had questions pop up in interviews that I had previously solved on project Euler.

> Figuring out loops

Maybe you're making it too complicated. The reason for loops is simply that you need to repeat an operation. Call it repetition if that helps.

- for x;y;z - repeat a specific number of times, or need an index #

- for x in y - iterate over container

- while x - repeat while a condition is true

- do while x - like while, but run at least once.

So, imagine we have a string and need to add 1 to each character. The second bullet above looks best, first if the language is lower level.

From this description it seems you have problems with implementation.

You probably lack in "coding"(maping solution to code) department - it's totally normal in language you don't work in day to day. You are probably less skilled in implementing simple, lower level abstractions - understandable given your background.

I have more exp than you - recently I was helping friend with python ML code - it took me 40 mins to code 20 lines. I don't feel bad at all, because even though I knew solution, to write it in python I had to google for each line and read docs to know range handling, dsl of libs, array comprehension syntax, lambdas etc.

Good news is that it's easy to get proficient fast by doing such exercises. I can recommend codewars.com

> heavy on straight CS theory. “how do you sort an unordered binary tree in place“ kind of thing.

I was having a related conversation earlier, and feel like I'm reprising the same argument for a new audience, but... I don't see what is either Computer Science or theoretical about that. It seems like an eminently practical task: Handling things in a tree structure, sorting items, and doing work in-place to conserve resources are all very concrete, real-world aspects of writing software. You might not need them in _every_ case, but they aren't really "theory" in any real sense.

If you’re a bog standard “dark matter developer” using high level languages or writing your typical SAAS app, you wouldn’t need it.

I turned down a job offer where the interviewer was more concerned about whether I could write a merge sort on the board (I did), than whether I could design a system. It told me a lot about the kind of people they hire.

I spent my first 12 years as a developer doing a lot of bit twiddling in C writing cross platform code with nothing but the standard library, but these days if someone asked me how to sort I would call a library function. Heck even C has a built in sort function.

But those issues are all totally orthogonal to my point.

You can argue that someone doesn't need something, that it's the wrong level of abstraction, or that it's not an appropriate interview question. I even agree to some degree. But that still doesn't make those "CS theory" subjects.

If you are writing a webapp in PHP you need none of these things.
The examples you gave are very helpful in giving more context. I'm guessing that you're productive in your job, because you know the details of how to use language ABC, framework XYZ and the various patterns for solving common industry problems using ABC and XYZ. The part you seem to be weak in, is abstract problem solving. Ie, coming up with a pseudo-code algorithm that will accomplish some abstract goal that you've never come across before.

This requires a completely different skillset. You rarely have to come up with novel algorithms when building a CRUD app, hence why you've never gotten the chance to practice those skills. That said, it's definitely worth learning - if nothing else because it will help you in job interviews.

There's no shortcut to this. Go on leetcode or hackerrank or similar sites - or do all the homework assignments and projects along with your fiance. You're working out a brand new muscle, so it will definitely seem frustrating at first, but you'll get much better with practice.

Your first paragraph hits the nail on the head. This is exactly me.

Thank you for your reply. I do intend to work further on my skills in order to get better!

I went through this too! I'd definitely recommend giving it a go if you're up for it. You may have those moments of utter confusion, but you'll definitely learn a lot!
One (relatively) easy way to get better at it is combining a book and some real world uses with a project and a language suited for it.

For example, you could take python or java (or C#, pretty much any general OOP language), and make a simple crud application. Then add a "reporting" page where you can see different results on for example uses of trees, sorting algorithms or storage data structures (like linked lists, hash maps etc). The crud part can be your familiar part where you have a good feel of what's what, and the report/test/whatever page can be your sandbox to see how your experiments deal with your data.

One of the books I found helpful was Data Structures and Problem Solving Using Java by Mark A. Weiss.

A softer start can be found with http://interactivepython.org/runestone/static/pythonds/index...

If you want something using languages you already know, that's fine too. Say for example you wanted to simply know how to build a tree, or more generally a graph. Those concepts may sound big or complex, but they are only as big or as complex as you want them to be allowing you to build a simple version (i.e. a class that is a node in a linked list, and it holds just a number as a value and the next node for your list as a pointer or value or whatever you like). It's something you could do in 10 lines of code just to get yourself started. Building on top of that is a whole lot easier than jumping straight into AVL trees and A* path finding algorithms.

Starting light, say, making a few things yourself in a language of your choice will get you a good feel as to what you want to explore and how easy it is to grasp the concepts, for example:

- linked lists and doubly linked lists

- binary trees (binary doesn't mean binary data, don't worry)

- sorting (check quicksort, shellsort, bubblesort on wikipedia for starters to get an animation for an idea what it is)

- heap

- stack

- (priority-) queue

If you prefer watching videos/working through a MOOC for this stuff, I can highly recommend Robert Sedgewick's Algorithms I on Coursera: https://www.coursera.org/learn/algorithms-part1

If you don't know his name, you should - he's written some of the best books on these algorithms and his MOOC is similarly rich in visualizations and concrete examples that help you develop the intuition for the algorithms. Also incidentally his doctoral advisor was Donald Knuth, who he evidently learned a lot from.

Good job in putting it tactfully. I think you have it exactly right, there's a different skillset used in interviewing often, abstract problem solving - that really is different than the skills to write a crud app.
What exactly did you have trouble with? These really are simple problems, all you need are an understanding of loops, ASCII character codes, and basic arithmetic.

To be honest, I'm surprised a seasoned developer of 5+ years can't do these, or at least have a decent stab at them.

I just replied above, but I've never been amazing at being able to figure out how I should be using for loops to solve problems quickly and efficiently.

I do tend to make things harder for myself, as my boss and fianceè have told me before.

I usually end up with a very convoluted solution which I end up coming back to and refactoring the next day.

I'm curious, what sort of approaches do you take to your programming tasks at work? Is it more like e.g. writing SQL where you'd think more about relating sets of data rather than looping over individual items?
I was actually going to recommend exactly that - I find that, when I have a problem that I’m having trouble solving, just brute-forcing the damned thing helps me focus on the hard parts of the problem, and then I end up rewriting things in a “better” way that I’m actually not ashamed to put my name to.
Correct first, then simple and fast later. With more experience you'll be able to devise simpler, correct first solutions that you can then speed up later.
There's an old Kent Beck quote that fits here... "Make it work. Make it right. Make it fast." Your approach fits that.

http://wiki.c2.com/?MakeItWorkMakeItRightMakeItFast

I've seen so many projects where the developers have taken this to heart way too much. The problem is they use it as an excuse to give up after stage 2 thinking stage 3 can come along when it actually becomes a problem.

The thing is that performance issues tend to creep up on you so slowly that you don't realise it until you have a very important client with tons of data screaming at you to fix it now. To fix it then you have a huge architecture issue because the whole system is so inefficient. So rather than rewrite the entire code base to actually be efficient you are forced to hack in some kind of caching solution. Then your problems multiply.

Make it fast from the start. Premature optimisation being the root of all evil is a lie!

What is your hypothesis on where that lie comes from?
Ok, it's a bit of an exaggeration and obviously depends a lot on what your definition of premature is. I guess the statement is actually a tautology, by definition premature means too soon. I just see people who think that any optimisation at all is bad, whereas in a lot of instances optimisation as you are writing the initial code is not premature. In my experience...
If you do that you'll write great, fast code but it'll take you longer to do it. That's great if you have unlimited resources, but try doing it in a startup where failing to ship in a month means your whole business fails.

So... Maybe don't prematurely optimize?

I'm not sure you two actually disagree, but rather that you're thinking on different scales. Make it right, then make it fast is usually talking about specific snippets of code, rather than the whole program, so your whole program should be "made fast from the start" because you went through the process of making it right and then making it fast on the components themselves.
Yes, that's a great way of thinking about it!
We probably underestimate how many people out there are just copy/pasters. No offence OP but I hope you dont work on anything that handles money/user data/requires security.
I do! I develop bespoke add-ons for the accounting software Sage 200. Fear not, my work is peer-reviewed by my boss who has 35+ years experience in the field.

If I get something wrong, my boss lets me know, I learn from my mistakes and ship out good quality software.

Aren't you ever embarrassed that you work on accounting software but 'haven't been able to really figure out loops' (as you said elsewhere) to the extent that you study more and really nail down the bare basics of programming?
That crosses into personal attack. Please review the guidelines and don't do that here.

https://news.ycombinator.com/newsguidelines.html

Every time I see a deleted comment and a reply like that, I get so morbidly curious what was said, and yet, I've _been_ a moderator on a forum, so I know for certain that reading it would never make my mood any _better_, just worse.

Is this just me? I know it's self destructive to seek out negativity like that, but that curiosity just won't go away.

Just set "showdead" to "yes" in your profile and the fruit of the poisoned tree will be yours.
It's not just you. I used to read hundreds of dead comments, and thought "Don't they understand why they should be banned?"

Read mine. There is more to what's going on than meets the eye. And if you email me (see profile), I'd be happy to illustrate just how carefully Dan controls his image.

After all, see your language here. There's nothing wrong with being curious. That's the whole point of HN.

Why would you expect the modern application developer to even know what ASCII is?

There is a chance I wouldn’t know what ASCII encoding was if my exposure to programming didn’t start in the 8 bit era. C is foreign to a lot of self taught programmers.

A modern application developer should be at least vaguely familiar with Unicode, so character encodings should not be an entirely foreign concept.

You should be able to use a search engine to figure out what ASCII is, though. That's fair game to expect. The text document mentions ASCII, so it's not like a developer would be left without a clue.

ASCII does still map to the most commonly used parts of Unicode, so there is that. I would agree that I wouldn't have the foggiest idea what most of the ASCII character codes are if I hadn't cut my teeth on archaic stuff like QBasic; I remember a lot of silly little toy assignments doing rot13 or manually upper and lowercasing strings. But they do come up from time to time when you get into, for instance, JS keydown/keyup events. But any competently designed modern API ought to at least have named constants for this kind of crap
Don’t ask me why I remember that the lazy non performant way to put a character on the screen in assembly was to store the ASCII number in the A register and

JSR $FDED

The fast way was to copy the bytes directly to the $400-$7FF address space and figure out the non contiguous memory map -> screen yourself.

(After a "...I never used that in QBasic!", google explained that this is for the 6502)
I'm right now trying ti get around being made to learn ASCII for vocational school (some certification is useful to pass automated recruiters).

I base my Opinion on it being a bad idea to rely on manual translation, and untill then I'll have learned to write code that does the translation for me.

Remember the context, this is an introduction to computer science course. The slides for the lecture for that week most likely explained everything you need to know to solve the problem.

Even completely ignoring ASCII, it is trivial to create a dictionary mapping integers to characters.

In this modern time, no one needs to know what the ASCII code for @ is, but I think it is logical to expect people to know that some encoding exists and that letters can be mapped to numbers.

Also, all the ASCII you need to know to solve the problem is explained at length in the problem description.

I couldn't tell you offhand how to convert between an int and an ASCII character.

...But if you give me a second...

Now that I've typed "ascii character codes" into google, I can tell you how to convert between an int and a character.

You don't have to memorize everything. Well over half of our job is knowing how to find information quickly.

I have no trouble believing that there are many developers out there with no understanding of character encodings. Because I have seen many applications where the handling of character encodings is nothing but kludges upon buggy ad hoc kludges.
I mean the question also is whether OP has done any programming in C before. If the majority of your expierience is in VB.NET and web technologies I can see this being a major hurdle aside from the actual algorithmic problem.
I don't think C is the issue here but mental shift . I have suffered from same situation in the past. He should just spend time and interpret the question, internalize it , and then code it
You don't even need to understand ASCII. You can hard code an array of all the letters in the alphabet, search for a given letter and replace it with the letter 13 places ahead in the array. If you were really lazy and didn't want to worry about the logic for rolling over when going past Z, you could even rewrite the first 13 letters at the end.
Thanks for the provided examples.

If you have been working as software engineer for five years, but can't solve that task, that indeed makes me doubt how were you hired in the first place. I'm sorry if that sounds harsh; I appreciate your honesty and I would want to support you in your self-doubt, but I consider honesty to be more valuable in such a situation than being nice.

Caesar's algorithm in particular looks like a high school assignment, to be honest.

Thanks for your reply.

To be honest, I'm only just able to write a program in C, which is the required language for these CS50 tasks.

I've never been asked to do this kind of work before, so I had no idea where to really start.

The walkthroughs provided in the course gave me a high level overview to the solution required, but being able to translate that pseudo-code, if you will, was the part which I was completely stuck on for a while.

I felt like I should have known at least how to start off solving this problem using prior knowledge I had gained through commercial experience, but I was wrong, and none of my experience thus far was able to guide me in the direction which ended up with an answer to the problem.

Have you reviewed the lectures and other course material or just jumped into the problem sets?

A thing that may help: Approach this CS50 material as if you have no knowledge of programming. Set aside your preconceptions about both your ability and the nature of programming itself (to the extent that this is possible). Review the materials and read/watch all of it, even the things that you know. You may know them, but exercise the discipline to persist through them and practice the material.

At the beginning of the course, this was one of my problems. My fianceè would give me the specification of the program and that's it.

I've since learned to also follow along using the walkthroughs provided, since they provide answers to the most basic of questions that I would have asked.

I'm glad to see this OP, as my post was initially going to be pointing you towards the support materials, eg.g Caesar: https://www.youtube.com/watch?v=ergRKv3DglI

I would suggest you have a golden opportunity here, tbh. You have identified an area of useful skills which you currently are lacking - and a source of info where to learn. That's good. More importantly than that, your fianceè is currently doing the course and is right at the start! If you sign up to CS50 now (it's free!), you have maybe 4-6 hours of lectures to catch up before you are at Ceasar yourself, and then you can work through this excellent course together!

You will learn lots, some of which may be very useful. As will your fianceè. And you'll both have a much easier and fun time having a partner to discuss the lectures and problem sets, helping each other out here and there, before having to reach out for assistance.

Just FYI, you may want to hang on to your LUHN algorithm implementation - I’ve had to do that for work several times. That’s actually pretty real-world relevant.
I mean, I notice that these assignments seem to assume that you are using C. Are you using C?

You said that you have used PHP, Javascript and VB.Net. C is much harder to use than any of these, and exposes you to many concepts that these languages have abstracted away.

There is very good advice and suggestions here, but IMO this thread is also distinctly "noisy" - lots of discussion and sharing, but very little in the way of a coherent go in this direction!.

So, I'd like to offer a couple of things that may be of immediately actionable, relevant assistance: SICP and NAND2Tetris.

--

SICP - the Structure and Interpretation of Computer Programs - was designed as an entry-level theory-first approach to programming. If you want to drown your brain in abstraction and get oriented quick, this will help you do that. It's very dense; expect to read it slowly, and also don't force yourself to block on one specific spot until you've understood it. If you can reach some sense of logic and order that lets you get through CS questions without breaking a sweat, who cares if you had to read the textbooks backwards or out of order.

I explicitly recommend SICP because you can find PDFs and EPUBs of it online (it's quite an old/classic book). I see a lot of book recommendations on here that I can't follow up on due to insufficient throwaway budget.

Plus, studying SICP with your fianceè will put her in a significantly better position to ace her CS courses.

I found this HTML rendering: http://sarabander.github.io/sicp/ (google will very readily find PDF and EPUB copies, but this version seems nice)

--

NAND2Tetris explains every step of a CPU from the electrons up (as opposed to the top-down orientation taken by eg JS, VB, etc), and has you build a toy CPU.

https://www.nand2tetris.org/

Unfortunately I've just discovered that this course, which used to be a little more open, seems to have closed down somewhat. Either that or I misunderstood and it was never an open course.

This being said, searching for "The Elements of Computing Systems" - the reference textbook for this series - is finding a PDF pretty quickly. The book itself is apparently listed on Amazon, so perhaps the PDF version could provide an idea of whether it would provide any value.

This course is taught in many CS classes IIUC, so studying this with your fianceè will also leave you both in a better position.

--

Also - I've been wanting to see how well I can explain pointers and so forth for a while now. Ping me if you like.

(I seem to be atrocious at email/IM-style communication, FWIW, so this may go horribly wrong)

Wtf? The second problem, listed after the Caesar cipher, is to reverse the hashing algorithm used for passwords on Linux.

What? How is that even remotely fair to ask as a challenge alongside something like the caesar cipher? One of these is a children's task while the other is a professional cryptographer's task. Am I missing something here? I'm sure it must not be terribly hard to do, but it's still so disproportionate to the previous task that I'm shocked.

You're not reversing anything first off, it looks like you're just call crypt(3) with every potential password since they put a five character cap on it. 600M or so combinations, so pretty trivial, but feels fun. I'm actually all for this assignment, it makes you feel all hacker typer.

Secondly, it's DES. DES hasn't been viable for almost two decades now.

These problems remind me of the ones on checkio.org. The difference being over there you get the benefit of using python--not that I already knew python but it's rather intuitive, plus you can run a million things through an interpreter to quickly understand how it works. These CS50 problems require C, which most mortals would have a much harder time working with.

In either case you constantly consult the language reference and standard libraries until you find something that works. The C reference at https://reference.cs50.net/ looks perfectly good.

To be honest I don't know how I would load a CC# into an array to compute Luhn's algorithm on it in C. In Python I know there are easy ways of doing that, because strings are automatically arrays in the first place (same as that Caesar cypher problem, Python makes it much easier to work with strings). I don't even know if that's the "right" way to do it, but that's what I would do in Python: Convert the number to a string, operate on it as an array, converting each character to an int as it goes, running the algorithm as given in the problem, back-converting to string and then back again to int as needed (like if I need to add the digits of a number together). Fine I suppose I could avoid doing that by taking modulos and if I didn't know what a modulo was I would divide by 10 for instance and then take a floor to get the first digit of a 2-digit number.

I have no idea if any of these methods are "correct", I would just hammer away at the code until the acceptance tests passed. It would take over an hour for each of these solutions, after getting into the zone, so let's say 2 hours. There you go, 4 hours of work to get through these two problems in C, let's add on a lunch break and we have a full work day. That will be $325 thank you. Oh I don't get paid to study computer science in my free time? Oh ok. I guess I will just bookmark CS50 and come back to it... some day.

Your wife is lucky she gets to study this stuff. Don't be so hard on yourself.

The solution is C is essentially same as the one you outlined in Python.
I'm pretty much in the same boat as you, so to speak.

I had a lot of fun playing with a few of these problems: https://adventofcode.com/

I'm not sure if they are classic CS though.

I would recommend not getting scared looking for the whole bunch of specifications at once, Try to say or write the solution's steps in plain English letting only the most fundamental, as you were explaining the steps to a kid or so, Try to imagine yourself explaining/teaching in simple words is a good way to reason better about the problem. I started learning programming as a hobby/long-term-dream at almost 40 y.o. and it felt so hard to understand the most basic thing in Ruby, like what an Array is, for example, that it gave me literally a big headache and devastating disappointment, even almost cried...now I laugh remembering that :D There is an interesting book I saw then that I recommend, it's name is "the nature of code" , talks about examples of algorithms that appear in Nature and natural phenomena.
I mean you had your share of tough love already in this thread. But: - The examples you posted are indeed very simple problems. Caesar is just about "can you scan two arrays at the same time" (and then do charString + charKey and some modulo). Luhn is just a step of non-obvious specification to follow.

- This is a different game than your day to day. Those two being easy stuff means nothing if you never played the game.

- Now you moved a "unknown unknown" to the category of "known unknowns". You know you have no competence in this category, and if you wish to improve in it you can do so. Or not, it's your choice. Before, you didn't have the choice. So that's good!

- It's not about the language. You can solve these in Java, C, Assembly, Haskell. Most training website for interview questions (like these) allow you to implement in any of the major languages. If you want to play the game and get better, I recommend Hackerrank (for structure) and TopcoderArena (for variety, since they give you a bit more fuzzy spec and you also need to identify the algo for the issue at hand). The latter is slow as balls though, and offers no solution (except the best submitted, which may be cryptic).

- This stuff takes time, and if you want to learn about things you'll have to book up. Cormen's "Intro to algorithms" or Skiena's Manual are the goto texts. They are thick. Take your time. Persevere.

They sure make it sound more complicated than it really is... I'm a self taught developer too, so I get where you're coming from :-)

In javascript I would solve it like so: "HELLO".replace(/./g, character => String.fromCharCode(character.charCodeAt() + 1))

This would result in "IFMMP".

Basically it's just a matter of shifting charcodes.

Your solution would not work for all cases. For example, shifting "JAZZ" up by 1 should result in "KBAA" but your program would output "KB[[". You also need to handle wraparound at the ends of the alphabet.
Hi! Yeah, you're right! This was a 1-minute quick'n'dirty solution :-)
I'm sorry to say this - but given this examples I wouldn't hire you if you can't solve so simple stuff.

You have probably problems with text comprehension because I don't know how you can't solve it.

It's not coding that's needed - you should be able to do it on "paper".

What are you really struggling with?

1) understanding problem setup (reading)

2) coming with solution to problem (search)

3) implementing solution in programming language (coding)

I have to agree with you. Especially the ceasar cipher example is literally about following the steps, everything is outlined in an almost step-by-step fashion. The only part of the exercise that might be new to OP is programming in C - but the algorithm itself is stupidly well explained and the bullet points literally tell them what to do. It's as if they read the first paragraph and decided it's some arcane voodoo magic so it's not worth reading any further.
It might sound a little bit too harsh, but I totally agree with you. Furthermore, provided examples are missing search step – there's no need to come up with solution, because solution is explicitly specified in task description.
When I learned about the CAESAR cypher, I wrote a program called ENIGMA that changed the number of places shifted with each iteration.

Obviously I knew next to nothing about cryptography, and I did feel very smart about making a safer cypher.

I think you just need to brush up on data structures: https://www.geeksforgeeks.org/data-structures/ (There are probably better resources like HeadFirst or Khan Academy)

Most of the problems you've listed become easy the more familiar you are with data structures. This is a more common problem for anyone outside the SV/SF bubble and I wouldn't worry. Just start doing homework and you'll be fine.

Once you're done with data structures, I would start checking out design patterns: http://shop.oreilly.com/product/9780596007126.do

Hope it helps

Seems like the sibling comments have already doled out the tough love. All I can add is that I'm in a similar boat, having worked for a long time and now back at university to finally check out my degree... The material is much, much more challenging than I would have thought. Which is disheartening because I have so many years of experience and thought I knew most of what there is to know... So eh, don't give up! Working on those homework problems with your fiancee is a great opportunity to learn more.
Okay, I'll give you the "triage" presentation. It's a combination of "where to start" and "what I've actually used in industry."

1) Algorithmic complexity: Study why naively adding to the end of an array or the end of a string results in O(n^2), while doubling the size when you increase the storage results in O(n). That one tidbit has comprised some embarrassingly large fraction of the "consulting" I used to do working for a language/VM vendor.

2) Graph theory. Study BFS and DFS and implement them a few times to do things like solving a maze. Get comfortable with those until you can "run" them in your head when looking at a problem specified on paper containing a graph, and you can see uses/consequences. This will both keep you out of trouble and can be a starting point for further study.

3) Concurrency. Learn about race conditions and deadlock. Figure out some tools and patterns for dealing with them. Use them to write a chat server and figure out how to automatically QA it until you can break it.

4) Transactions. ACID. Read up on why you have ACID transations, and what can go wrong.

That right there is good for some huge percentage of what could really get you into deep trouble.

4th one should be elective :-P
I disagree. I'm not asking for one to implement ACID transactions. Rather, just understand why people did it. I'm building a system which is relaxed down from ACID, which depends on idempotency and a single coordinator process to keep a cluster of servers from trampling on each other.

You need to know the rules and the reasons behind them if you're going to start "breaking" them. Otherwise, you're just acting in ignorance.

Could you explain why adding to the end of an array results in O(n^2)? From what I can find, it appears to be O(1). If you increase the size of the array by 1 each time and copy the old array elements over, wouldn't that be O(n) to copy the array plus the additional add, O(n+1) which is just O(n)?
Could you explain why adding to the end of an array results in O(n^2)?

If an operation does that n times, then it's O(n^2). It's very common for self taught programmers to write operations that do the naive addition many times. There have been entire consulting trips caused by basically that, including, so I heard, the one that brought a consultant into the Chrysler C3 project and sparked the invention of Extreme Programming.

You're restricting yourself from some opportunities by not knowing CS fundamentals.

Those are very common problems in programming interviews, and in those cases you would be disqualified.

If that bothers you (and the fact that you posted this question indicates to me that it does), then I would recommend taking the opportunity to learn along side your wife. You don't get the degree that way, but at least the knowledge is free. And your wife might like it, as a plus.

Learn a different language. I would recommend C, Forth or Lisp for stretching your brain.

Solve challenging problems; databases, interpreters, whatever floats your boat.

The only way out of the matrix is to keep pushing boundaries, repeating the same old with different frameworks is the blue pill.

Seems like you discovered a gap in your knowledge, congratulations, you're one of the lucky ten thousand [0]!

It might be a good idea to pick up a book about algorithms (others are posted here) or follow an online course yourself to learn about these things. They might give you some insight into problems which you might encounter during your job.

On the other hand, solving algorithmic problems is not equal to 'software engineering'. You have to think about more than solving a (theoretical) problem in isolation and you've build up skills on that area of the past few years. From source code management to soft skills, these are things a compsci degree won't necessarily teach you.

From personal experience though, I find that my background does help me (at times) with solving problems at work. But apart from the utility of learning compsci, consider that it might be fun to learn so and just give it a go.

It doesn't make you less of a web developer by not knowing it though, so don't be too hung up on it. It's just different, as others have pointed out.

[0]: https://www.xkcd.com/1053/