There are a variety of things that most paying participants received feedback on. Here are some of the most common ones, including those that are going to inhibit your progress on Level 2.
Pass Functional and Valgrind Checks
If you’re not passing all functional tests, your code will likely not work for level 2. If you’re not passing valgrind checks, your code’s performance will likely be extremely poor relative to what it could be, if it doesn’t outright thrash your system to the point of having to reboot.
Also, make sure that if you turned off compiling with warnings for some reason that you turn those back on. Warnings nearly always catch future bugs and enforce a level of quality in your code. The economic market for low quality, high performance code worldwide is exactly $0, which is one of the reasons why this is enforced for paying participants (in that, if they have compiler warnings I refuse to review it). Consider it an upskill to write code that doesn’t result in gcc or g++ warnings, because it very much is.
Be Careful with Worst Case Time Complexity
In linked_list.h I mentioned that you could add additional members to the linked list structure. Many people did not, and that resulted in poorer quality code.
In particular, linked_list_size() can be done by adding a ‘size_t size’ member to the struct, and adding at the end of the linked list can be done in constant time with a tail pointer. You can achieve this without making a doubly linked list, with a single change
Generally, try to reduce the worst cast time complexity of all your implementations, even if it means adding a tiny memory footprint (in this case 16 bytes on the Raspberry Pi 4B with the OS I have running on it). Get in the habit of thinking about what operations are common, because common operations need to be fast.
Level 2 implements a queue using linked list code and inserts nodes at the end. There is zero chance of having a performant piece of software if your linked list doesn’t do this. There are cases where your queue will have 20,000,000 elements in it, all pushed to the end of the queue. This means you’re going to have to do 400,000,000,000,000 iterations through that list to add that last element, which means you’ll be waiting days for your code to finish.
Code Quality
A lack of comments throughout the code was a general trend among the more junior participants in the competition. Don’t do that. Get in the habit of writing comments, because code without comments is low quality code. At the very least, copy and paste the comments about each function from linked_list.h and append them to the function definitions in linked_list.c. If you’re doing something non-obvious, explain why in the comments. Your future self will thank you for it, not because you’ll forget, but because skills like this get junior engineers promoted faster. One of the easiest ways to spot code written by a junior engineer is a lack of comments, especially when the constraint was given that this is a “high performance, high quality, C or C++ coding challenge”.
Use this competition to push yourself to write high quality code, so you can internalize those habits and upskill yourself!