Good Programmer vs Average Programmer - and, Why Asking questions and Paying attention to Details matters. 
Tags: programming, development, java, python
Published: 2019-10-19 07:08:23

---
title: Good Programmer vs Average Programmer - and, Why Asking questions and Paying attention to Details matters. 
published: true
description: How to find good programmers on interviews? It's all comes to down to paying attention to details and having a good think through abilities. 
tags: programming, development, java, python
cover_image: https://thepracticaldev.s3.amazonaws.com/i/to0fmcv78e6zszihg62u.jpg
---
*Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided in this article.*

When it comes to interviewing Programmers or Software Developers, the goal is to find the most suitable person for the job, but its easier said than done. In practice, it's very difficult to judge someone's caliber, experience, and expertise in a short duration of an Interview.

I know there is a process starting from the [phone interview](http://javarevisited.blogspot.sg/2015/02/50-programmer-phone-interview-questions-answers.html), [written tests](http://javarevisited.blogspot.sg/2016/06/design-vending-machine-in-java.html#axzz4sZVwtCgs), to a face-to-face interview, but it's still not easy to hire or find a good programmer.

The process can help you to filter candidates, but eventually, it will come down to your experience and gut feeling to find good programmers.

> *As you take more and more interviews, you will know what to ask and what not to ask and like many other interviewers in the world, you will develop some of your own tips to find right candidates.*

Similarly, I have also learned a couple of tips from my experience of interviewing many programmers, which have helped me to differentiate between an average programmer with a good programmer in the past.

Today I would like to share one of such tips with you guys to see if you agree with my observation or there is a flaw in my understanding, and hopefully, I can learn a couple of more [tips](https://dev.to/javinpaul/101-coding-problems-and-few-tips-to-crack-your-next-programming-interviews-402a) from you guys to find some good programmers in future.

[![](https://miro.medium.com/max/508/1*QOo2aPjPPKue03Gi7xL4aw.jpeg)](https://medium.com/better-programming/top-5-courses-to-learn-python-in-2018-best-of-lot-26644a99e7ec)

* * * * *

One of my most used tips is **finding gaps in requirements**. I have found and learned it over the time that ---

> Good developers have a knack of breaking requirements into pieces and finding gaps,

which is very important to produce quality software.

Though this skill mostly comes with experience, a [good developer](https://javarevisited.blogspot.com/2017/01/a-better-way-to-write-sql-queries.html), even with less experience, has this ability.

In this article, I will share an interview scenario to check what an average and a [good programmer](https://javarevisited.blogspot.com/2013/03/5-good-books-to-learn-spring-framework-mvc-java-programmer.html) will produce given the same requirement.

This is a **hypothetical interview** to demonstrate my tip, but it's very close to the real interview.

> *You can change the requirement based upon your domain, candidates' experience and domain expertise and job description. Key is to give one-line requirement to a candidate and compare the quality of the program developed by multiple programmers.*

In this scenario, I have used a very general requirement, which doesn't need any domain expertise, like finance, healthcare, or manufacturing, but requires some [programming](https://hackernoon.com/10-data-structure-algorithms-and-programming-courses-to-crack-any-coding-interview-e1c50b30b927) experience.

* * * * *

##Interviewer: Can you write a script to archive files older than 30 days and which can be run on 1st day of the month using a cron job?

Programmer 1 went on to code immediately and produced a script that does exactly what is in the requirement.

His script can find all files in a directory provided as input, can create an archive in the **same directory** with the provided name and backup date as a suffix.

**Looks good, right?**

But hold on something is missing :

1.  He did not exclude archive files created by script itself, which means in **next month script will also include last month's archive.** If you are not monitoring, you will only realize this problem when you need to retrieve something from the archive.
2.  **He did not think about two contradicting parts in this script, finding files older than 30 days and running it on the 1st of every month.** Since the script's objective here is to back up last month's data and month can be any of 28, 29, 30, or 31 days. So if you run this script on 1st march, it will not archive any files because all of them are less than 30 days old because February is usually 28 days long.
3.  His script was not removing files after archiving though this was not stated as part of the requirement; it's an implicit requirement until the interviewer specifically mentioned not to do so.

I agree he shouldn't assume anything, but at least he should clarify that with the interviewer. Even if he brings this point, I would have given him a brownie point for understanding the job in hand and bringing things that even the user has not thought about it at the time.

> ***This is the key difference between a good programmer and an average programmer***

[![](https://miro.medium.com/max/2191/1*agQTO4_2kacwtXJImNhcqQ.png)](https://medium.com/free-code-camp/these-are-the-best-free-courses-to-learn-data-structures-and-algorithms-in-depth-4d52f0d6b35a)

* * * * *

These are just some of the examples of missing requirements, but this case is quite common in real-world programming.

Many users give requirements like this, and experienced programmer knows that *"the* ***devil is always in details."*** Before doing anything, the first step is to understand the purpose and then think about what is missing.

Just like when you go to a doctor and says that you have some problem, he **asks a couple of questions to understand the problem better;** you should always ask questions to clear doubts, let the user know what is missing, etc.

> *Being an expert in the area of* [*software development*](https://javarevisited.blogspot.com/2019/01/10-web-development-frameworks-fullstack-developer-should-learn.html) *its your responsibility to get enough details so that product meets user expectation and can withstand test of time.*

I like to ask this kind of question, which is not very domain-specific and very general in nature. This gives not only an opportunity to gauge the candidate's expertise on any particular technology like [Perl](https://hackernoon.com/10-best-programming-languages-to-learn-in-2019-e5b05af4a972), [Python](https://medium.com/better-programming/top-5-courses-to-learn-python-in-2018-best-of-lot-26644a99e7ec), [Java](https://medium.com/javarevisited/10-free-courses-to-learn-java-in-2019-22d1f33a3915), or [Bash script](https://www.java67.com/2019/04/top-5-free-course-to-learn-bash-shell-scripting-linux.html) but also his overall thinking process.

Any developer who can think through and find gaps in requirements is going to be an asset for the team.

> BTW, like all the things, this is not always the case, and it's not a hard and fast rule, It's just another indicator, which can potentially help you to find good programmers.

* * * * *

Here are a couple of more examples to differentiate between an average programmer and a good programmer.

> One of the interesting tasks is to **ask the developer to write code to read a file; a** good programmer always asks questions about file content, like binary or text.

If text, then what is the encoding, while an average developer just writes the code to read a file.

A good developer will make sure to [close streams in the right way](http://javarevisited.blogspot.sg/2014/10/right-way-to-close-inputstream-file-resource-in-java.html) and release file descriptors (resources) while an average programmer will generally forget about that.

* * * * *

For developers and programmers, if you get these kinds of questions, where Interviewer ask you to do a real job, consider understanding requirement better and asking right questions.

Like in our previous question, you could have asked about all those missing requirements which surface when you start using your script.

Needless to mention, that second programmer ( good programmer) was a bit more intelligent and practical and was able to fill some of those gaps.

> *This tip has helped me in past but it's not a hard and fast rule to find good developers, in fact, there is no rule to find them.*

You just have to work through some indicator and your gut feeling. Let me know what the tips you guys are using to find good programmers on interviews are.

[![](https://miro.medium.com/max/500/0*9MhAF_OKd0jIm0LG.jpg)](https://dev.to/javinpaul/10-things-every-software-developer-should-know-39pe)

Here is a couple of more question for your practice :

###1) Write a wordwrap() function, which can take a String and break it based on screen size?

This was a real J2ME question, which I have faced when mobile devices are very small and don't have enough API support.

Since mobile phones or smartphones has varied screen sizes, wrapping words based upon screen size was a common task.

Though not stated, the goal here is to make this function work for every device. The function should consider line breaks, white spaces, font sizes, etc.

You can now use this question for [Android](https://www.udemy.com/complete-android-n-developer-course/) and [iOS](http://bit.ly/2AGMBbp) interview, as smartphone sizes are still not uniform.

###2) Write a function to replace a given character from a String in Java?

This is rather a simple question but asks him to write a production like code and then see if the candidate takes care of obvious things like null string, empty string, String contains all character which is there to replace, etc., here is the [sample solution](http://javarevisited.blogspot.sg/2015/04/how-to-remove-given-character-from.html) of this problem.

Here are some more popular Coding questions you can use:


1.  **How to design a Vending Machine? (**[**solution**](http://javarevisited.blogspot.sg/2016/06/design-vending-machine-in-java.html#axzz4sZVwtCgs)**)**
2.  **How to Check if a String is the rotation of another given String? (**[**solution**](http://www.java67.com/2017/07/string-rotation-in-java-write-program.html)**)**
3.  **How do you count the occurrence of a given character in a string? (**[**solution**](http://javarevisited.blogspot.sg/2012/12/how-to-count-occurrence-of-character-in-String.html)**)**
4.  **How do you print the first non-repeated character from a string? (**[**solution**](http://javarevisited.blogspot.sg/2014/03/3-ways-to-find-first-non-repeated-character-String-programming-problem.html)**)**
5.  **How do you convert a given String into int like the atoi()**? ([**solution**](https://javarevisited.blogspot.com/2011/08/convert-string-to-integer-to-string.html))
6.  **How do you implement a bucket sort algorithm? (**[**solution**](http://javarevisited.blogspot.sg/2017/01/bucket-sort-in-java-with-example.html)**)**
7.  **How do you implement a counting sort algorithm? (**[**solution**](http://www.java67.com/2017/06/counting-sort-in-java-example.html)**)**
8.  **How do you remove duplicates from an array in place? (**[**solution**](http://javarevisited.blogspot.com/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)**)**
9.  **How do you reverse an array in place in Java? (**[**solution**](http://javarevisited.blogspot.com/2013/03/how-to-reverse-array-in-java-int-String-array-example.html)**)**
10. **How are duplicates removed from an array without using any library? (**[**solution**](http://javarevisited.blogspot.sg/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)**)**
11. **How is a radix sort algorithm implemented? (**[**solution**](http://www.java67.com/2018/03/how-to-implement-radix-sort-in-java.html)**)**
12. **How do you swap two numbers without using the third variable? (**[**solution**](http://www.java67.com/2015/08/how-to-swap-two-integers-without-using.html)**)**
13. **How do you check if two rectangles overlap with each other? (**[**solution**](http://javarevisited.blogspot.sg/2016/10/how-to-check-if-two-rectangle-overlap-in-java-algorithm.html)**)**
14. **How do you design a vending machine? (**[**solution**](http://javarevisited.blogspot.sg/2016/06/design-vending-machine-in-java.html)**)**
15. **How do you find the missing number in a given integer array of 1 to 101? (**[**solution**](http://javarevisited.blogspot.com/2014/11/how-to-find-missing-number-on-integer-array-java.html)**)**
16. **How do you find the duplicate number on a given integer array? (**[**solution**](http://javarevisited.blogspot.com/2014/01/how-to-remove-duplicates-from-array-java-without-collection-API.html)**)**
17. **How do you find duplicate numbers in an array if it contains multiple duplicates? (**[**solution**](http://javarevisited.blogspot.com/2014/03/3-ways-to-find-first-non-repeated-character-String-programming-problem.html)**)**
18. **Difference between a stable and unstable sorting algorithm?** ([answer](https://javarevisited.blogspot.com/2017/06/difference-between-stable-and-unstable-algorithm.html))
19. **How is an iterative quicksort algorithm implemented? (**[**solution**](http://javarevisited.blogspot.sg/2016/09/iterative-quicksort-example-in-java-without-recursion.html#axzz5ArdIFI7y)**)**
20. **How do you find the largest and smallest number in an unsorted integer array? (**[**solution**](http://java67.blogspot.com/2014/02/how-to-find-largest-and-smallest-number-array-in-java.html)**)**

If you need more questions or if you are a programmer preparing for interviews, You can check out the [**Coding Interview BootCamp**](http://bit.ly/2AGl35U) course or [Gayle Laakmann McDowell](https://medium.com/u/e21bc4f4525e)'s classic [Cracking the Coding Interview](http://www.amazon.com/Cracking-Coding-Interview-6th-Edition/dp/0984782850/?tag=javamysqlanta-20) book, one of my personal favorite for quick review and initial screening of candidates.

[![](https://miro.medium.com/max/438/0*wRHUPag0oTJjtinc.jpeg)](http://www.amazon.com/Cracking-Coding-Interview-6th-Edition/dp/0984782850/?tag=javamysqlanta-20)

That's all about this **tip to differentiate an average programmer with a good programmer.** As I said, this is just one of the several points many Interviewer looks on a candidate; for programmers, It's an opportunity to show their **think through ability** and how good they are in understanding requirements and finding gaps. If you want to become a good programmer, you can also read these ten [tips](http://javarevisited.blogspot.sg/2014/01/10-tips-to-improve-programming-skill-become-better-programmer.html) and these ten [articles](http://javarevisited.blogspot.sg/2014/05/10-articles-every-programmer-must-read.html).

**Further Learning**
[Data Structures and Algorithms: Deep Dive Using Java](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fdata-structures-and-algorithms-deep-dive-using-java%2F)
[10 Books to Prepare Technical Programming/Coding Job Interviews](http://www.java67.com/2017/06/10-books-to-prepare-technical-coding-job-interviews.html)
[10 Algorithm Books Every Programmer Should Read](http://www.java67.com/2015/09/top-10-algorithm-books-every-programmer-read-learn.html)
[Top 5 Data Structure and Algorithm Books for Java Developers](http://javarevisited.blogspot.sg/2016/05/5-free-data-structure-and-algorithm-books-in-java.html#axzz4uXETWjmV)
[From 0 to 1: Data Structures & Algorithms in Java](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Ffrom-0-to-1-data-structures%2F)
[Data Structure and Algorithms Analysis --- Job Interview](https://click.linksynergy.com/fs-bin/click?id=JVFxdTr9V80&subid=0&offerid=323058.1&type=10&tmpid=14538&RD_PARM1=https%3A%2F%2Fwww.udemy.com%2Fdata-structure-and-algorithms-analysis%2F)
[20+ String based coding problems from interviews](https://dev.to/javinpaul/top-20-string-coding-problems-from-programming-job-interviews-493m)\
[20+ linked list problems from interviews](https://hackernoon.com/top-20-linked-list-coding-problems-from-programming-job-interviews-756d4a2bf652)
[20+ basic algorithms based problems from interviews](https://hackernoon.com/top-20-searching-and-sorting-algorithms-interview-questions-5a476121fd0f)

[](https://dev.to/javinpaul/101-coding-problems-and-few-tips-to-crack-your-next-programming-interviews-402a#closing-notes)

##Closing Notes
Thanks, You made it to the end of the article ... Good luck with your programming interview! It's certainly not going to be easy, but just paying attention to details and askin good question can make a lot of difference. 

If you need some more practice questions then you can also check out these additional [**50 programming questions**](http://javarevisited.blogspot.sg/2015/02/50-programmer-phone-interview-questions-answers.html) for [telephone interviews](http://www.java67.com/2015/03/top-40-core-java-interview-questions-answers-telephonic-round.html) and these [books](http://javarevisited.blogspot.sg/2016/06/top-5-books-for-programming-coding-interviews-best.html) and [courses](http://javarevisited.blogspot.sg/2018/02/10-courses-to-prepare-for-programming-job-interviews.html) for more thorough preparation.

All the best for your coding interview.