9 ms·
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 ta
by cs0 8y ago
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/2/caesar/caesar.adoc https://github.com/cs50/docs/blob/master/_pages/2018/x/psets...
https://github.com/cs50/docs/blob/master/_pages/2018/x/psets/1/credit/credit.adoc 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.
- MBCook 8y agoIs 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.
- cs0 8y agoI'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.
- chillacy 8y agoCan you solve these problems in your language of choice then? How can you write business logic at work without loops?
- cs0 8y agoI 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.
- exikyut 8y agoI 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.)
- dwd 8y agoHave 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.
- sdfjhsdffhhhh 8y agoPersonally, 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/ https://projecteuler.net/ I actually had questions pop up in interviews that I had previously solved on project Euler.
- abeyer 8y ago> 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.
- scarface74 8y agoIf 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.
- abeyer 8y agoBut 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.
- the_clarence 8y agoIf you are writing a webapp in PHP you need none of these things.
- whack 8y agoThe 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.
- cs0 8y agoYour 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!
- derangedHorse 8y agoI 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!
- oneplane 8y agoOne (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.html 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
- hmmk 8y agoWhat 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.
- cs0 8y agoI 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.
- hmmk 8y agoI'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?
- commandlinefan 8y agoI 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.
- Jtsummers 8y agoCorrect 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.
- onion2k 8y agoThere'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 http://wiki.c2.com/?MakeItWorkMakeItRightMakeItFast
- golergka 8y agoThanks 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.
- cs0 8y agoThanks 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.
- Jtsummers 8y agoHave 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.
- cs0 8y agoAt 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.
- commandlinefan 8y agoJust 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.
- echlebek 8y agoI 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.
- exikyut 8y agoThere 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/ 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/ 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)
- gassiss 8y agoThere's also a Coursera MOOC on Nand2Tetris: https://www.coursera.org/learn/build-a-computer https://www.coursera.org/learn/build-a-computer
- aerovistae 8y agoWtf? 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.
- monocasa 8y agoYou'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.
- triangleman 8y agoThese 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/ 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.
- saagarjha 8y agoThe solution is C is essentially same as the one you outlined in Python.
- ryan-allen 8y agoI'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/ https://adventofcode.com/ I'm not sure if they are classic CS though.
- paradoxparalax 8y agoI 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.
- TheFattestNinja 8y agoI 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.
- Neist 8y agoThey 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.
- machiaweliczny 8y agoI'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)
- gambiting 8y agoI 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.
- StrLght 8y agoIt 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.
- Shorel 8y agoWhen 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.
- chaostheory 8y agoI think you just need to brush up on data structures: https://www.geeksforgeeks.org/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 http://shop.oreilly.com/product/9780596007126.do Hope it helps
- bjourne 8y agoSeems 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.