Since I’d previously worked through a couple of video courses on Udemy and liked them, I thought I’d try one designed to help people prepare for coding interviews: 11 Essential Coding Interview Questions + Coding Exercises! by YK Sugi.
The curriculum consists mainly of two hours of video divided into several topics:
- Introduction and Problem Solving Tips
- Two-Dimensional Arrays
- Linked Lists and Trees
During the introduction, the instructor outlines how he chose the coding exercises to include in his course: they are representative of the topics most often discussed among people preparing for interviews, and they vary in difficulty.
He also explains his system for rating the degree of difficulty. Each problem is clearly labelled with one, two, or three asterisks (*). Problems marked with one asterisk are easier, three are the most difficult, and two indicate a moderate challenge.
In practice, I didn’t find this rating system necessary. But I must admit it was a good feeling to attempt a (Difficulty = ***) problem and come up with a working solution on the first try, even if that solution proved far less elegant than the one provided.
The instructor devotes the rest of the section to a brief explanation of what a coding interview is often like, as well as three problem-solving techniques to keep in mind during an interview. While the information presented here can be found elsewhere for free, it makes sense for the course and is delivered in a concise manner.
The Coding Exercises
The next four sections of the curriculum arrange the coding exercises by topic, with two or three exercises in each. A video outlining the problem to be solved begins each exercise. These videos are succinct and clear in what’s required.
Sometimes the instructor briefly reviews concepts that some students might have forgotten, such as how a binary search tree differs from a binary tree.
Each problem includes two links to pages with starter code, one in Java and the other in Python, where students can implement their solutions and test them in a browser.
While I chose to use an IDE to develop my solutions, I didn’t know Udemy offered this kind of functionality, and I liked its inclusion in the course. I used these links as a final test for each of my solutions, and the server executed the code as expected.
It’s worth taking a look at the starter code for each exercise even when using an IDE to work on a solution. Not only does the code supply a decent set of test cases, it often includes an import statement that acts as a clue as to what data structure might be useful in solving the problem.
For example, the Arrays section starts with a problem where students must identify the item in an array that appears the most number of times. The starter Java code includes a HashMap import statement, but never takes advantage of it.
Since using a HashMap is a good approach to the problem, the instructor clearly intended its inclusion to point students in a good direction, while leaving it up to students to leverage such hints into workable solutions.
Each exercise concludes with one or two videos where the instructor explains how he would implement a solution, including links to source code in Java and Python that students can download and examine.
In nearly every case, I found his solutions concise and elegant. The only possible exception might be his answer to an exercise where the contents of a 2D array must be rotated 90 degrees by modifying the existing array, rather than creating a new one and returning it.
While a perfectly viable solution, I had already found one elsewhere that made more sense to me. Stack Overflow user Jack gives an extremely thorough explanation of how to do this here.
Overall, I really liked this course. I appreciated its sharp focus on a subset of coding exercises from a few key topics, and they were all fun to work on. The instructor constantly reinforces this focus through his concise presentation of the material.
While I was able to come up with my own solution for nearly every exercise, in most cases, they were clunky compared to the provided solutions. This course taught me some new techniques I feel would be useful in approaching other problems.
I do have one small nitpick. The starter Java code for finding the lowest common ancestor in a binary tree has a small bug that causes a NullPointerException if pasted into an IDE and run. However, it’s easy to track down in a debugger and fix.
Rating: 4.5 out of 5