I have got shared many posts virtually Java interview enquiry inwards the yesteryear but nothing, peculiarly for back upwards engineer perspective. Since at that spot are a lot of L1 together with L2 back upwards task exists inwards BFSI (Banking, Finance, together with Insurance Industry) together with they are also for the longer term, I decided to write this post. When yous move for a back upwards engineer role, especially for Java application move it to heart Java or Java EE application, Interviewer expects yous know basics of Java together with tin start/stop the application, run across log files, alarm developers, together with other aspects of the back upwards e.g. opening conference couplet to solve production issues, communicating to stakeholders, together with involving correct peoples. In this article, I volition portion questions to aid amongst technical aspects e.g. the essential skills yous demand to clear a back upwards engineer interview.
Even though yous volition move interviewed to back upwards Java application, it's expected from yous to know SQL, UNIX, XML together with other fundamental technologies which yous volition utilization inwards your day-to-day job. In this post, yous volition notice questions which are asked to depository fiscal establishment friction match whether a candidate has required skills to back upwards Java application or not.
1) How do yous depository fiscal establishment friction match your Java procedure is running on Linux? (example)
You tin depository fiscal establishment friction match yesteryear using "ps" ascendence together with "grep" ascendence e.g. ps -ef | grep "myprocess". The keyword which yous utilization amongst grep for search tin move anything unique to your process, something which appears inwards its ascendence describe e.g. mention of the flat which implements the chief method. You tin also do "ps -ef | grep java" to listing all Java process.
2) How do yous depository fiscal establishment friction match how much retentiveness together with CPU your Java procedure is consuming?
First, yous demand to notice the PID of your process, which yous tin notice yesteryear using the "ps" ascendence every bit shown inwards the previous question. Once yous notice the PID yous tin utilization the "top" ascendence to notice the CPU together with retentiveness usage. Alternatively, yous tin also utilization the prstat ascendence every bit shown here.
3) What does -Xmx together with -Xms parameters mean?
These are parameters to specify heap size inwards Java. The -Xms defines the size of the heap when JVM starts upwards together with -Xmx is used to specify the maximum heap size for Java application i.e. your heap cannot grow beyond that together with JVM volition expire yesteryear throwing OutOfMemoryError if your heap doesn't have got plenty infinite to do novel objects. See here to larn to a greater extent than virtually heap retentiveness inwards Java.
4) What is the departure betwixt JVM together with JRE?
The JRE stands for Java Runtime Environment together with JVM stands for Java Virtual Machine. You install JRE to run Java application e.g. Applet or Core Java application or Web server similar Tomcat. The JVM is business office of JRE. See here to larn to a greater extent than differences betwixt JVM together with JRE.
5) What is the departure betwixt JVM together with JIT? (answer)
The JVM stands for Java Virtual machine spell JIT stands for Just inwards fourth dimension Compiler. The JIT is business office of JVM together with used to convert the Java bytecode into native machine code which runs faster. There is some threshold laid if a code runs to a greater extent than than the threshold it becomes the candidate of only inwards fourth dimension compilation yesteryear JIT.
6) How do yous accept the heap dump of a Java process?
There are many ways to accept the heap dump of a Java procedure e.g. Tomcat, but most mutual is yesteryear using tools available inwards JDK e.g. jVisualVM, jCmd, together with jmap. Here is the ascendence yous tin utilization to accept the heap dump of Java process:
7) How do yous accept a thread dump of a Java process?
Taking thread dump is easier than taking heap dump because yous don't demand to recall tool. In Linux, yous tin only utilization the kill ascendence to accept the thread dump e.g.
volition impress the thread dump inwards the log file or where System.out is redirected. Similarly, inwards Windows, yous tin utilization Ctrl + Break from the ascendence prompt. Alternatively, yous tin also utilization jConsole together with VisualVM to accept the thread dump of Java application inwards both Windows together with Linux. You tin also read Java Performance The Definitive Guide By Scott Oaks to larn to a greater extent than virtually thread dump together with heap dump.
8) What is OutOfMemoryError inwards Java? How do yous bargain amongst that?
The Java virtual machine throws java.lang.OutOfMemoryError when at that spot is non plenty retentiveness to run the application e.g. no to a greater extent than retentiveness to do novel objects, no to a greater extent than retentiveness to do novel threads etc. The most mutual OutOfMemoryError is the java.lang.OutOfMemoryError: coffee heap space, which comes when at that spot is no to a greater extent than retentiveness left to do a novel object.
9) What is the departure betwixt 32-bit together with 64-bit JVM? (answer)
The chief differences betwixt 32-bit together with 64-bit JVM are that afterward is designed for 64-bit operating organisation e.g. Windows 8 or afterward versions of Linux. From Java developer's perspective, the chief departure betwixt them comes from heap size. Influenza A virus subtype H5N1 64-bit JVM virtually has unlimited heap memory every bit compared to 4GB of the theoretical bound of 32-bit JVM. If your programme needs to a greater extent than memory, ameliorate run it on 64-bit JVM amongst large heap space. See hither to larn to a greater extent than virtually 32-bit together with 64-bit JVM.
13) What is Garbage Collector? (answer)
The garbage collector is a cistron of Java virtual machine which is responsible for reclaiming retentiveness from dead objects. It's 1 of the fundamental components together with allows an application developer to focus on application evolution rather than doing retentiveness management. Some of the pop garbage collectors are a Concurrent Mark-Sweep garbage collector together with G1 garbage collector inwards recent times.
14) How do yous analyze a heap dump?
There are many tools to analyze heap dump inwards Java e.g. yous tin utilization the jhat tool which comes along amongst JDK. You tin also utilization Eclipse Memory Analyzer to analyze heap dump to notice out whatever retentiveness leak inwards Java spell dealing amongst OutOfMemoryError inwards Java. See Java Performance The Definitive Guide By Scott Oaks to larn to a greater extent than about analyzing Java Heap dump.
15) What is the departure betwixt Web Server together with Application Server? (answer)
The chief departure betwixt Web together with Application Server comes from the fact that yous cannot run EJB on the Web server similar Tomcat or Jetty. The application server similar WebLogic together with WebSphere provides the runtime surroundings for EJB together with other advanced services required yesteryear Java EE or J2EE specification.
16) What is the departure betwixt Apache httpd together with Tomcat?
Though both httpd together with Tomcat are products of Apache software foundation, the httpd is to a greater extent than pop together with used across the spider web together with non only inwards Java world. The httpd is a spider web server which tin serve static HTML files together with dynamic content using PHP, Perl or Python, spell Tomcat is a Servlet container which provides the runtime surroundings for Servlet together with JSP. You tin also utilization both Apache httpd together with Tomcat together inwards Java world.
17) Can yous utilization Apache together with Tomcat together?
Yes, yous tin utilization Apache together with Tomcat together. There are many Java spider web application which is fronted yesteryear Apache spider web server to deliver static resources e.g. HTML files, images, configuration files etc. You tin so configure Apache to frontwards the asking to Tomcat.
18) How do yous start together with halt Tomcat inwards Linux?
When yous install Tomcat inwards Linux yesteryear unzipping the downloaded package, yous tin run across that at that spot is a startup.sh together with shutdown.sh file inwards the tomcat/bin directory. These scripts are used to start together with halt Tomcat inwards Linux. These scripts internally telephone call upwards Catalina.sh, the chief script to start Tomcat engine.
19) How do yous start together with halt Apache inwards Linux?
The Apache server runs every bit httpd daemon inwards Linux together with yous tin either utilization kill command after finding the PID of httpd procedure every bit shown hither or yous tin utilization the apachectl script every bit shown below to start together with halt Apache spider web server inwards Linux
Starting Apache spider web server inwards Linux
$ apachectl start
Stopping Apache web server inwards Linux
$ apachectl stop
Restarting Apache spider web server inwards Linux
$ apachectl restart
or:
/sbin/service httpd restart
You powerfulness demand root access to do if Apache spider web server is non running on your application account.
20) What is JDBC?
The JDBC stands for Java Database connectivity together with 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 together with provides their driver implementation to allow Java to connect to their database. Since almost every firm application has a database, JDBC is really of import for whatever existent earth projects.
21) What is the departure betwixt JDBC together with JNDI?
As I said inwards the previous answer, the JDBC stands for Java Database Connectivity together with provides APIs together with guidelines to connect a database from Java, spell JNDI stands for Java Naming together with Directory Interface together with provides a logical construction for retrieving resources e.g. database, messaging queues, firm Java beans without knowing their physical house e.g. host or port. You tin register a resources amongst JNDI together with so balance of your application cistron tin access them using JNDI name. The database connexion puddle is the most mutual resources accessed via JNDI inwards web servers similar Tomcat or WebLogic.
22) What is database connexion pool? (answer)
As it mention suggests, it only a puddle of database connections. Since creating a novel database connexion inwards real-time is an expensive procedure together with tin potentially irksome downward the response time, many application maintains a puddle of active database connection. When a request comes inwards they retrieve a connexion from the pool, acquire the information from the database together with so render the connexion dorsum to puddle so that it tin move reused. This way, response fourth dimension is improved inwards most of the Java spider web application. See here to setup a database connexion puddle inwards Tomcat using Spring framework.
23) Your Java application is connected to a Database via a connexion pool. Suddenly your database goes down? Is that an number amongst your Java application? Do yous demand to restart your Java application?
hint: Since your Java application is using a connexion pool, it has active connections to database which volition acquire disconnected 1 time DB goes down. If yous endeavor to execute a query, yous volition have Socket errors.
24) How do yous ship spider web service asking from Linux? (answer)
There are some commands available inwards Linux e.g. curl together with wget which allows yous to ship HTTP commands, which yous tin utilization to telephone call upwards together with testify your spider web services from Linux. Particular, Curl is used extensively to testify RESTful Web Services because it tin ship POST request, GET request, asking amongst headers together with also authenticate using both basic together with digest authentication.
If yous are working amongst REST API, I propose learning curl, it's really convenient to depository fiscal establishment friction match if your API is working properly using curl from the ascendence line. You tin fifty-fifty write a script to automate those stuff.
25) What is the departure betwixt HTTP together with HTTPS? (answer)
This is 1 of the mutual together with piece of cake questions. Of course, yous know the departure betwixt HTTP together with HTTPS right? well, HTTP is insecure but HTTPS is secure, the extra "s" is for security, which agency it non exclusively encode together with encrypt the message earlier sending but also verify the identity of the server yesteryear using SSL certificates provided yesteryear global certificate regime e.g. GoDaddy, Thawte, VeriSign, Digicert, GeoTrust, together with Comodo. See here to larn to a greater extent than how SSL together with Certifications operate inwards Java spider web application.
26) What is the departure betwixt the GET together with POST method? (answer)
Another uncomplicated but oftentimes asked enquiry on Java back upwards interviews. The chief departure betwixt the GET together with POST is that GET is both idempotent and rubber but POST is not. You tin burn downward GET asking multiple fourth dimension together with it volition give the same lawsuit but multiple POST submission should ever move avoided. GET is also used to read information from server together with POST is used to ship information to the server.
27) What is the departure betwixt Servlet together with JSP? (answer)
This is some other interesting Java JEE back upwards Interview Question. Even though both Servlet together with JSP is used to do dynamic HTML the fundamental departure betwixt them is their purpose. Servlet is meant for Java developers together with yous write to a greater extent than Java than HTML together with that's why it serves every bit Controller inwards many pop MVC framework e.g. DispatcherServlet inwards Spring MVC.
On the other hand, JSP is designed for HTML developers together with it's to a greater extent than HTML than Java together with that's why it is used every bit "view" inwards MVC frameworks similar Spring together with Struts. See the link inwards the respond for to a greater extent than detailed comparison.
28) What is the departure betwixt Struts together with Spring MVC?
This is 1 time to a greater extent than a pop together with oftentimes asked enquiry on Java JEE Interviews. Even though both are pop spider web MVC framework for Java applications, the fundamental departure is that Spring brings dependency injection start together with Struts brings it afterward using Struts 2.0.
Spring is also a suite of libraries e.g. yous acquire Spring Security to implement safety inwards your application, so at that spot is Spring Boot, Spring Data, Spring Cloud together with many to a greater extent than useful libraries nether Spring umbrella.
29) What is the departure betwixt JDBC together with Hibernate? (answer)
There are many differences betwixt JDBC together with Hibernate but the most of import 1 is that JDBC provides an API to connect to the database together with execute the query but Hibernate is an ORM (Object Relational modeling) framework, which agency it allows yous to operate amongst objects spell it takes aid of saving together with retrieving object from database.
In short, inwards JDBC yous demand to write SQL queries to acquire together with shop information from database but inwards Hibernate yous only bargain amongst objects, Hibernate takes aid of issuing SQL queries to the database.
30) What is the departure betwixt Stack retentiveness together with heap? Which 1 is faster? (answer)
These are only 2 dissimilar retentiveness areas used to shop dissimilar kinds of variables. The stack is local to every thread spell heap retentiveness is shared amidst all threads. Since Stack is closer to thread together with commonly implemented using CPU registers they are faster than heap memory. The stack is used to shop local variables every bit good method telephone call upwards frames spell heap is used to shop objects together with flat metadata. See the detailed respond for to a greater extent than points.
31) What is the departure betwixt TCP/IP together with UDP protocol? (answer)
There are several differences betwixt TCP together with UDP protocol but the most of import of them is that TCP provides a guarantee of message delivery spell UDP doesn't give whatever guarantee. Because of this guarantee TCP sends to a greater extent than messages than UDP together with so swallow to a greater extent than bandwidth together with slower than UDP. TCP is also connexion oriented protocol spell UDP is connectionless. See the detailed respond for to a greater extent than points.
32) Your Java application is connecting to some other Java application (server) running on the remote host together with listening on port 17865. Now, yous don't have got access to that remote host to move together with run across if the procedure is running. How do notice if the server is upwards together with running?
hint: you tin utilization the telnet command
33) You are supporting a Java spider web application which connects to many heart Java procedure together with gets information from them to the distribution to clients? One customer complains that the asking for information is taking likewise long together with it's almost similar hung? How do yous troubleshoot this problem?
hint: depository fiscal establishment friction match the log, depository fiscal establishment friction match database, depository fiscal establishment friction match the file system
34) The Java application yous back upwards connects to a database via a DNS, which automatically switches to the secondary database server when the primary goes down. You notice that inwards the lawsuit of a failover, your Java application is non connecting to secondary DB server? How do yous troubleshoot this problem?
hint: depository fiscal establishment friction match which version your Java application is running. Some JRE caches the DNS e.g. JRE 1.6
35) What is a deadlock? How do yous notice if your Java programme has a deadlock? (answer)
The deadlock is a status which tin occur betwixt 2 or multiple threads. In this case, each of the thread waits for each other together with cannot progress. In Java, this commonly happens when thread 1 holds the lock required yesteryear thread 2 together with thread 2 holds the lock required yesteryear thread 1. If your Java programme is hung so it could move a deadlock. You tin accept a thread dump together with notice out if whatever thread is waiting for the lock concord yesteryear other together with vice-versa. You tin also utilization jConsole tool to notice deadlock.
36) What is the race condition? (answer)
The race status is some other multithreading together with concurrency põrnikas which happens due to racing betwixt 2 threads, for example, if 1 thread is updating a variable together with minute thread tries to read the value earlier it finished. You tin avoid race weather yesteryear properly synchronizing your code.
37) What is the departure betwixt PATH together with CLASSPATH? (answer)
Both are fundamental surroundings variable used yesteryear Java platform, but the fundamental departure betwixt them is that PATH points to the JDK binaries or native libraries e.g. java.exe, spell CLASSPATH points to Java binaries e.g. JAR files, which contains bytecode. PATH is also organisation flat concept independent of Java but CLASSPATH is purely Java concept together with used yesteryear JVM to charge classes required yesteryear Java application yous are running.
38) How do yous notice the Java version used yesteryear your application? (answer)
You tin run the coffee -version ascendence inwards the ascendence prompt to notice out the version of Java used yesteryear your application. If yous have got multiple JDK or JRE installed so brand certain yous utilization the 1 which is used yesteryear your application.
39) What is JAVA_HOME surroundings variable? (answer)
The JAVA_HOME is nada but a user defined surroundings variable which points to the installation directory of JDK. For example, if yous have got installed JDK inwards /opt/jdk_1.6_20 inwards Linux so the JAVA_HOME variable volition betoken to this directory. Same goes for Windows or whatever other operating system.
That's all virtually 39 essential questions fro Java JEE Support Engineer. It's only a minor laid of questions yous tin await inwards whatever service based society or investment banks but does recall to gear upwards fundamental skills required for back upwards engineers e.g. UNIX, SQL, Java, together with others. In the adjacent business office of this article, I volition portion some of the oftentimes asked questions from Java Support Engineer on SQL, UNIX, together with other supporting technologies.
Other topic based Java Interview questions for to a greater extent than practice
This list of Java interview questions for Java, JEE, together with J2EE back upwards engineers should move plenty to gear upwards for whatever Java interview. You tin cleft both fresher together with sense flat interview yesteryear preparing these Java interview questions, at to the lowest degree start few rounds. If yous human face upwards whatever other interesting enquiry which is non inwards this list, so delight allow me know via comments together with I'll add together it.
Further Learning
Java Web Fundamentals By Kevin Jones
Introduction to Spring MVC
Even though yous volition move interviewed to back upwards Java application, it's expected from yous to know SQL, UNIX, XML together with other fundamental technologies which yous volition utilization inwards your day-to-day job. In this post, yous volition notice questions which are asked to depository fiscal establishment friction match whether a candidate has required skills to back upwards Java application or not.
39 Interview Questions for Java JEE Support Engineers
Here is my collection of some of the best interview questions for Java together with JEE back upwards professionals. If yous are working inwards production services or supporting Java application, these interview enquiry volition aid yous to do good on your interview. If yous moving from evolution to back upwards role so also these questions volition give yous a adept thought virtually what is expected from a Java JEE back upwards engineers.1) How do yous depository fiscal establishment friction match your Java procedure is running on Linux? (example)
You tin depository fiscal establishment friction match yesteryear using "ps" ascendence together with "grep" ascendence e.g. ps -ef | grep "myprocess". The keyword which yous utilization amongst grep for search tin move anything unique to your process, something which appears inwards its ascendence describe e.g. mention of the flat which implements the chief method. You tin also do "ps -ef | grep java" to listing all Java process.
2) How do yous depository fiscal establishment friction match how much retentiveness together with CPU your Java procedure is consuming?
First, yous demand to notice the PID of your process, which yous tin notice yesteryear using the "ps" ascendence every bit shown inwards the previous question. Once yous notice the PID yous tin utilization the "top" ascendence to notice the CPU together with retentiveness usage. Alternatively, yous tin also utilization the prstat ascendence every bit shown here.
3) What does -Xmx together with -Xms parameters mean?
These are parameters to specify heap size inwards Java. The -Xms defines the size of the heap when JVM starts upwards together with -Xmx is used to specify the maximum heap size for Java application i.e. your heap cannot grow beyond that together with JVM volition expire yesteryear throwing OutOfMemoryError if your heap doesn't have got plenty infinite to do novel objects. See here to larn to a greater extent than virtually heap retentiveness inwards Java.
4) What is the departure betwixt JVM together with JRE?
The JRE stands for Java Runtime Environment together with JVM stands for Java Virtual Machine. You install JRE to run Java application e.g. Applet or Core Java application or Web server similar Tomcat. The JVM is business office of JRE. See here to larn to a greater extent than differences betwixt JVM together with JRE.
5) What is the departure betwixt JVM together with JIT? (answer)
The JVM stands for Java Virtual machine spell JIT stands for Just inwards fourth dimension Compiler. The JIT is business office of JVM together with used to convert the Java bytecode into native machine code which runs faster. There is some threshold laid if a code runs to a greater extent than than the threshold it becomes the candidate of only inwards fourth dimension compilation yesteryear JIT.
6) How do yous accept the heap dump of a Java process?
There are many ways to accept the heap dump of a Java procedure e.g. Tomcat, but most mutual is yesteryear using tools available inwards JDK e.g. jVisualVM, jCmd, together with jmap. Here is the ascendence yous tin utilization to accept the heap dump of Java process:
$ jmap -dump:live, file=/location/of/heap_dump.hprof PID
The heap dump volition comprise all alive objects together with they are stored inwards heap_dump.hprof file. Remember, yous also demand PID of Java procedure which yous tin notice yesteryear using "ps" together with "grep" ascendence every bit discussed inwards the start question. You tin run across Java Performance Companion yesteryear Charlie Hunt to larn to a greater extent than virtually taking together with analyzing heap dump inwards Java to notice retentiveness leak together with other retentiveness related errors.
7) How do yous accept a thread dump of a Java process?
Taking thread dump is easier than taking heap dump because yous don't demand to recall tool. In Linux, yous tin only utilization the kill ascendence to accept the thread dump e.g.
$ kill -3 PID volition impress the thread dump inwards the log file or where System.out is redirected. Similarly, inwards Windows, yous tin utilization Ctrl + Break from the ascendence prompt. Alternatively, yous tin also utilization jConsole together with VisualVM to accept the thread dump of Java application inwards both Windows together with Linux. You tin also read Java Performance The Definitive Guide By Scott Oaks to larn to a greater extent than virtually thread dump together with heap dump.
8) What is OutOfMemoryError inwards Java? How do yous bargain amongst that?
The Java virtual machine throws java.lang.OutOfMemoryError when at that spot is non plenty retentiveness to run the application e.g. no to a greater extent than retentiveness to do novel objects, no to a greater extent than retentiveness to do novel threads etc. The most mutual OutOfMemoryError is the java.lang.OutOfMemoryError: coffee heap space, which comes when at that spot is no to a greater extent than retentiveness left to do a novel object.
9) What is the departure betwixt 32-bit together with 64-bit JVM? (answer)
The chief differences betwixt 32-bit together with 64-bit JVM are that afterward is designed for 64-bit operating organisation e.g. Windows 8 or afterward versions of Linux. From Java developer's perspective, the chief departure betwixt them comes from heap size. Influenza A virus subtype H5N1 64-bit JVM virtually has unlimited heap memory every bit compared to 4GB of the theoretical bound of 32-bit JVM. If your programme needs to a greater extent than memory, ameliorate run it on 64-bit JVM amongst large heap space. See hither to larn to a greater extent than virtually 32-bit together with 64-bit JVM.
13) What is Garbage Collector? (answer)
The garbage collector is a cistron of Java virtual machine which is responsible for reclaiming retentiveness from dead objects. It's 1 of the fundamental components together with allows an application developer to focus on application evolution rather than doing retentiveness management. Some of the pop garbage collectors are a Concurrent Mark-Sweep garbage collector together with G1 garbage collector inwards recent times.
14) How do yous analyze a heap dump?
There are many tools to analyze heap dump inwards Java e.g. yous tin utilization the jhat tool which comes along amongst JDK. You tin also utilization Eclipse Memory Analyzer to analyze heap dump to notice out whatever retentiveness leak inwards Java spell dealing amongst OutOfMemoryError inwards Java. See Java Performance The Definitive Guide By Scott Oaks to larn to a greater extent than about analyzing Java Heap dump.
15) What is the departure betwixt Web Server together with Application Server? (answer)
The chief departure betwixt Web together with Application Server comes from the fact that yous cannot run EJB on the Web server similar Tomcat or Jetty. The application server similar WebLogic together with WebSphere provides the runtime surroundings for EJB together with other advanced services required yesteryear Java EE or J2EE specification.
16) What is the departure betwixt Apache httpd together with Tomcat?
Though both httpd together with Tomcat are products of Apache software foundation, the httpd is to a greater extent than pop together with used across the spider web together with non only inwards Java world. The httpd is a spider web server which tin serve static HTML files together with dynamic content using PHP, Perl or Python, spell Tomcat is a Servlet container which provides the runtime surroundings for Servlet together with JSP. You tin also utilization both Apache httpd together with Tomcat together inwards Java world.
17) Can yous utilization Apache together with Tomcat together?
Yes, yous tin utilization Apache together with Tomcat together. There are many Java spider web application which is fronted yesteryear Apache spider web server to deliver static resources e.g. HTML files, images, configuration files etc. You tin so configure Apache to frontwards the asking to Tomcat.
18) How do yous start together with halt Tomcat inwards Linux?
When yous install Tomcat inwards Linux yesteryear unzipping the downloaded package, yous tin run across that at that spot is a startup.sh together with shutdown.sh file inwards the tomcat/bin directory. These scripts are used to start together with halt Tomcat inwards Linux. These scripts internally telephone call upwards Catalina.sh, the chief script to start Tomcat engine.
19) How do yous start together with halt Apache inwards Linux?
The Apache server runs every bit httpd daemon inwards Linux together with yous tin either utilization kill command after finding the PID of httpd procedure every bit shown hither or yous tin utilization the apachectl script every bit shown below to start together with halt Apache spider web server inwards Linux
Starting Apache spider web server inwards Linux
$ apachectl start
Stopping Apache web server inwards Linux
$ apachectl stop
Restarting Apache spider web server inwards Linux
$ apachectl restart
or:
/sbin/service httpd restart
You powerfulness demand root access to do if Apache spider web server is non running on your application account.
20) What is JDBC?
The JDBC stands for Java Database connectivity together with 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 together with provides their driver implementation to allow Java to connect to their database. Since almost every firm application has a database, JDBC is really of import for whatever existent earth projects.
21) What is the departure betwixt JDBC together with JNDI?
As I said inwards the previous answer, the JDBC stands for Java Database Connectivity together with provides APIs together with guidelines to connect a database from Java, spell JNDI stands for Java Naming together with Directory Interface together with provides a logical construction for retrieving resources e.g. database, messaging queues, firm Java beans without knowing their physical house e.g. host or port. You tin register a resources amongst JNDI together with so balance of your application cistron tin access them using JNDI name. The database connexion puddle is the most mutual resources accessed via JNDI inwards web servers similar Tomcat or WebLogic.
22) What is database connexion pool? (answer)
As it mention suggests, it only a puddle of database connections. Since creating a novel database connexion inwards real-time is an expensive procedure together with tin potentially irksome downward the response time, many application maintains a puddle of active database connection. When a request comes inwards they retrieve a connexion from the pool, acquire the information from the database together with so render the connexion dorsum to puddle so that it tin move reused. This way, response fourth dimension is improved inwards most of the Java spider web application. See here to setup a database connexion puddle inwards Tomcat using Spring framework.
23) Your Java application is connected to a Database via a connexion pool. Suddenly your database goes down? Is that an number amongst your Java application? Do yous demand to restart your Java application?
hint: Since your Java application is using a connexion pool, it has active connections to database which volition acquire disconnected 1 time DB goes down. If yous endeavor to execute a query, yous volition have Socket errors.
24) How do yous ship spider web service asking from Linux? (answer)
There are some commands available inwards Linux e.g. curl together with wget which allows yous to ship HTTP commands, which yous tin utilization to telephone call upwards together with testify your spider web services from Linux. Particular, Curl is used extensively to testify RESTful Web Services because it tin ship POST request, GET request, asking amongst headers together with also authenticate using both basic together with digest authentication.
If yous are working amongst REST API, I propose learning curl, it's really convenient to depository fiscal establishment friction match if your API is working properly using curl from the ascendence line. You tin fifty-fifty write a script to automate those stuff.
25) What is the departure betwixt HTTP together with HTTPS? (answer)
This is 1 of the mutual together with piece of cake questions. Of course, yous know the departure betwixt HTTP together with HTTPS right? well, HTTP is insecure but HTTPS is secure, the extra "s" is for security, which agency it non exclusively encode together with encrypt the message earlier sending but also verify the identity of the server yesteryear using SSL certificates provided yesteryear global certificate regime e.g. GoDaddy, Thawte, VeriSign, Digicert, GeoTrust, together with Comodo. See here to larn to a greater extent than how SSL together with Certifications operate inwards Java spider web application.
26) What is the departure betwixt the GET together with POST method? (answer)
Another uncomplicated but oftentimes asked enquiry on Java back upwards interviews. The chief departure betwixt the GET together with POST is that GET is both idempotent and rubber but POST is not. You tin burn downward GET asking multiple fourth dimension together with it volition give the same lawsuit but multiple POST submission should ever move avoided. GET is also used to read information from server together with POST is used to ship information to the server.
27) What is the departure betwixt Servlet together with JSP? (answer)
This is some other interesting Java JEE back upwards Interview Question. Even though both Servlet together with JSP is used to do dynamic HTML the fundamental departure betwixt them is their purpose. Servlet is meant for Java developers together with yous write to a greater extent than Java than HTML together with that's why it serves every bit Controller inwards many pop MVC framework e.g. DispatcherServlet inwards Spring MVC.
On the other hand, JSP is designed for HTML developers together with it's to a greater extent than HTML than Java together with that's why it is used every bit "view" inwards MVC frameworks similar Spring together with Struts. See the link inwards the respond for to a greater extent than detailed comparison.
28) What is the departure betwixt Struts together with Spring MVC?
This is 1 time to a greater extent than a pop together with oftentimes asked enquiry on Java JEE Interviews. Even though both are pop spider web MVC framework for Java applications, the fundamental departure is that Spring brings dependency injection start together with Struts brings it afterward using Struts 2.0.
Spring is also a suite of libraries e.g. yous acquire Spring Security to implement safety inwards your application, so at that spot is Spring Boot, Spring Data, Spring Cloud together with many to a greater extent than useful libraries nether Spring umbrella.
29) What is the departure betwixt JDBC together with Hibernate? (answer)
There are many differences betwixt JDBC together with Hibernate but the most of import 1 is that JDBC provides an API to connect to the database together with execute the query but Hibernate is an ORM (Object Relational modeling) framework, which agency it allows yous to operate amongst objects spell it takes aid of saving together with retrieving object from database.
In short, inwards JDBC yous demand to write SQL queries to acquire together with shop information from database but inwards Hibernate yous only bargain amongst objects, Hibernate takes aid of issuing SQL queries to the database.
30) What is the departure betwixt Stack retentiveness together with heap? Which 1 is faster? (answer)
These are only 2 dissimilar retentiveness areas used to shop dissimilar kinds of variables. The stack is local to every thread spell heap retentiveness is shared amidst all threads. Since Stack is closer to thread together with commonly implemented using CPU registers they are faster than heap memory. The stack is used to shop local variables every bit good method telephone call upwards frames spell heap is used to shop objects together with flat metadata. See the detailed respond for to a greater extent than points.
31) What is the departure betwixt TCP/IP together with UDP protocol? (answer)
There are several differences betwixt TCP together with UDP protocol but the most of import of them is that TCP provides a guarantee of message delivery spell UDP doesn't give whatever guarantee. Because of this guarantee TCP sends to a greater extent than messages than UDP together with so swallow to a greater extent than bandwidth together with slower than UDP. TCP is also connexion oriented protocol spell UDP is connectionless. See the detailed respond for to a greater extent than points.
32) Your Java application is connecting to some other Java application (server) running on the remote host together with listening on port 17865. Now, yous don't have got access to that remote host to move together with run across if the procedure is running. How do notice if the server is upwards together with running?
hint: you tin utilization the telnet command
33) You are supporting a Java spider web application which connects to many heart Java procedure together with gets information from them to the distribution to clients? One customer complains that the asking for information is taking likewise long together with it's almost similar hung? How do yous troubleshoot this problem?
hint: depository fiscal establishment friction match the log, depository fiscal establishment friction match database, depository fiscal establishment friction match the file system
34) The Java application yous back upwards connects to a database via a DNS, which automatically switches to the secondary database server when the primary goes down. You notice that inwards the lawsuit of a failover, your Java application is non connecting to secondary DB server? How do yous troubleshoot this problem?
hint: depository fiscal establishment friction match which version your Java application is running. Some JRE caches the DNS e.g. JRE 1.6
35) What is a deadlock? How do yous notice if your Java programme has a deadlock? (answer)
The deadlock is a status which tin occur betwixt 2 or multiple threads. In this case, each of the thread waits for each other together with cannot progress. In Java, this commonly happens when thread 1 holds the lock required yesteryear thread 2 together with thread 2 holds the lock required yesteryear thread 1. If your Java programme is hung so it could move a deadlock. You tin accept a thread dump together with notice out if whatever thread is waiting for the lock concord yesteryear other together with vice-versa. You tin also utilization jConsole tool to notice deadlock.
36) What is the race condition? (answer)
The race status is some other multithreading together with concurrency põrnikas which happens due to racing betwixt 2 threads, for example, if 1 thread is updating a variable together with minute thread tries to read the value earlier it finished. You tin avoid race weather yesteryear properly synchronizing your code.
37) What is the departure betwixt PATH together with CLASSPATH? (answer)
Both are fundamental surroundings variable used yesteryear Java platform, but the fundamental departure betwixt them is that PATH points to the JDK binaries or native libraries e.g. java.exe, spell CLASSPATH points to Java binaries e.g. JAR files, which contains bytecode. PATH is also organisation flat concept independent of Java but CLASSPATH is purely Java concept together with used yesteryear JVM to charge classes required yesteryear Java application yous are running.
38) How do yous notice the Java version used yesteryear your application? (answer)
You tin run the coffee -version ascendence inwards the ascendence prompt to notice out the version of Java used yesteryear your application. If yous have got multiple JDK or JRE installed so brand certain yous utilization the 1 which is used yesteryear your application.
39) What is JAVA_HOME surroundings variable? (answer)
The JAVA_HOME is nada but a user defined surroundings variable which points to the installation directory of JDK. For example, if yous have got installed JDK inwards /opt/jdk_1.6_20 inwards Linux so the JAVA_HOME variable volition betoken to this directory. Same goes for Windows or whatever other operating system.
That's all virtually 39 essential questions fro Java JEE Support Engineer. It's only a minor laid of questions yous tin await inwards whatever service based society or investment banks but does recall to gear upwards fundamental skills required for back upwards engineers e.g. UNIX, SQL, Java, together with others. In the adjacent business office of this article, I volition portion some of the oftentimes asked questions from Java Support Engineer on SQL, UNIX, together with other supporting technologies.
Other topic based Java Interview questions for to a greater extent than practice
- 21 Java Inheritance Interview Questions together with Answers (list)
- 15 Data Structure together with Algorithm Questions from Java Interviews (read here)
- Top 10 Spring Framework Interview Questions amongst Answers (see here)
- Top twenty Hibernate Interview Questions together with Answers (list)
- 10 JDBC Interview Questions for Java Programmers (questions)
- 15 Java NIO together with Networking Interview Questions amongst Answers (see here)
- 20 Java Design Pattern Questions asked on Interviews (see here)
- 10 Struts Interview Questions for Java developers (list)
- 30 OOP Interview Questions amongst Answer (see)
- 19 Method overloading together with overriding interview questions (see here)
- 10 oftentimes asked Servlet Interview Questions amongst Answers (see here)
- 15 Java Enum based interview questions amongst 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 together with Answers (see here)
- Top 10 JMS together with MQ Series Interview Questions together with Answers (list)
- 10 Hibernate Interview Questions for Java EE developers (see here)
- 21 Final modifier interview questions amongst respond (read)
- 10 XML Interview Questions for Java Programmers (read here)
- Top 10 XSLT Interview Questions amongst Answers (read more)
- Top 10 Trick Java Interview Questions together with Answers (see here)
- Top xl Core Java Phone Interview Questions amongst answers (list)
This list of Java interview questions for Java, JEE, together with J2EE back upwards engineers should move plenty to gear upwards for whatever Java interview. You tin cleft both fresher together with sense flat interview yesteryear preparing these Java interview questions, at to the lowest degree start few rounds. If yous human face upwards whatever other interesting enquiry which is non inwards this list, so delight allow me know via comments together with I'll add together it.
Further Learning
Java Web Fundamentals By Kevin Jones
Introduction to Spring MVC





0 Response to "Top twoscore Advanced Java/J2EE Interview Questions Answers for Experienced - three to v Years"
Posting Komentar