Get the book, "Cracking The Coding Interview." It was the most valuable resource for me in preparing for technical interviews near the end of my time in undergrad.
Yes, I bought it last week.
But, couldn't answer through the questions because I didn't know the concepts and DS's. Could you answer these 2 questions?
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?
I'd be more worried that in 3rd year of a CS undergrad you don't know how to implement data structures and algorithms.
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.
Not the person you're asking but I previously passed the interview at Amazon.
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.
CLRS is a huge tome. I have no idea why it's always recommended as an introduction to algorithms. It seems like it has the breadth, if not the depth, of TAOCP in terms of being a perennially recommended work that no one actually reads all of the way through.
1. Freshman year there was a data structures and algorithms course. These remained important through my university career.
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.
1. If you're a third-year CS student, you should already be getting lots of practice in implementing data structures. If you're not, complain to your professors. They're giving you a terrible education.
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++.
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.
> 1. Where did you learn how to implement the Data Structures and Algorithms?
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.
We had flexibility in our schedules (CA state school). I mixed major and GE courses throughout my years in college. CS courses rarely had GE requirements, unless you count math.
There is a book by tamassia on this subject that I quite like, there are specific versions for Java, Python, and (I think) c++ also.
The less experienced you, the more I would recommend Python over c++.
Recently I interviewed at AWS at amazon for a SDE position and got an offer too.
I used Python for all my DS and Algo problems. It purely depends on your comfort level with the language.