1. Where did you learn how to implement the Data Structures and Algorithms?
2. Also, I'm in a dilemma between using Python and C/C++. Which one would you suggest?
1. Where did you learn how to implement the Data Structures and Algorithms?
2. Also, I'm in a dilemma between using Python and C/C++. Which one would you suggest?
1. There's lots of great books out there, and resources online. Learn what the interface of a given data structure is, and then go and try to implement it yourself in any way possible, then look up solutions for how it's typically done. Just code a lot! And learn what Big-O Notation is about, analyze your own solutions.
2. Both. It doesn't matter. Java is popular at Amazon, if that's your goal. Look, there's learning a programming language and there's learning to program, and these are different skills that complement each other. You will need to learn a new language a dozen times in your career, so just learn a few different ones right now and then focus on being a good programmer instead of a good C++ programmer.
If you don't know the concepts/data structures, just read more about them, either on the internet or from a book. The internet is usually sufficient for most things but if you want to go more in depth, CLRS is the book that most people recommend. I haven't read it personally. Don't feel bad if you can't answer the questions, a lot of it is practice, and if you don't know the concepts beforehand it's better that you just read the solutions.
1.) I learned in school 2.) It doesn't really matter, just use the one you're more comfortable with. If you're equally comfortable, I'd recommend Python because you're going to be writing on the whiteboard and I imagine C/C++ is more verbose, so you'll waste more time writing. Your hand might also get tired.
You can also go on careercup.com to get more questions after you're finished with the book so you can practice.
CLRS is a good reference if you want to look up some canonical algorithm and read the accompanying discussion. It is a terrible way to learn if you're not combining it with something more explanatory, like a professor. It's an extremely dense wall of pseudocode and proofs.
Kleinberg and Tardos is a little handwavy with its mathematical proofs, but does an excellent job of motivating the examples, holding your hand and explaining why the next step is next, etc.
It is not, however, a survey of the canonical algorithms and data structures. You will not learn how to balance or invert a binary tree. (My algorithms class was based on K&T, and while I learned a ton, I don't feel I learned how to pass a whiteboard interview). More of an introduction to algorithmic thought, with algorithms selected for their pedagogical value.
You sound unlucky, so here's what you do: implement each one you are unfamiliar with in your favorite language and analyze the complexity of them. Start with linked list algorithms, then stacks/queues, then maybe heapsort and trees then implement Dijkstra's graph algorithm and BFS / DFS.
If you're not getting practice enough, pick up a good textbook on data structures and algorithms that does contains only pseudocode (or that's in a language you don't use), and try writing their algorithms in a language that you know.
2. Both Python and C/C++ are good languages, but for very different things.
Python is superb for glue code: bringing together modules from multiple sources.
C/C++ is superb for writing individual components that need to work as quickly as possible.
I'd recommend that you learn Python first, then C/C++.
Good luck!
1. Introduction to Algorithms/CLRS (~The~ algorithms book) https://mitpress.mit.edu/books/introduction-algorithms
Also, Skiena's "Algorithm Design Manual" for something a bit lighter.
2. I chose to use Python when possible for technical interviews, as it allowed me to focus more on the algorithms/solution, rather than boilerplate. I rarely use Python in my actual job, but I still prefer it for interviews.
Typically CS degrees would offer a course on this to give a starting point as well as the books and vocabulary to learn further.
Mostly? 1st year undergrad.
> 2. Also, I'm in a dilemma between using Python and C/C++. Which one would you suggest?
I like Python as a quick-to-write language (whiteboard friendly), but in my most recent interview, some of the questions were phrased to make them easier to implement in C (i.e. more natural to write in terms of pointer access, IMO). I think the answer really depends on the company and what they usually work in.
How common is this? I did my (EE) undergrad I Florida, which has pretty extensive Gen Ed requirements. Almost nobody takes major courses in their first year.