Are all versions of Elements of Programming Interviews created equal?

Saw this from some Amazon reviews of the Python version of EPI: > The coding style in many cases is just... bad. The authors often use wonky Python tricks at the cost of readability and simplicity. For example, their definition of a BST search is a *one-line* nested ternary conditional (chapter 14, page 202). I sanity-checked with a friend who does interviews, and he said he would DOCK points for style if a candidate tried to pull something like that. In addition, the explanations in many sections are just confusingly worded. And sometimes, the presented solution is completely unintuitive or badly styled - like using global variables instead of passing parameters. > The authors mention that the code solutions are "Pythonic". However, this is not the case. In fact a lot of the code in this book seems to be written by someone who doesn't seem to grasp pedagogy. See the solution for string to int: def string_to_int(s): return functools.reduce(lamba running_sum, c: running_sum * 10 + string.digits.index(c), s[s[0]] == '-', 0) * (-1 if s[0] == '-' else 1) Are you kidding me? How is this solution even remotely pedagogical, or even an acceptable solution in a coding interview? --- That sounds pretty bad. Are the Java or C++ versions any better? I'm hoping at least the C++ one is since it's OG. If not then might as well skip EPI and focus on LC.

Neo Media World fiveFigure Jul 13, 2021

can find some pdf online

Esri klokov_v3 Jul 13, 2021

The C++ one has style issues as well.

Intuit Maynarde Jul 13, 2021

Bang on. This was my major gripe with the book. Too much emphasis on making the code extremely concise at the cost of readability. I don't really understand why this book gets so much hype.

Getaround BlindSux2 OP Jul 13, 2021

Guess it was a bigger deal before Leetcode came out, when problem sets + explanations was just limited to CTCI (which also suffers from forcing conciseness at the expense of clarity in some explanations imo) and GeeksforGeeks (which has very inconsistent explanation quality).