Ask HN: I've been a programmer for 6 years, and I can't solve basic CS problems
404 points| cs0 | 7 years ago
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.
[+] [-] swatcoder|7 years ago|reply
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!
[+] [-] aphextron|7 years ago|reply
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.
[+] [-] guitarbill|7 years ago|reply
[+] [-] supercall|7 years ago|reply
[+] [-] throwawaylolx|7 years ago|reply
[+] [-] tempestn|7 years ago|reply
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!)
[+] [-] unknown|7 years ago|reply
[deleted]
[+] [-] peteforde|7 years ago|reply
I've now run three tech companies and hired dozens of developers by having really intense, thoughtful conversations with them. I asked them to tell me war stories and encouraged them to share insights on how they solve problems.
I only rarely look at code, because it's self-evident when you're talking to someone that is passionate about programming + intellectually curious-to-hungry + an interesting person who demonstrates empathy and seems like someone you'd want to spend 7-9 hours a day with.
I hire like I'm trying to form a rock band: I don't tell them what to play, I give them permission to show me what they've got.
Here's the thing: the more we, as a class of developers, put up with these devolving interview processes, convince ourselves that this is somehow our failing and our inability to FizzBuzz in six languages with a sharpie and people watching... the more we allow it to be considered okay, and the more normal it will be to expect this nonsense.
I know that being cash-starved sucks, but you know what? If you walk into an interview and they bust out the markers and ask you to start sorting, I sincerely hope that we can collectively find the strength to laugh at them and politely tell them that you'd never waste your time at a company that insults your craft.
Find your pride and tell them why they missed out. If they want to understand what just happened, tell them to take you for a drink. If they are dicks about it, you really didn't miss out on a damn thing. I promise you that.
[+] [-] rwhitman|7 years ago|reply
I just had a long conversation this afternoon with a friend who manages a tech recruiter team and she was telling me how frustrating it is working for cash-strapped early stage startups who pass on perfectly talented & experienced candidates open to taking a salary hit - because they, in their inexperience, cannot fathom how to interview without subjecting candidates to a series of dehumanized and impossible puzzles that are only solvable by people who have dedicated themselves to puzzle solving.
Meanwhile established companies with deeper pockets, such as banks, scoop up these candidates to do humdrum back office software work because they use tried and true interviewing methods.. like talking to candidates.
I attribute most of the issue to inexperience on the hiring managers' part and pressure to hire only the "best of the best" from leadership. Coupled with developers' personal insecurities, lack of education on the fundamentals of management, echo chamber noise around code test culture and the incessant desire of engineers to abstract away any human elements of their work, the process has devolved into a toxic mess when it comes to recruitment and interviewing.
Hopefully the situation can be fixed at some point. But until then, I'll keep on scooping those 10xers by trading war stories over the phone, thank you very much...
[+] [-] mcv|7 years ago|reply
Some want me to do an assessment, which is fine. But it's at home on my own dev machine, and not on some whiteboard.
I generally like these take-home assessments. The best had me write a game board in React on which you could place obstacles, and an adapted A* algorithm to find the shortest path through it. That was really fun. I'd never done something like that.
[+] [-] robodale|7 years ago|reply
[+] [-] cloverich|7 years ago|reply
Which is all to say, I can agree in general with obtuse CS problems being a bad proxy. But I think asking someone you are hiring to write code all day to write code as part of the interview is reasonable, and at this point I'd be suspect if I were interviewing somewhere and they _didn't_ ask me to write at least _something_.
[+] [-] james_s_tayler|7 years ago|reply
[+] [-] hacker_vishwa|7 years ago|reply
I liked this approach of hiring.
[+] [-] huawhey|7 years ago|reply
You don't want to just ask them to tick boxes, because first off some'll lie to you, and second, the dunning-kruger cases will lie to themselves. Can they communicate? Can they solve unseen problems? Can they do so comprehensively and rigorously? Do they know how to maintain a project for many years?
An interview method that can't tell the passionate hackers from the posers and pencil pushers is worthless.
[+] [-] cs0|7 years ago|reply
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.
[+] [-] whack|7 years ago|reply
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.
[+] [-] machiaweliczny|7 years ago|reply
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)
[+] [-] hmmk|7 years ago|reply
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.
[+] [-] TheFattestNinja|7 years ago|reply
- 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.
[+] [-] MBCook|7 years ago|reply
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.
[+] [-] golergka|7 years ago|reply
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.
[+] [-] commandlinefan|7 years ago|reply
[+] [-] paradoxparalax|7 years ago|reply
[+] [-] chaostheory|7 years ago|reply
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
[+] [-] triangleman|7 years ago|reply
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.
[+] [-] echlebek|7 years ago|reply
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.
[+] [-] bjourne|7 years ago|reply
[+] [-] peterkelly|7 years ago|reply
Writing code is the easy part. It's tedious, requires lots of practical knowledge and troubleshooting skills, but is for the most part a straightforward exercise. Computer science is about the theory. It involves solving problems in the abstract, using (and in some cases creating) new conceptual tools with which to think about, model, and solve a problem.
Many jobs in the software industry require only programming skills, and with those you can get along decently at any one of thousands of companies which are basically just building the same kinds of applications over and over again. But doing anything truly interesting requires venturing into the world of computer science, which requires years of study to master.
[+] [-] klunger|7 years ago|reply
It really annoys me when people say "oh that stuff is so trivial, you need to be doing low level C++ optimization or whatever to be doing anything truly interesting or important." It's "Revenge of the Nerds"-type BS. But the truth is that jobs that "only require programming skills" can certainly be interesting if you take it seriously, and treat your craft with the respect it deserves.
[+] [-] mcv|7 years ago|reply
And for most programming jobs, real programming experience is far more important than a broad understanding of CS. With a solid grounding in CS, you'll be able to tackle more complex issues and maybe be more flexible to switch to completely different IT-related careers, but for most jobs, it's not necessary at all.
[+] [-] sheeshkebab|7 years ago|reply
[+] [-] donkeyd|7 years ago|reply
What's the definition of 'truly interesting' though? I designed and helped build a SaaS product from the ground up. The product is quite revolutionary in its market and is getting interest from multiple Fortune 500 companies and smaller multi-nationals. I have 0 CS background and am fully self-taught. To me, however, this is truly interesting.
[+] [-] gregorygoc|7 years ago|reply
[+] [-] stcredzero|7 years ago|reply
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.
[+] [-] topkai22|7 years ago|reply
That's not to say a CS degree isn't useful- My observation is that a good foundation in computer science (algorithms, data structures, type theory, programming language, and systems) does help improve code quality and tends to be insurance against "hitting a wall" when problem solving, but my team members without CS degrees generally just as productive in delivering value. Its all learnable outside a university as well- one of the guys on my team with a liberal arts degree has picked up so much theory of the years I'd call him the "most CSey" of all our people.
The repeating problems I have with my team members lacking a CS degree general are misuse of type systems (IE- never creating interfaces, not inheriting, copy and paste reuse, etc...) , not doing functional programming right (or at all) in Type/JavaScript (this really stinks when Promises are involved), and a lack of awareness about performance consideration (hey! I think I found the problem! There is 9 levels of loop nesting, and each call inside the loop does a web request). These are areas my CS education really helped with, even if I didn't know it at the time.
On the flipside, the "CSey" crowd on my team (including some self taught people) sometimes lose productive chasing non-issues that don't conform to some platonic ideal we were taught (yes I know the array only ever has 3 elements in it, but I got the operation to run in O(n) time!).
In short, I'd encourage you to try to learn these toy problems and the concepts behind them as they do have value, but hardly a core requirement to deliver value creating software in most circumstances.
[+] [-] nabla9|7 years ago|reply
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.
[+] [-] cyphar|7 years ago|reply
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.
[+] [-] Kinnard|7 years ago|reply
The best definition of complexity theory I can think of is that it's quantitative theology: the mathematical study of hypothetical superintelligent beings such as gods. Its concerns include:
If a God or gods existed, how could they reveal themselves to mortals? (IP=PSPACE, or MIP=NEXP in the polytheistic case.)
Which gods are mightier than which other gods? (PNP vs. PP, SZK vs. QMA, BQPNP vs. NPBQP, etc. etc.)
Could a munificent God choose to bestow His omniscience on a mortal? (EXP vs. P/poly.)
Can oracles be trusted? (Can oracles be trusted?)
And of course:
Could mortals ever become godlike themselves? (P vs. NP, BQP vs. NP.)"
https://www.scottaaronson.com/blog/?p=56
[+] [-] poulsbohemian|7 years ago|reply
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.
[+] [-] haney|7 years ago|reply
[+] [-] dep_b|7 years ago|reply
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.
[+] [-] lmilcin|7 years ago|reply
You've been conned into thinking Computer Science prepares for Software Engineering. That's not true.
While you may need some Computer Science knowledge from time to time (and in fact there are some rare jobs heavy in Computer Science knowledge) almost all typical development and especially entry level software engineering jobs are all about knowledge and skills that are not taught at school.
You've spent past few years learning other important skills. You don't need to know how numbers are divided, you don't need to know how cuckoo hashing works and you don't typically implement A* from scratch to get your company's systems implemented.
I don't want to say it is not helpful to know these stuff. It certainly is. But to spend couple of years of your life getting in debt instead of earning money and useful experience -- that's something everybody has to ask themselves if they think to get into Computer Science as a way into software engineering.
[+] [-] sowbug|7 years ago|reply
First: a lot of applied software engineering has the overarching goal of allowing developers to quickly build useful, stable, and secure products with relatively little knowledge of complexity principles or the implementation of the underlying system. Your successful career demonstrates the achievement of that goal. This is good. But it has absolutely nothing to do with your ability to build the tools you use, any more than a writer would know how to manufacture a pencil from raw materials. They're completely unrelated skills. But that was the whole point from the start of the profession!
Second: your spelling of "fiancée" is incorrect. The word comes from the French word fiancer, to betrothe. In French, you add the equivalent of the -ed suffix by changing -er to -é. Then for a female subject, you add another e. So "fianc" + "é" + "e" = betrothed woman. Using a è (backward accent) at the end of a French word isn't just wrong; it's more or less impossible (at least I can't think of a word that ends with è). Compare a snippet of JavaScript like if )a == 3) { b = 3: } You're an experienced JS developer, so you can spot the two syntax errors from a mile away. That's what "fianceè" looks like to a reader for whom accents are significant. Just stick with "fiancee" without accents, and you can't go wrong.
Sorry to hit you when you're down.
[+] [-] Kaotique|7 years ago|reply
It really depends on your experience and knowledge for what is simple for you.
You can have 20 years of experience developing projects and acquired a ton of valuable skills but when I shove a whiteboard in your face and tell you to solve some algorithm it's completely new and not simple at all.
Just as someone with a lot of theoretical CS knowledge will struggle if I present them with a failing dependency tree of 30 thousands NPM packages. Good luck solving that when you have never done it.
[+] [-] kvm|7 years ago|reply
I would agree that an algorithms class does not equate to success as a software developer, but if you’re having issues with an intro class, there are certainly gaps in your knowledge. They might not reflect in your current job but may reflect in the future. I’d recommend actually brushing up on your fundamentals.
[+] [-] cyberprunes|7 years ago|reply
The problem is thinking that "It's ok!" to spend your career in ignorance because your job doesn't involve inventing new algorithms or pondering theory. That's just lazy. I know, I did that for years too, not knowing why I should bother since I'm doing just fine without it! That is the arrogance of ignorance at work. I guarantee that you don't know how miserable you really are.
It's not about passing whiteboard interviews, it's about achieving a deep understanding of fundamentals. It will change and improve the way you think and approach problems. It will improve your software regardless of whether or not it involves an actual "CS problem" because your mind will be elevated. I did the same thing for years, I whined about "whiteboard interviews that don't effectively display my skills and unique gifts to do the job". It's a dumb mindset.
My advice as an internet nobody would be: Now that you've seen that you are struggling in this area, work on it! Don't let these people encourage you to remain ignorant. Advocating for ignorance is shit that propagates shit.
Ultimately, understanding the principles of your field will make you better. It's not about the damn whiteboard!
[+] [-] WheelsAtLarge|7 years ago|reply
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.
[+] [-] extragood|7 years ago|reply
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.
[+] [-] beering|7 years ago|reply