An interview is just a test.
Whenever I speak with students/new grads about interviewing I actually specifically advise them that an interview is not a test. Yes, you need to have a certain level of base skills, but beyond that, an interview is much more like a date than a test. I say this because you can do everything right and still be rejected. It doesn’t mean that you did anything wrong or there’s anything with wrong with you, but rather there just wasn’t a match between you and the company you were interviewing with at that point in time. There are so many factors entirely outside of your control that determine if you’re given an offer or are rejected to the point that I find it really tough to consider it a “test” in the academic sense where you need to score a certain value to pass or fail it.
Likewise, it’s incredibly common for students/new grads to focus heavily on the technical skills while completely ignoring the soft skills. The best thing you can do in an interview is make the interviewer like you and want to work with you. It’s amazing how many people will overlook subpar technical skills either consciously or subconsciously if they feel comfortable with you (the amount of borderline incompetent people I’ve seen hired that are otherwise smooth talkers is astounding). It seems like the author of the linked to article here might be falling into that trap too. He writes about his technical experience heavily but does not touch on the soft skills at all, even questioning at one point that he may simply be bad at interviewing which is a strong sign to me that he’s not presenting himself well in the interview.
This is something that transcends software engineering. If you’re a sociable and likeable person you’ll go far further in life than the person that is quietly a genius but doesn’t work well with others. I wish more people folks in this industry would focus on that side of the coin instead of simply saying “grind Leetcode more to get more offers.”
The only real answer here is talk to an actual lawyer rather than a bunch of Joe Blows on the internet. Case in point: Laws will vary depending on country and you haven’t specified what country you’re in. The set of laws you’re subject to are possibly entirely different than the set of laws each commenter here is familiar with. Never take legal advice from the internet.
But if you’re only looking to publish the source code as a resume item, it’s not worth the legal exposure or time/money to talk to a lawyer. Find something else to write and put on your resume.