99% of software engineers can’t answer these questions
Welcome to the Software Design Quiz! You are about to go through 5 questions where you will have to identify what aspect of some code snippet is bad, or can be improved. But be warned: even for the simple questions, the answers are shockingly deep.
"How is it possible to create a multiple-choice software design quiz with a single right answer?"
Good question. It’s true that software design is an area where everything is made of tradeoffs and “it depends.” But an expert can list exactly the things that “it depends” on, and explain the consequences and tradeoffs of each decision.
We’ve adjusted the questions here over many rounds of feedback to make one answer unambiguously the best after understanding all the issues, even if there are benefits to some of the other answers. Also, for most questions, the hard part is figuring out the possible improvements, not recognizing which improvement is best. We’ve worked to write the answers at just the right level of vagueness so that you’re forced to figure things out yourself, but once you've done so, it’s still clear which answer to choose.
"Is it true that only 1% of people can’t get these?"
Okay, we exaggerated. We believe that fewer than that will be able to come up with all the solutions and explanations themselves. But, in the multiple choice format, around 3% get a perfect score. As some backing data: in one test, only 2 out of 90 respondents on Reddit suggested the right approach for one of the questions here (given in open-ended format). But we’ve also given that question as a pretest for our Advanced Software Design Course, and seen correct answers range between 20% and 60%. We don’t know a good way to get an unbiased sample over all developers. But the point is that this quiz is meant to be very hard. And it’s not even the hardest things we have to teach; just the ones we managed to put into a multiple-choice quiz.
Each answer comes with a good appendix. But we always welcome feedback not already addressed, which you can send to [email protected].
Because the things in this quiz transcend languages, we’ve prepared two versions, Java and TypeScript. Pick whichever is more comfortable for you. The two versions are almost identical.