Before starting your job search, look at these common Java interview questions asked during real interviews and understand the answers, but instead of memorizing the answers try to complete further research and come with your own personal solution for the interview question. The more prepared you are for what you will encounter, the more successful you will be. This collection of Java interview question could be also useful for software developers who need to interview Java developer.

How To Decipher GitHub Resume

Here is what I look for in a candidate’s GitHub account that I treat as resume:

  • Recent, meaningful commits. I particularly like small incremental features or fixes with good code and tests, accepted into someone else’s open-source repositories.
  • Your own projects. Is the code clean, easy to read and commented appropriately.
  • Account depth and width - I want to find how and when you got started on Github and how you’ve used it since.
  • I am less concerned with what the project exactly does, but more concerned that the project was developed professionally.
  • There should be a test harness and the tests should pass.
  • I want to see that the person understands basic design patterns.

Here’s what the candidate should avoid having in GitHub account:

  • the same coding tutorials as everyone else in your graduating class
  • a bunch unmodified forks of common open-source projects
  • dense two-three weeks period of activity usually tells that candidate prepared a public-facing project to impress potential interviewers

If you don't have any work on GitHub, what does that say to people considering you as a developer?

GitHub is your Software Developer Resume

Internet is full of advices on how to perform greatly during an interview. Be passionate and show your passion, and your skills. It does not matter if you think it is not important, or even if you think that the interviewer is completely not interested. The interviewee still have to leave a sign, an impression.

Show the code! It is the only way to make sure you and the interviewer are actually on the same line. Show them what you can develop, by showing your open source code. Contribute to open source projects!

You may think it was not so important, but when it comes to hiring, some companies take a GitHub commit log over a best software developer resume. Using open-source software contributions in general, and GitHub profiles in particular, as a hiring filter is great thing for IT industry.

”GitHub

Open source code communicates just how interested the candidate is in the job. That they are willing to go above-and-beyond to demonstrate their passion. The candidates show that the sort of things they’re interested in working on are largely aligned with what we’re trying to do.
The interviewer can get a sense for what the code quality is like and how the candidate wishes to portray herself.

GitHub profile displays three things: how strong you are, how easily you can be persuaded into constantly working and how passion you are.

Make Github your great software developer resume!

Git interview questions

Git interview questions is not very well defined topic and some hiring managers think that it is better to focus on candidate’s programming and critical thinking skills, assuming if Java software developer has those he can pick up Git tricks in a couple days with a help of decent Git book or tutorial. Another group thinks that if someone have never used a source code management system, that's a negative indicator for doing things the right way and most likely this software developer survived under a very remote rock for some time.

Anyway the recommendation is to spend several minutes on discussing the revision control and source code management systems.

git interview questions

Let’s take a look on Git interview question which have a high frequency of being asked in interviews and should help to identify whether software developer is capable of figuring out the concepts involved in version control systems

Open-ended Git interview questions on revision control and source code management theory:

  • What is Git?
  • Explain the difference between Git and Subversion?
  • Why is Git better than SVN? Is it really better? 
  • What are the disadvantages and advantages between centralized version control system and distributed version control system?
  • What is best Git book or tutorial for the beginner?
  • What is SHA-1?

A few practical Git interview questions, some of them require a precise answer:

  • What is the best Git GUI client for Linux, Windows or Mac OS X?
  • Do you use Git aliases? What is your favourite Git alias? 
  • What command you would use to get a copy of an existing Git repository?
  • How do you get the latest code?
  • How do you check out code?
  • How do you commit changes?
  • What's the difference between git pull and git fetch commands?
  • Have you ever merged anyones patches into your repository
  • When would you commit your changes to your local repository? 
  • Are you on Bitbucket, GitHub? If so, what are some examples of repos you follow? Can we see your code?

I wouldn't spend much time on these questions, but the answers might still give hiring manager an idea of how the software developer would work when combining his code with the rest of the team.

Related Best Git Books





Java interview questions: GET vs POST?

Recommending a specific list of java interview questions for an interview is a risky business. Experienced Java developers have different view what is reasonable and what is not reasonable to ask. At the same time Junior Java Developers may find that the following Java interview question is fair and reasonable.

What is the difference between the HTML methods GET and POST?

GET and POST methods are used as the way for sending HTML form data to the server. The fundamental difference between GET and POST so that GET appends the parameters to the URL, while the latter means that the form data is to appear within a message body. A good basic rule is when the application sends the form data it should be using POST. If the application are just running search queries then GET could be more appropriate for implementation.

I am absolutely correct, every Java developer should expect this question and provide the correct answer.

Java interview question: Fibonacci Numbers

Assessing Java Developer technical skill level is a quite difficult thing when interviewer only has limited time. The solution would be to give a candidate a chance to demonstrate Java development experience by coding problem that requires writing a short, straightforward function. The ideal interview questions for interviewing not only Java Developer with 2 years of experience, but any Java Developer would be implementation of function which returns the n-th number in Fibonacci numbers with an input n.

Fibonacci numbers are defined as:

Java interview question: Fibonacci Numbers

There are two ways to develop Fibonacci sequence function: recursion or iteration. Here is the solution with recursion which return first 12 Fibonacci numbers. I strongly believe that a slow candidate should be able to produce an answer in five minutes or less.

 static long Fibonacci (int n) {
       return n == 0 ? 0 : (n == 1 ? 1 : (Fibonacci (n - 1) + Fibonacci(n - 2)));
 }

 public static void main ( String[] args ) {
       for ( int f = 0; f < 12; f++ ) {
           System.out.print ( Fibonacci (f) + ", " );
       }
       System.out.println ( Fibonacci (12) );
   }

What if some Senior Java Developer with 10 years of experience refuses to code Fibonacci Series explaining that it is not a question that implies on any practical experience and can be easily memorized. In this case you have no choice and ask the candidate one more time or add the candidate to do not no hire list. Do you really want to work with developer, who will tell you from time to time that assigned problems are below developer's skill and experience.

Java Interview Question 10: Swap the values of two variables without using third variable

Have you already come across a situation where you need to swap the values of two variables without using third variable? I bet it was during an fresher interview for Java Developer position. As an interviewee you can think that it is a poorly chosen interview question and the only person who can answer this questions is the one who knows the trick in advance. I’m agree in some ways it is tough question, but it fits for purpose of evaluating Java developer’s analytical skills and problem solving abilities.

Generally speaking to swap two variables values, we need to define a third variable:

temp=a;
a=b;
b=temp;

The generic answer on "swap the values of two variables without using third variable" questions is

a = a operation b
b = a inverse-operation b
a = a inverse-operation b

For example, the developer could write the following Java code
a = a + b; 
b = a - b; 
a = a - b;

Keep in mind that not all operations have an inverse that is well defined for all values that the operation is defined, for example * and / work until a or b is equal 0.

This tricky Java interview question can really catch beginner Java Developer of guard, especially if fresher mind is set to come up with straightforward answers. The way beginner Java Developer answers this question says a lot about interviewee thinking ability and is a great way to show off creativity and analytical skills.

Java Collections Interview Questions

Java Collections interview questions - there are an experienced developers who believe there is no need to memorize core elements of Java Collections Framework - interfaces, implementations and algorithms. These Java developers wrongly assume that if the programmer can google interview questions, there is not point to remember the answer and correct answers on these Java collections interview questions proves nothing. In some ways these developers are correct, the most important thing for Java developer, is that developer could think, not memorize. In my opinion, the interviewer have to ask question about Java Collections to know if the candidate could demonstrate a basic understanding of the most common data structures. For example, the hiring manager could use a few quick questions during phone screening interview. Once again, it would be enough to ask junior Java developer question like "What is HashMap and Map?", while Java Collections interview question for experienced developers may sounds like "When would you use a vector versus a linked list?".