Logo

dev-resources.site

for different kinds of informations.

How to NOT Create Leetcode Challenges

Published at
12/9/2024
Categories
leetcode
challenge
Author
mosbat
Categories
2 categories in total
leetcode
open
challenge
open
Author
6 person written this
mosbat
open
How to NOT Create Leetcode Challenges

I've been solving Leetcode challenges for over a year or so; I noticed that there is a great number of challenges that Devs are avoiding or failing to solve due to the challenge's quality.

Then, Leetcode tries to push those challenges to us via "Daily challenge" which frustrates a lot of people that Leetcode is trying hard to push Devs to do challenges that are poorly written.

Some red flags to recognize about a poorly written challenge:

Low Acceptance Rate

Image description

A challenge is not meant to be "Unsolvable". Leetcode challenges should aim to help Devs solve the challenges or have higher acceptance rate of submissions.

Poor Description

Image description

One of the worst things is poor description that leaves the Dev trying to guess what is being asked or very few test cases at the beginning that do not really help the Dev understand the core requirements.

I've often found myself writing a solution just to find myself being slapped by the test cases and adjusting/changing my code not because my solution is poor but because the description/requirements were not clearly communicated in the challenge.

So in this sense, if you spent 20 minutes writing a solution based on the description and you find yourself spending another 20 minutes adjusting your code, you easily lost 40 minutes.

Author's Solution or The High-way

Image description

What's worse than a poor description, is when the authors are forcing you to use their solution and accepting their solution as the "Ideal" or perfect solution. Most of those solutions fail several metrics such as readability and use lots of hackish techniques to squeeze few milliseconds when a more clearer solution with the same time complexity could have achieved the same result relatively; but they often place their time limits based on those hackish solutions.

In essence, time limits have become a tool that is abused by the authors to force Devs to accept/adopt their solutions instead of focusing on correctness, readability, etc... .

Time complexity should be the proper measure instead of how many milliseconds the solution takes (yep, hard coding here is still bad!). There are plenty of ways/tools in which they can spot the time complexity since there is already a built-in AI tool in Leetcode that does this so why not utilize it instead of hard coding time limits?!

If the author wants us to write an efficient solution, the focus shouldn't be on writing complicated unreadable solutions to prove how good they are at solving challenges but rather, focus on helping Devs solve the challenge with the desired time complexity without straining them or exhausting them with guessing and puzzles.

Ideally, what time complexity the challenge is solved with should be up to the Dev writing the solution while letting them also think for themselves on how to solve the challenge with better time complexity since Leetcode by default always will show the Dev the comparison chart against other solutions in terms of both time in milliseconds and memory usage.

How to Improve Challenges

Image description

The moment you think or believe that you want the Dev to "Learn" an algorithm or a technique, you need to ask yourself the question, in real life, at a company, are you going to dictate to your teammates how to write their code or solutions? If the answer is no, then by no means you should dictate in Leetcode how a solution is written; instead you should give the Dev a pathway to explore other paths without crippling them with strict test cases and TLEs (Time Limit Exceeded).

The difficulty of the challenge shouldn't be measured in how difficult is the description, or how much guessing the Dev has to do to figure out the solution but rather the difficulty should be in achieving the correct result of a complicated problem that might occur in real life.

If you adopt the above firmware (or mindset), you will be able to write more meaningful Leetcode challenges.

Maybe you can argue that on job interview, the challenges are quite often unfair, unclear and poorly communicated; this is a valid argument but then comes the question whether or not it's worth even working in such a toxic environment that is hell bent on making you feel hopeless or naive instead. That is a different problem and shouldn't be Leetcode's concern to make the challenges as poorly made as those on some job interviews.

Image description

A poor challenge or coding task on a job interview reflects on disorganized team and/or toxic environment which you shouldn't be in, in the first place!

What are your thoughts, please do share!

challenge Article's
30 articles in total
Favicon
🎯 9 Must-Have Skills for AI/ML Engineers
Favicon
Thoughs on Codingame 2024 Winter challenge
Favicon
I am currently reducing at least 22 proofs by at least 99312 steps total.
Favicon
Can anyone suggest me the best resources to crack TCS Hackquest 2025?
Favicon
Frontend Challenge: December Edition
Favicon
Auto Horizon Developer Challenge: Innovate with AI-Powered dApps πŸš€
Favicon
Auto Horizon Developer Challenge: Innovate with AI-Powered dApps πŸš€ Build super dApps & AI agent PoCs with Autonomys Auto SDK! 🌟 Compete for prizes, gain recognition, and showcase your innovation. πŸ“… Timeline: [Insert Dates] πŸ‘‰ Register now: https://foru
Favicon
Is URLdn Better Than Bitly for a ShortΒ Link?
Favicon
Is URLdn Better Than Bitly for a ShortΒ Link?
Favicon
What are the common challenges in managing fixed assets and how can they be addressed
Favicon
DR20+ Challenge
Favicon
How we used gpt-4o for image detection with 350 very similar, single image classes.
Favicon
Solving Word Cookies Puzzles: A Python Adventure
Favicon
I made an URL shortener
Favicon
JavaScriptmas 2024 - Week 4
Favicon
There will be much less room for improvement soon.
Favicon
In Quest of Clarity : The Methodical Madness Behind Research
Favicon
Securing the Future: Cloud Adoption Challenges for Government Agencies
Favicon
How to NOT Create Leetcode Challenges
Favicon
Codepen October Challenge: Halloween Edition with WebDataRocks
Favicon
Join Virtual Coffee in New Year, New Goal: Setting One Big Goal and Achieving It!
Favicon
First flutter app for marathon training
Favicon
Tackling fundamental logic: A very hard automated deduction challenge (free for all)
Favicon
Go Create Pac-Man in One Day!
Favicon
I’m hosting a game jam!
Favicon
Calculator Backend-API In Go
Favicon
The Real Life Problem. Beyond Programming.
Favicon
#TerraWeekChallenge Day 2:
Favicon
Devops Open source project Task
Favicon
Linux Administration Tasks with Use Cases

Featured ones: