Get Ready For Interviews With These Books

Cracking the Coding Interview and Elements of Programming Interview

Iván Alberto Aguilar Castillo
7 min readAug 7, 2021

Hello again!, how I mentioned in pass blogs, I have been reading the book Cracking the Coding Interview, and this weeks I had the opportunity to read Elements of Programming Interview. In general, both are books with the purpose to help the reader to be prepared for interviews in the area of programming. I recommend these books to anyone who is close to take an interview and wants to be ready or have some guidance on what to expect.

Cracking the Coding Interview main focuses are algorithms, coding and design questions, Elements of Programming Interviews have the same focuses, it touches data structures, algorithms, system design, and problem solving, both consists on explanations about computer science subjects and provide different problems with solutions so the readers can practice before a real interview. Besides that, these books are filled with advices in order to help you to have a successful interview.

For this blog, instead of talking about what you can find in these books, I want to focus more on all the things that I learned from them, with nothing more to say, I hope you enjoy reading!

Tips for a successful interview

It is very normal to feel nervous in an interview, no matter how prepared you are, when we have an interview problem the solution may not occur to you immediately. Here are some of the tips that I could collect from both books:

  • If you did not understand something, clarify the question: Probably this is obvious for some people, but others tend to think that asking for clarifying will reduce their chances to get the job. There is no harm in asking, the interviewer could give valuable clues. For example, a good way to obtain more information is asking what time and space complexity the solution should have.
  • Explain all the solutions: For my interview I chose a problem that has an obvious brute-force solution with the objective that the interviewee figured out a more sophisticated solution. A good strategy in a interview is to try all the possible solutions and look the advantages of each one, this could help you explore opportunities for optimization and hence reach a better solution, the interviewer will see that you know what are you doing.
  • Think out loud: Is not a good idea to stay quiet in an interview. Try to always explain your thought process, this increases your chances of finding the right solution and the interview will be able to guide you to the right direction.
  • Present a clean solution: If you are working on a interview problem, ask what are the valid inputs, it is a good practice to check if inputs are valid. Another good idea is to do tests for different cases, maybe your solution is good for valid inputs, but probably will crash with invalid ones; and pay attention to your syntax, try to write the most clean code that you can, with the bests practices and that can be easy for the interviewer to read.

Is good to have in consideration the above advices, but an interview not only consist in writing code, the interviewer will make an assessment of your performance.

Areas to qualify

These are some of the usually common areas that the interviewers considerate (according to Cracking the Coding Interview), it is probable that the company where you want to work considerer different skills.

  • Analytical skills: Did you need much help solving the problem? How optimal was your solution? How long did it take you to arrive at a solution? If you had to design/architect a new solution, did you structure the problem well and think through the tradeoffs of different decisions?
  • Coding skills: Were you able to successfully translate your algorithm to reasonable code? Was it clean and well-organized? Did you think about potential errors? Did you use good style?
  • Technical knowledge/ Computer Science fundamentals: Do you have a strong foundation in computer science and the relevant technologies?
  • Experience: Have you made good technical decisions in the past? Have you built interesting, challenging projects? Have you shown drive, initiative, and other important factors?
  • Culture fit/ Communication skills: Do your personality and values fit with the company and team? Did you communicate well with your interviewer?

A personal recommendations is that if you have the opportunity to practice with someone and receive feedback, take advantage of it so you can see what are the areas in which you need to improve; maybe you are super good writing code and you do not have any issue with complex problems (coding skills), but it is difficult for you to explain your ideas or communicate with others (culture fit).

Communication is important

And speaking of communications, the books have chapters where they do a lot emphasis on how important the communication is, specially if we are talking about an interview for a job where team work is the daily bread.

Remember to always prepare before an interview, and I mean mentality and physical prepare, don’t let simple mistakes lead you to a bad interview. It is important to sleep and eat well before your big day, otherwise, you can say things that you don’t really want if you are not at you 100%.

When the interviewer ask you a question, try to be specific and not arrogant. Arrogance is considered a red flag, specifics answers are the way. Give your interviewer just the fact and let him to derive an interpretation.

Here are techniques for structure your answers, you can use them together or separated:

  • Nugget First: Means starting your response with a “nugget” that succinctly describes what your response will be about. Whit this you can grab your interviewer’s attention and makes it very clear what your story will be about.
  • S.A.R. (Situation, Action, Result): The S.A.R. approach means that you start off outlining the situation, then explaining the actions you took, and lastly, describing the result. Use clear situations, actions and results so your interviewer will be able to easily identify how you made an impact and why it mattered.

A little checklist of tips

  1. Be honest: You should be ready to defend all the question your interviewer ask related to your resume. Speak with honestly, nobody wants a colleague that claims to have knowledge with a technology and by the end results that he did not know anything. Dishonesty in an interview is a fast pass to an early exit.
  2. Keep a positive spirit: This may be difficult for some people, but try to have a cheerful and optimistic attitude, everyone loves to work with positive people.
  3. Don’t apologize: Many interviewees tend to apologize for not knowing something, believe in yourself! if you cannot, don’t expect to others to believe in you.
  4. Keep money and perks out of the interview: It is best left the money discussion after an offer is made.
  5. Appearance: Most of the actual software companies have no problem with dress-code, but in order to prevent damage in your interview, try to not dress too casual, and always be clean and well-groomed.
  6. Be aware of your body language: Be aware on your posture, eye contact and handshake, and of course, remember to smile.

There are so many other advices that you can find in theses books, topics like stress interviews, negotiating an offer or conducting an interview, I invited you to give them an eye in you are interested.

Computer science

Elements of Programming Interviews has a chapter where they describe approaches to solving programming problems. A phrase that I like from this chapter was:

developing problem solving skills is like learning to play a musical instrument — books and teachers can point you in the right direction, but only your hard work will take you there.

I agree with those words, how I said in latest blogs, this phase I work hard solving different programming problems, this practice really helped me to increase my skills as a programmer, and for sure I want to keep practicing and learning more.

I also did a review to many computer science subjects while reading Cracking the Coding interview, some of the topics I could improve were:

  • Arrays and Strings: Arrays are a collection of items stored at contiguous memory location, for store multiple items of the same type together. Makes easier to calculate the position of each element by simply adding an offset to a base value. Something important to notice is that a String is basically an array of characters.
  • Linked Lists: Unlike an array, a linked list consists of nodes where each node contains a data field and a reference (link) to the next node in the list. Keep in mind that a linked list does not provide constant time access to a particular “index” within the list. This means that if you’d like to find the Kth element in the list, you will need to iterate through K elements.
  • Stacks and Queues: Important to have in mind the differences of both, a stack uses LIFO (last-in first-out) ordering. That is, as in a stack of dinner plates, the most recent item added to the stack is the first item to be removed, and a queue implements FIFO (first-in first-out) ordering. As in a line or queue at a ticket stand, items are removed from the data structure in the same order that they are added.
  • Trees and Graphs: A tree is a nonlinear hierarchical data structure that consist of nodes connected by edges. Tree data structures allow quicker and easier access to the data as it is a non-linear data structure, and a graph, in short words is simply a collection of nodes with edges between (some of) them, both can be used for different situations.
  • Recursion and Dynamic Programming: I actually already talk of this in a last blog, recursion algorithms can be a very sophisticated way to solve problems, but be careful, this solutions can be very space inefficient, that is why dynamic programming exists.

And like these subjects, there are so many others like Bit Manipulation, Math and Logic Puzzles or Object-Oriented Design, this made me think on how many things I still need to learn, but also I feel inspired and with energy to keep learning more and more.

Thank you for reading and I hope you liked my blog, have a nice day and see you the next time!

--

--

Iván Alberto Aguilar Castillo

Software Engineer, responsible, friendly and self-taught, with hungry to learn new things.