Advice on Working Through the Book


#1

I just got the EPI book and I am starting to work through it. What is the general recommended approach to working through each question? Should I read the entire chapter including the solution and then try to implement the solution from memory? Should I just read the bootcamp section and then try implement a solution for a while before looking at the solution? Should I just read the chapter and type in the solution? I am unsure what the most effective way to study this book is.


#2

Short answer - Read Chapter 1 (Getting Ready). It presents multiple paths through the book.

Long answer - Depends how much time you have. With unlimited time, the ideal would be:

For each chapter:

  1. Read bootcamp section
  2. Read problem description without looking at solution or hint
  3. Attempt problem
  4. Run out of ideas
  5. Read hint
  6. Attempt problem again
  7. Run out of ideas
  8. Read, understand, and restate or implement from memory the brute force approach presented in first part of the solution
  9. Attempt problem again
  10. Run out of ideas
  11. Read, understand, and restate or implement from memory the optimal approach presented in remainder of solution
  12. Attempt variant
  13. Run out of ideas
  14. Search forum for solution or post question.
  15. Return to 12 till all variants are done.
  16. Return to 1 till all chapters are done.

Use your best judgment to modify this approach according to your needs.


#3

Thanks! That was exactly the advice I was looking for.


#4

Something I left out - tests.

If you have the time to do so, validate your solutions with thorough automated tests.

For the non-variant questions, you may either write your own or use the EPIJudge. For variant questions, you have no choice but to write your own, or use those shared by someone else.

I write all my own tests because, (1) before I have a solution, the test cases I come up with give me concrete examples to use to get started exploring the problem, and (2) once I have a solution, brain-storming test cases often reveal non-obvious ones that cause me to revisit and improve the solution, and (3) I don’t have a time-constraint and want to squeeze as much learning as possible out of the process. Mine can be found here.


#5

Another thing - I actually find it very useful to have about 5-10 problems (each one from a different chapter) in progress at the same time. This approach ends up increasing the total amount of time I spend on a problem before I finally run out of ideas. Because when I run out of ideas on one problem I simply move on to the next problem, then double back to the first one when I’ve cycled through all the other in-progress problems. The time away from the initial problem usually gives me fresh perspective and new ideas to try out. This increases the probability of my solving it without looking at either the hint or the solution. I’ve turned it into kind of a game, where my goal is to maximize the number of different approaches to any given problem before I admit defeat.