Writing code? Have you checked enough sample inputs? 🤔💭
When someone gives me any coding question, the first step I do is to understand and analyze the problem. Then comes the most important (according to me 😜) step, checking out enough examples.
Going through some sample inputs and coming up with more examples sure helps you a lot to understand the problem well, and moreover, it gives you a clear way to how many cases your code should handle, and what all can be the possible output or output range. 😁
Here's what I generally do 🧐
👉 Take very simple examples and find the output 💆♂
👉 Take more complex and bigger inputs to see what will be the output, how many use cases do we want 👨💻
Time to handle the edge cases
👉 Try out problem with no input, what should be the output now 😵
👉 Try out problem with invalid input, what should be the output now 🤔
Don't you think the same can be done while performing unit tests in software development too? 💭
How much importance do you give to the examples? 😁
Just create an issue with the title "Interview Discussion Day 16: My Views" and add your views in the description