Live data from Hacker News

Computer Science Interview Questions with C++ Solutions

grokit.ca

31–40 of 73 posts

Re: Computer Science Interview Questions with C++ Solutions

#32

I really wonder if this sort of rote learning has anything to do with being a decent programmer, and if sensible companies that I want to work for are really asking these sorts of questions. Personally, I could probably tell you the uses for heaps, trees, tries, and hashes before I wanted to check something in a book or look something up on the net. I would think that I am better placed to write sensible code because…

I agree with Colin. I think knowing these types of things is great and studying them before an interview shows effort. I'm not sure I would ask someone to implement a B+ tree or BST or something on the spot, but knowing what one is, having worked with one before, knowing what they are useful and commonly used for is something I would definitely someone working for me to know.

Re: Computer Science Interview Questions with C++ Solutions

#33
post #3

As a side note: never interview in C++. For these types of problems java is just so much easier to work with, and it's easy to learn enough java to interview with in a weekend from a C++ base. In my experience, interviewers always prefer a good easy solution (java) to a so-so difficult one (C++). Ruby and python are worth a try too, but often they make things so easy that the interviewer disregards the answer--many c…

I was interviewed twice this year. In both interviews I answered a question by saying "first, let me cheat a bit" and providing a Python one-liner. Then, I'd proceed to develop a longer version in C. Both times my interviewers were impressed.

I think knowing how to solve a problem in Python (or any high-level language) demonstrated pragmatism and knowledge of the language and its stdlib.

Re: Computer Science Interview Questions with C++ Solutions

#34
post #3

As a side note: never interview in C++. For these types of problems java is just so much easier to work with, and it's easy to learn enough java to interview with in a weekend from a C++ base. In my experience, interviewers always prefer a good easy solution (java) to a so-so difficult one (C++). Ruby and python are worth a try too, but often they make things so easy that the interviewer disregards the answer--many c…

Java is your blub? Why not go for Haskell or ML?

Because in all likelihood, the jobs most of us will be interviewing for will never require us to touch Haskell or ML. I haven't worked with it, but I've worked with Lisp/Scheme/PROLOG and others. I'm always down for learning something new, but I doubt many people here get paid to write Haskell on a regular basis. Or maybe I'm wrong?

Re: Computer Science Interview Questions with C++ Solutions

#35
Having been in the industry for a while, I've come to realize that the sad reality is that (IMHO) the vast majority of the companies would be quite happy if the candidate was able to regurgitate such answers in an interview. I know (acquaintances) who keep working on interview questions and, basically, keep interviewing. Hopping from job to job, they have done very well financially.

Re: Computer Science Interview Questions with C++ Solutions

#36
post #21

i don't know why but statistically the number of times i've written code to BFS on a binary-tree given the day-hour experience i've had, is zero.So why don't interview patterns change too. If we expect the person to design,code,execute with you , why don't we check those aspects instead of pure-academic questions on integrity of a tree-search for high-performance solutions delivered in a 10-minute conversation. Also…

Since when is tree traversal "pure academic"? It's like one of the most mundane things, it's like sorting or hashing, it's something you run into on a regular basis, and the fact that it's wrapped into a library doesn't give you an excuse to not know it, because that knowledge is necessary to use the library correctly (i.e. answering questions like "do I use TreeSet or HashSet here?"). It irritates me because it's no…

its the same point that am trying to make.my use of pure-academic was in the pun-sense of it.

Interviews shouldn't be checking bare minimum, when we spend a 10minute time talking to each other , i would rather prefer to spend it on something rather less mundane.To check for bare-minimum we could screen via their previous assignments.But again it depends on what level we are looking for.like the above comment , if we are looking for fresh grads it better be focused on basics.

Re: Computer Science Interview Questions with C++ Solutions

#37
I have a question, I consider myself a great software developer with a proven track record. I have open source code, lots of completed and shipped websites and software.

Do interviewers really care about this sort of interview knowledge outside of the San Fransisco start up bubble? I've been programming and making a great living for more than 8 years now, and not once did I have to implement a b-list tree or something CS-y like that.

Re: Computer Science Interview Questions with C++ Solutions

#38
post #13
post #3

As a side note: never interview in C++. For these types of problems java is just so much easier to work with, and it's easy to learn enough java to interview with in a weekend from a C++ base. In my experience, interviewers always prefer a good easy solution (java) to a so-so difficult one (C++). Ruby and python are worth a try too, but often they make things so easy that the interviewer disregards the answer--many c…

I always tell candidates "I am multi-lingual, feel free to answer in any language you want, with bonus points for Lisp or Scheme." So far no one has taken me up on the latter option. :( Everyone ends up coding in straight C, rather annoying really. I'd kill for someone to pull out Python or some other language more suited to the problem. All that said, straight Java is also likely a horrible choice. Boilerplate code…

> So far no one has taken me up on the latter option. :(

That's weird. I always thought Clojure would be great for these kind of questions if allowed. I guess Clojurians are scarce.

Oh, and it's real fun too! http://www.4clojure.org has lots of riddles to solve.

Re: Computer Science Interview Questions with C++ Solutions

#39
I really don't find these questions to be useful indicators of the things that make-up a good software engineer. I am using "software engineer" here on purpose and as something distinct from "programmer" or "coder".

One will design and develop good reliable products that are maintainable and extensible. The other will just crank out code and is likely to not really add value beyond that.

I want to know how a person thinks and reasons, how good he or she is about data representation or the formulation and communication of a strategy in creating a solution. I want to know how a person thinks at the abstract, code, project and product levels.

I don't really care to learn that he or she can memorize 150 CS interview tests. In fact, if someone aced the CS tests I'd pretty much assumed they memorized a whole pile of them for the interview. That, to me, is useless as it isn't an indicator of the kind of professional you might be hiring.

If what you are after is a coder, an assembly-line worker, then puzzles might work. If, on the other hand, you are looking for a true software engineer, you need a different approach.

Re: Computer Science Interview Questions with C++ Solutions

#40

I have a question, I consider myself a great software developer with a proven track record. I have open source code, lots of completed and shipped websites and software. Do interviewers really care about this sort of interview knowledge outside of the San Fransisco start up bubble? I've been programming and making a great living for more than 8 years now, and not once did I have to implement a b-list tree or somethin…

As I said here in https://news.ycombinator.com/item?id=6950242 :

    Similarly, effortless recall of the pros and cons of different
    algorithms and data-structures means that you don't have to think
    twice about many of the things that should be purely mechanical.
    It then lets you recognize things when they show up in disguise,
    and to concentrate on the higher level work, where the real work
    begins.
And here in https://news.ycombinator.com/item?id=6950235 :

    ... most real world programming jobs don't need in-depth knowledge
    of algorithms and data structures. Most real world programming jobs
    are implementing the algorithms devised by someone else, using data
    structures that are "obviously" the right structure for the job.
    When companies are asking these sorts of questions they usually have
    a somewhat inflated view of their own importance. Either that, or
    those interviewing have no real idea about the work done by their
    programmers.

    The very best interviewers, when using these questions, don't worry
    too much about the detail of the solution, but in the discussion of
    the pros, cons, benefits, drawbacks, and possible development of the
    code in context. Even with FizzBuzz there is much to be explored once
    a coder has written it.
When I'm hiring I care to know the strengths and weaknesses of the candidates, and that includes whether you know about algorithms, or not. Not knowing about them is a gap in your knowledge, but you have evidence of other skills. If you can actually get things done, that's a skill many don't share. Most people have gaps in their skills and abilities. That's not a problem.

But to answer your question directly, yes, some interviewers really care about this sort of interview knowledge outside of the San Francisco start up bubble.

Post reply on HN