Top 40 Java and Linux Interview Questions Answers for IT Support Engineers

Hello guys, if you are going for a Java support engineer interview and looking for some frequently asked questions then you have come to the right place. I have shared many posts about Java interview questions in the past but nothing, particularly from the support engineer perspective. Since there are a lot of L1 and L2 support job that exists in BFSI (Banking, Finance, and Insurance Industry) and they are also for the longer term, I decided to write this post. In this article, I will share questions to help with technical aspects like the essential skills you need to clear a support engineer interview.
When you go for a support engineer role, especially for Java application be it to core Java or Java EE application, the interviewer expects you to know the basics of Java and can start/stop the application, see log files, alert developers, and other aspects of the support like opening conference bridge to solve production issues, communicating to stakeholders, and involving right peoples. 

Even though you will be interviewed to support Java applications, it's expected from you to know SQL, UNIX/Linux, Bash, Debugging, and other key technologies that you will use in your day-to-day job. In this post, you will find questions that are asked to check whether a candidate has the required skills to support Java application or not.

By the way, if you are new in the Technical world, you may now know that Google offers Google IT Support Professional Certification on Coursera, which can be used to learn all the skills required to become a Support Engineer in any IT organization, including Google. You can use this program to launch your career in IT and become job-ready in 3-6 months without any degree or prior experience. 

40 Java and Linux Interview Questions for IT Support Engineers

Here is my collection of some of the best interview questions for Java and JEE support professionals. If you are working in production services or supporting Java applications, these interview questions will help you to do well in your interview. If you moving from development to support role then also these questions will give you a good idea about what is expected from a Java JEE support engineer.

1. Java Interview Questions for IT Support Engineers

Now that you are familiar with some Linux questions from Java interviews, it's time to deep dive into core skills and explores frequently asked Java questions for IT support engineers. These are mostly related to how to run, debug, and upgrade Java applications as Technical support's main job is to run the application, development is done by developers.

1.  What do -Xmx and -Xms parameters mean?
These are parameters to specify heap size in Java. The -Xms defines the size of the heap when JVM starts up and -Xmx is used to specify the maximum heap size for Java application i.e. your heap cannot grow beyond that and JVM will die by throwing OutOfMemoryError if your heap doesn't have enough space to create new objects. See here to learn more about heap memory in Java.

2.  What is the difference between JVM and JRE?
The JRE stands for Java Runtime Environment and JVM stands for Java Virtual Machine. You install JRE to run Java applications e.g. Applet or Core Java application or Web server like Tomcat. The JVM is part of JRE. See here to learn more differences between JVM and JRE.

What is the difference between JVM and JRE?

3.  What is the difference between JVM and JIT? (answer)
The JVM stands for Java Virtual machine while JIT stands for Just in time Compiler. The JIT is part of JVM and is used to convert the Java bytecode into native machine code which runs faster. There is some threshold set if code runs more than the threshold it becomes the candidate of just in time compilation by JIT.

4. How do you take the heap dump of a Java process? 
There are many ways to take the heap dump of a Java process e.g. Tomcat, but most common is by using tools available in JDK e.g. jVisualVM, jCmd, and jmap. Here is the command you can use to take the heap dump of the Java process:

$ jmap -dump:live, file=/location/of/heap_dump.hprof  PID

The heap dump will contain all live objects and they are stored in heap_dump.hprof file. Remember, you also need the PID of the Java process which you can find by using the "ps" and "grep" commands as discussed in the first question. 

You can further see Java Application Performance and Memory Management course by Matt Greecroft to learn more about taking and analyzing heap dump in Java to find memory leaks and other memory-related errors. 

best course to learn Java memory management

5.  How do you take a thread dump of a Java process?
Taking a thread dump is easier than taking a heap dump because you don't need to remember the tool. In Linux, you can just use the kill command to take the thread dump e.g.

$ kill -3 PID 

will print the thread dump in the log file or where System.out is redirected. Similarly, in Windows, you can use Ctrl + Break from the command prompt. Alternatively, you can also use jConsole and VisualVM to take the thread dump of Java applications in both Windows and Linux. 

You can also see these advanced JVM internal and monitoring courses to learn more about thread dump and heap dump.

6. What is OutOfMemoryError in Java? How do you deal with that?
The Java virtual machine throws java.lang.OutOfMemoryError when there is not enough memory to run the application e.g. no more memory to create new objects, no more memory to create new threads, etc. The most common OutOfMemoryError is java.lang.OutOfMemoryError: Java heap space, which comes when there is no more memory left to create a new object.

7. What is the difference between 32-bit and 64-bit JVM? (answer)
The main differences between 32-bit and 64-bit JVM are that later is designed for a 64-bit operating system like Windows 8 or later versions of Linux. From a Java developer's perspective, the main difference between them comes from heap size. 

A 64-bit JVM virtually has unlimited heap memory as compared to 4GB of the theoretical limit of 32-bit JVM. If your program needs more memory, better run it on 64-bit JVM with a large heap space. See here to learn more about 32-bit and 64-bit JVM.

8. What is the Garbage Collector? (answer)
The garbage collector is a component of the Java virtual machine which is responsible for reclaiming memory from dead objects. It's one of the key components and allows an application developer to focus on application development rather than doing memory management. Some of the popular garbage collectors are a Concurrent Mark-Sweep garbage collector and a G1 garbage collector in recent times.

9. How do you analyze a heap dump?
There are many tools to analyze heap dump in Java like you can use the jhat tool which comes along with JDK. You can also use Eclipse Memory Analyzer to analyze the heap dump to find out any memory leak in Java while dealing with OutOfMemoryError in Java. See Java Performance The Definitive Guide By Scott Oaks to learn more about analyzing Java Heap dump.

Java and JEE Interview Questions and answers

10. What is the difference between a Web Server and an Application Server? (answer)
The main difference between Web and Application Server comes from the fact that you cannot run EJB on the Web server like Tomcat or Jetty. The application server like WebLogic and WebSphere provides the runtime environment for EJB and other advanced services required by Java EE or J2EE specification.

11. What is JDBC?
The JDBC stands for Java Database connectivity and it provides API to connect a database from Java programs. Different Java vendors e.g. MySQL, Oracle, Microsoft SQL Server, PostgreSQL they implement the API and provides their driver implementation to allow Java to connect to their database. Since almost every enterprise application has a database, JDBC is very important for any real-world project.

12. What is the difference between JDBC and JNDI?
As I said in the previous answer, the JDBC stands for Java Database Connectivity and provides APIs and guidelines to connect a database from Java, while JNDI stands for Java Naming and Directory Interface and provides a logical structure for retrieving resources e.g. database, messaging queues, enterprise Java beans without knowing their physical places like host or port.

You can register a resource with JNDI and then the rest of your application component can access them using the JNDI name. The database connection pool is the most common resource accessed via JNDI in web servers like Tomcat or WebLogic.

13. What is the database connection pool? (answer)
As its name suggests, it is just a pool of database connections. Since creating a new database connection in real-time is an expensive process and can potentially slow down the response time, many application maintains a pool of active database connection. 

When a request comes in they retrieve a connection from the pool, get the data from the database, and then return the connection back to the pool so that it can be reused. This way, response time is improved in most Java web applications. See here to set up a database connection pool in Tomcat using the Spring framework.

14. Your Java application is connected to a Database via a connection pool. Suddenly your database goes down? Is that an issue with your Java application? Do you need to restart your Java application?

hint: Since your Java application is using a connection pool, it has active connections to the database which will get disconnected once DB goes down. If you try to execute a query, you will receive Socket errors.

15. What is the difference between HTTP and HTTPS? (answer)
This is one of the common and easy questions. Of course, you know the difference between HTTP and HTTPS right? well, HTTP is insecure but HTTPS is secure, the extra "s" is for security, which means it not only encode and encrypt the message before sending but also verify the identity of the server by using  SSL certificates provided by global certificate authorities e.g. GoDaddy, Thawte, VeriSign, DigiCert, GeoTrust, and Comodo.  See here to learn more about how SSL and Certifications work in Java web applications.

16. What is the difference between the GET and POST methods? (answer)
Another simple but frequently asked question on Java support interviews. The main difference between the GET and POST is that GET is both idempotent and safe but POST is not. You can send a GET request multiple times and it will give the same result but multiple POST submissions should always be avoided. GET is also used to read data from the server and POST is used to send data to the server.

17. What is the difference between Servlet and JSP? (answer)
This is another interesting Java JEE support Interview Question. Even though both Servlet and JSP are used to create dynamic HTML the key difference between them is their purpose. Servlet is meant for Java developers and you write more Java than HTML and that's why it serves as Controller in many popular MVC frameworks e.g. DispatcherServlet in Spring MVC.

On the other hand, JSP is designed for HTML developers and it's more HTML than Java and that's why it is used as a "view" in MVC frameworks like Spring and Struts. See the link in the answer for a more detailed comparison.

18.  What is the difference between Struts and Spring MVC?
This is again a popular and frequently asked question on Java JEE Interviews. Even though both are popular web MVC frameworks for Java applications, the key difference is that Spring brings dependency injection first and Struts brings it later using Struts 2.0.

Spring is also a suite of libraries e.g. you get Spring Security to implement security in your application, then there is Spring Boot, Spring Data, Spring Cloud, and many more useful libraries under the Spring umbrella. 

By the way, if you are new to the Spring framework then I highly recommend you go through the Spring 5: Beginner to Guru course by John Thompson on Udemy to learn Spring Framework in depth. It's a very in-demand skill and investing your time and money is worth it. 

Java JEE Support Interview Questions

19. What is the difference between JDBC and Hibernate? (answer)
There are many differences between JDBC and Hibernate but the most important one is that JDBC provides an API to connect to the database and execute the query but Hibernate is an ORM (Object Relational modeling) framework, which means it allows you to work with objects while it takes care of saving and retrieving object from the database.

In short, in JDBC you need to write SQL queries to get and store data from the database but in Hibernate you just deal with objects, Hibernate takes care of issuing SQL queries to the database.

20. What is the difference between Stack memory and heap? Which one is faster? (answer)
These are just two different memory areas used to store different kinds of variables. The stack is local to every thread while heap memory is shared among all threads. Since Stack is closer to thread and usually implemented using CPU registers they are faster than heap memory

The stack is used to store local variables as well as method call frames while the heap is used to store objects and class metadata. See the detailed answer for more points.

Here is a nice diagram which explains difference between Stack and Heap memory in Java:

ifference between Stack and Heap memory in Java

21. What is the difference between TCP/IP and UDP protocol? (answer)
There are several differences between TCP and UDP protocol but the most important of them is that TCP provides a guarantee of message delivery while UDP doesn't give any guarantee. Because of this guarantee TCP sends more messages than UDP and hence consumes more bandwidth and is slower than UDP. TCP is also a connection-oriented protocol while UDP is connectionless. 

See the detailed answer for more points. And, if you want to learn TCP/IP and in a general computer network, better then you can also check out Introduction to Computer Networks for Non-Techies on Udemy. 

Java Support Engineer Interview Questions

2. Java Debugging and Troubleshooting Interview Questions 

So far, we have seen both Linux and Java questions, and it's time to check on some debugging and troubleshooting questions. This is actually a very important skill as you need to work through problems in your day-to-day job. If a process crashes or does not respond or gives bad data you need to know where to check and what to do. 

1. Your Java application is connecting to another Java application (server) running on the remote host and listening on port 17865. Now, you don't have access to that remote host to go and see if the process is running. How do you find if the server is up and running?
hint: you can use the telnet command

2. Your application gets data from them to the distribution to clients? One client complains that the request for data is taking too long and it's almost like hung? How do you troubleshoot this problem?

hint: check the log, check database, check the file system

3. The Java application you support connects to a database via a DNS, which automatically switches to the secondary database server when the primary goes down. Do you find that in the event of a failover, your Java application is not connecting to the secondary DB server? How do you troubleshoot this problem?

hint: check which version your Java application is running. Some JRE caches the DNS e.g. JRE 1.6

Java J2EE Interview Questions

4. What is deadlock? How do you find if your Java program has a deadlock? (answer)
A deadlock is a condition that can occur between two or multiple threads. In this case, each of the threads waits for each other and cannot progress. In Java, this usually happens when thread 1 holds the lock required by thread 2 and thread 2 holds the lock required by thread 1. 

If your Java program is hung then it could be a deadlock. You can take a thread dump and find out if any thread is waiting for the lock held by others and vice-versa. You can also use jConsole tool to find deadlock.

5. What is the race condition? (answer)
The race condition is another multithreading and concurrency bug which happens due to racing between two threads, for example, if one thread is updating a variable and the second thread tries to read the value before it is finished. You can avoid race conditions by properly synchronizing your code.

6. What is the difference between PATH and CLASSPATH? (answer)
Both are key environmental variables used by the Java platform, but the key difference between them is that PATH points to the JDK binaries or native libraries e.g. java.exe, while CLASSPATH points to Java binaries like JAR files, which contains bytecode. PATH is also a system-level concept independent of Java but CLASSPATH is purely a Java concept and is used by JVM to load classes required by the Java application you are running.

7. How do you find the Java version used by your application? (answer)
You can run the java -version command in the command prompt to find out the version of Java used by your application. If you have multiple JDK or JRE installed then make sure you use the one which is used by your application.

8. What is the JAVA_HOME environment variable? (answer)
The JAVA_HOME is nothing but a user-defined environment variable which points to the installation directory of JDK. For example, if you have installed JDK in /opt/jdk_1.6_20 in Linux then the JAVA_HOME variable will point to this directory. The same goes for Windows or any other operating system.

3. Linux Interview Questions for Java Support Engineers

The most important skill for any IT support engineer is a good knowledge of operating systems and command lines. Since most of the server-side applications run on Linux, you must spend some time brushing up your Linux skills before you go for an interview. Here are the Linux command interview questions you can check to brush up on some of your knowledge.

1. How do you send a web service request from Linux? (answer)
There are some commands available in Linux e.g. curl and wget which allow you to send HTTP commands, which you can use to call and test your web services from Linux. Particularly, Curl is used extensively to test RESTful Web Services because it can send POST requests, GET requests, request with headers, and also authenticate using both basic and digest authentication.

If you are working with REST API, I suggest learning curl, it's very convenient to check if your API is working properly using curl from the command line. You can even write a script to automate those stuff. 

2. How do you check how much memory and CPU your Java process is consuming?
First, you need to find the PID of your process, which you can find by using the "ps" command as shown in the previous question. Once you find the PID you can use the "top" command to find the CPU and memory usage. Alternatively, you can also use the prstat command as shown here.

3. What is the difference between Apache httpd and Tomcat?
Though both httpd and Tomcat are products of the Apache software foundation, the httpd is more popular and used across the web and not just in the Java world. The httpd is a web server that can serve static HTML files and dynamic content using PHP, Perl, or Python, while Tomcat is a Servlet container that provides the runtime environment for Servlet and JSP. You can also use both Apache httpd and Tomcat together in Java world.

4. Can you use Apache and Tomcat together?
Yes, you can use Apache and Tomcat together. There are many Java web application which is fronted by Apache webserver to deliver static resources e.g. HTML files, images, configuration files, etc. You can then configure Apache to forward the request to Tomcat.

5. How do you start and stop Tomcat in Linux?
When you install Tomcat in Linux by unzipping the downloaded package, you can see that there is a and file in the tomcat/bin directory. These scripts are used to start and stop Tomcat in Linux. These scripts internally call, the main script to start the Tomcat engine.

6. How do you start and stop Apache in Linux?
The Apache server runs as httpd daemon in Linux and you can either use kill command after finding the PID of the httpd process as shown here or you can use the apachectl script as shown below to start and stop the Apache web server in Linux

Starting Apache web server in Linux

$ apachectl start

Stopping Apache web server in Linux

$ apachectl stop

Restarting Apache web server in Linux

$ apachectl restart
/sbin/service httpd restart

You might need root access to do if the Apache web server is not running on your application account.

7.  How do you check your Java process is running on Linux? (example)
You can check by using the "ps" command and "grep" command like ps -ef | grep "myprocess". The keyword which you use with grep for search can be anything unique to your process, something which appears in its command line e.g. name of the class which implements the main method. You can also do "ps -ef | grep java" to list all Java processes.

And, if you are new to Linux, I highly recommend you to join a comprehensive Linux course like Linux Mastery: Master the Linux Command Line in 11.5 Hours course on Udemy to learn all essential Linux commands and concepts. I highly recommend this course to anyone who has to work in Linux machines. 

best course to learn Linux for support engineers

That's all about 40 questions from Java JEE Support Engineer. It's just a small set of questions you can expect in any service-based company or investment bank but does remember to prepare key skills required for support engineers e.g. UNIX, SQL, Java, and others. In the next part of this article, I will share some of the frequently asked questions from the Java Support Engineer on SQL, UNIX, and other supporting technologies.

Other topic-based Java Interview questions for more practice
  • 21 Java Inheritance Interview Questions and Answers (list)
  • 15 Data Structure and Algorithm Questions from Java Interviews (read here)
  • Top 10 Spring Framework Interview Questions with Answers (see here)
  • Top 20 Hibernate Interview Questions and Answers (list)
  • 21 String Algorithms Coding Problems (string questions)
  • 10 JDBC Interview Questions for Java Programmers (questions)
  • 20+ Binary Tree-based coding problems (tree questions)
  • 15 Java NIO and Networking Interview Questions with Answers (see here)
  • 20 Java Design Pattern Questions asked on Interviews (see here)
  • 10 Struts Interview Questions for Java developers (list)
  • 20 Spring Boot Interview Questions in Java (spring boot questions)
  • 30 OOP Interview Questions with Answer (see)
  • 19 Method overloading and overriding interview questions (see here)
  • 20+ Spring MVC Interview Questions (spring questions)
  • 10 frequently asked Servlet Interview Questions with Answers (see here)
  • 15 Java Enum based interview questions with answers (read)
  • 10 Oracle Interview Questions for Java developers (see here)
  • Top 10 JSP Questions  from J2EE Interviews (read here)
  • 12 Good RESTful Web Services Questions from Interviews (read here)
  • Top 10 EJB Interview Questions and Answers (see here)
  • Top 10 JMS and MQ Series Interview Questions and Answers (list)
  • 10 Hibernate Interview Questions for Java EE developers (see here)
  • 21 Final modifier interview questions with answer (read)
  • 10 XML Interview Questions for Java Programmers (read here)
  • Top 10 XSLT Interview Questions with Answers (read more)
  • Top 10 Trick Java Interview Questions and Answers (see here)
  • Top 40 Core Java Phone Interview Questions with Answers (list)

This list of Java interview questions for Java, JEE, and J2EE support engineers should be enough to prepare for any Java interview. You can crack both fresher and experience-level interviews by preparing these Java interview questions, at least the first few rounds. If you face any other interesting question which is not on this list, then please let me know via comments and I'll add it.

P. S. - If you are new to the Java world and looking for free online courses to learn Java then you can also check out this list of free Java courses for beginners to start your Java programming journey for FREE, online by yourself. 

1 comment:

  1. Questions 10, 11 and 12 are missing for some reazon?


Feel free to comment, ask questions if you have any doubt.