Dynamic Programming for Coding Interviews: A Bottom-Up approach to problem solving
Dynamic Programming for Coding Interviews: A Bottom-Up approach to problem solving book cover

Dynamic Programming for Coding Interviews: A Bottom-Up approach to problem solving

Paperback – January 16, 2017

Price
$8.93
Format
Paperback
Pages
142
Publisher
Notion Press
Publication Date
ISBN-13
978-1946556691
Dimensions
6 x 0.32 x 9 inches
Weight
7 ounces

Description

"This is one of the best books on Dynamic Programming." - Gaurav Sehgal, Engineering Manager, Amazon. DP is one of the most complex problem solving approaches in computer science. At the same time, benefits that DP provide are huge, it usually reduces the time taken from exponential to polynomial. So getting it right is very important.In most algorithm books, there is one chapter dedicated to DP, that discuss related concepts like optimal substructure, overlapping sub-problems, memoization, etc. And then there are few complex examples to showcase working of DP.The approach we have followed in this book is that we have one chapter for each concept. And while discussing the concepts, we have taken very simple examples, so that focus remains on the concept. Once the concept is understood, we deep dive into complex problem solving. Kamal Rawat is a software developer, trainer, author and an entrepreneur. He has first-hand experience of implementing full life cycle of large scale desktop, Cloud and Mobile applications across various domains and platforms. He had been a technical architect in complex projects like Microsoft OneNote, Adobe Photoshop and Samsung GalaxyConnect. He has also been in the core interview panel of Microsoft, Adobe and many start-ups. Since 2006, he is coaching students on how to crack programming interviews. Before leaving his job to pursue his passion full-time, Kamal was working as Senior SDE at Microsoft. Meenakshi hold master's degree in Computer science. She left her job and co-founded Ritambhara Technologies (www.ritambhara.in). She maintains an amazing work-life balance, wearing multiple hats, be it head of a technical start-up, a certified yoga trainer or mother to two kids at home. Problem-solving and optimizing comes naturally to her. Read more

Features & Highlights

  • I wanted to compute 80th term of the Fibonacci series. I wrote the rampant recursive function, int fib(int n){ return (1==n
  • 2==n) ? 1 : fib(n-1) + fib(n-2); } and waited for the result. I wait… and wait… and wait… With an 8GB RAM and an Intel i5 CPU, why is it taking so long? I terminated the process and tried computing the 40th term. It took about a second. I put a check and was shocked to find that the above recursive function was called 204,668,309 times while computing the 40th term. More than 200 million times? Is it reporting function calls or scam of some government? The Dynamic Programming solution computes 100th Fibonacci term in less than fraction of a second, with a single function call, taking linear time and constant extra memory. A recursive solution, usually, neither pass all test cases in a coding competition, nor does it impress the interviewer in an interview of company like Google, Microsoft, etc. The most difficult questions asked in competitions and interviews, are from dynamic programming. This book takes Dynamic Programming head-on. It first explain the concepts with simple examples and then deep dives into complex DP problems.

Customer Reviews

Rating Breakdown

★★★★★
30%
(62)
★★★★
25%
(51)
★★★
15%
(31)
★★
7%
(14)
23%
(47)

Most Helpful Reviews

✓ Verified Purchase

A book for only solutions to some common DP problems- doesnt help you think.

Conclusion - Not a good book.
Why ? Even though it has solutions to some of the most common and known dynamic programming questions, and discusses the basics of how dynamic programming is different than recursive or brute force strategies, it doesn't help us understand how to come up with those solutions. It doesn't give us pointers on why a particular problem was solved the way it was. It discusses the solution, but not how to come up with it.

For more initiated, read the solved example on Longest Common Subsequence, and then read the solved example of Longest Palindromic Subsequence from the book. You will understand what I am referring to here. They are closely related problems, and yet, if you look at the code for the second problem, you wont understand why did we do this way.
15 people found this helpful
✓ Verified Purchase

The basics of Dynammic Programming written in a really broken English..

I guess the book's contents would be OK for people new to programming. No one is going to get their job at Google or Facebook because of what they read here, though.

This would have made the book be rated 3 stars but I cannot simply ignore that I paid 10 bucks for a book written in broken English. It's not a typo here or there, the authors show no clue of when to use articles when constructing a phrase. This amounts to having pretty much every sentence in the book syntactically incorrect..
2 people found this helpful
✓ Verified Purchase

Average

I have mixed feelings about this book. It has some good bits. Like very clear explanations of when to use dynamic programming. I also felt the chapter on the role of different parts of the memory when a code is being executed. But the solutions of the example problems lack full explanation. In every example, they begin with the top down recursive solution and then they jump to how the solution can be computed iteratively bottom up. But transitioning your thought process from top down algorithm to construction of bottom up algorithm is not straightforward, specially for the beginner. The reader has to do that thinking themselves largely and the authors do not do a good job at helping the reader through that thought process. On the upside, it makes the reader a better thinker and problem solver. On the downside, why should the reader read the book then instead of just trying to solve these problems from scratch as they are easily available on the internet.
1 people found this helpful
✓ Verified Purchase

A must read for interview preparation!!

This book explains the basics of dynamic programming in easy and simple way. Author has a thorough understanding of the concepts and knows how to explain it in an effective manner. It starts with detailed explanation of recursion including how memory looks for a recursive solution and why it is an overhead, followed by how we can achieve optimization by using memoization and dynamic programming. There are different types of practice questions with detailed solution as well.
1 people found this helpful
✓ Verified Purchase

Great 4 Point System

Yes it gives examples, but the most valuable thing is giving a clear, 4 point system to solve all DP problems.

Really puts things into perspective and clarifies how to best approach these problems in a concrete (rather than vague) way.
1 people found this helpful
✓ Verified Purchase

Love the book

Love the book! I had a recent interview with a top technology company and I was stuck on some questions that involved dynamic programming. I am determined to master the skills that were asked on the interview so I invested in this book. I love how simply they break down the topics. I have way more confidence in learning to think recursively and build on recursive solutions so they are space and time efficient. I am using this book also in conjunction with 'Think Recursively With Java.' with these two books, and a lot of practice, I am confident I can crush any programming interview.
1 people found this helpful
✓ Verified Purchase

Good book overall... has a few typos...

Good book with good problems but there are a number of typos.

page 51- i and j are switched, no?
page 74- "code 8.6 takes exponential time, O(n^3)- shouldn't it be O(3^n)?

These are some of the mistakes I remember... and I still have a few problems to go through.

Overall, buy it as a way to learn dynamic programming quickly and prepare for interviews.
1 people found this helpful
✓ Verified Purchase

Best book on Dynamic Programming

The topics are explained simply and this really helped me to understand top-down recursion and bottom-up DP. This is a great book for beginners because it does not hit you with crazy formulas like the college text books do. The authors are great teachers, they seem to understand the point of view of the student. Nice illustrations, step by step strategy, actually enjoyable to read. Thank you!!
1 people found this helpful
✓ Verified Purchase

Simple to understand complex topic.

Nice simplified book, easy to understand.
1 people found this helpful
✓ Verified Purchase

overall satisfied

This book covers Dynamic Programming, Recursion and an overview of execution or recursive programs in the Operating System and many good examples with solutions. The examples are not so original but having them all together as a bunch is useful.
1 people found this helpful