InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What are Java doGet () and doPost () methods? |
|
Answer» The doGet() method is used to fetch the information from the server, whereas the doPost() is used to send or transfer the information to the server. doGet() method is LABELLED by the SERVLET service method, which is used to handle the HTTP GET request. In case of overriding this method, ENSURE to read the requested data and then write the response HEADERS. Once you get the output stream object or the response's writer, only then write the response data. doPost() method is labelled by the servlet service method to manage the POST request from the client. This method sends the files to the server and works similarly to the FTP OPERATIONS from the client to the server. |
|
| 2. |
How garbage collection makes Java more memory efficient? |
|
Answer» GARBAGE collection makes Java more memory efficient by SIMPLY removing the objects which are not referenced to ANYTHING from the HEAP memory and creating the FREE space for the new objects. |
|
| 3. |
What is the use of overloading and overriding in Java? |
|
Answer» The overloading method is USED in Java when TWO or more methods share the same name in the same class but with different parameters. class Dog{ The overriding method DEFINES the case where the child's class redefines the same method as their parent class. The overridden methods should have the same argument list, name, and return type. class Dog{ public class OverridingTest{ |
|
| 4. |
What is the difference between boxing and unboxing in Java? |
|||||||||||||||
Answer»
|
||||||||||||||||
| 5. |
What is the difference between Errors and Exceptions in Java? |
||||||||||
Answer»
|
|||||||||||
| 6. |
Which one is better, setter injection or constructor injection? |
|
Answer» CONSTRUCTOR injection is better. If you want to prompt the class, you always do it with the constructor. When you are using the constructor-BASED injection, the only way to prompt or instantiate the class is by using the constructor. If you pass the DEPENDENCY via a constructor, it becomes obvious that it is an ESSENTIAL dependency. However, if you use the setter injection in the POJO class, you might face challenges in setting the value of your class variable by using the setter method. This is ENTIRELY based on the customer's needs which is optional. If you pass the dependency via setter, it means that it is an optional dependency. |
|
| 7. |
Can you override a static method in Java? |
|
Answer» The static method can't be overridden in Java. This is because the OVERRIDING method depends upon the runtime dynamic BINDING, WHEREAS the static METHODS are bonded statically at the compile time. Also, the static method is not linked with any of the class instances, so the concept is not APPLICABLE. |
|
| 8. |
How many ways to handle exceptions in the Spring MVC Framework? |
|
Answer» SPRING MVC Framework provides TWO ways for handling the exceptions:
|
|
| 9. |
What are the different methods of session management in Servlet? |
|
Answer» There are generally FOUR MAIN methods of SESSION management in Servlet.
|
|
| 10. |
How can we detect and avoid deadlock in Java? |
|
Answer» A deadlock can appear almost when the processes share the RESOURCES. To detect the deadlock, the wait-for graph should be maintained, and the system invokes an algorithm periodically that searches for CYCLES in the wait-for graph. How to avoid deadlock:
|
|
| 11. |
What is a connection leak, and how can we fix it in Java? |
|
Answer» A connection leak implies a portion of the information base request/transaction are not getting shut as EXPECTED or are not getting committed. Lastly, those connections are getting abandoned and shut down all time. To fix the leaks, you have to find where you have used the OPENING connections and then use TRY-with-RESOURCES that will do all the close() stuff for you. Exampletry (Connection connection = DriverManager.getConnection(url); |
|
| 12. |
How can the web application load time be reduced? |
|
Answer» The ways to MINIMIZE the LOAD TIME of a web application are:- |
|
| 13. |
What do you mean by CORS and how does it work? |
|
Answer» CORS stands for Cross-Origin Resource Sharing. It is a standard to SHARE the selected resources between the WEB applications RUNNING on TWO DIFFERENT domains. |
|
| 14. |
What is multithreading? |
|
Answer» MULTITHREADING is the ability of the OPERATING SYSTEM or the PROGRAM to handle the multiple user requests at a TIME for its resources. Here a user can be a human or another program. |
|
| 15. |
What do you mean by routing in angular js? |
|||||||||
|
Answer» If the developer wants to go through different pages in a single page application and also with no reloading of the page then the ngRoute MODULE is used. It routes the application to different pages with the reloading of the COMPLETE application. Also Read: Angular Questions and Answers 27. What is the difference between directive and component?
Note: These are Full Stack developer interview questions. Candidates who are deciding to switch to Full Stack or looking for a job must read this. |
||||||||||
| 16. |
What is MEAN Stack? |
|
Answer» MEAN stack is a user-friendly FREE and open-source JavaScript SOFTWARE which is used for building the dynamic web sites and the web applications. The advantage of using the MEAN stack is that only language JavaScript runs on all the levels of the applications which makes it efficient. MEAN stack is the composition of:-
|
|
| 17. |
What is the difference between Nodejs, AJAX, And JQuery? |
||||||||
Answer»
|
|||||||||
| 18. |
Explain the difference between AngularJS and Node.js? |
||||||||||||
Answer»
|
|||||||||||||
| 19. |
What is Express.js? |
|
Answer» Express.js is a web APPLICATION SERVER framework. It is used for Node.js. It helps to CREATE node.js applications in less TIME. It also PROVIDES security-related help for node.js. |
|
| 20. |
What is the difference between constructor & destructor? |
||||||||||||
Answer»
|
|||||||||||||
| 21. |
What is final class and final method? |
|
Answer» Final CLASSES cannot be subclassed; it is not open for change and can be used reliably for common execution of routines. “String” class in Java is an example of a final class. This is DONE for SECURITY and sometimes for efficiency. Final methods cannot be overridden. They are not open to change. This prevents accidental changes which may result in CRASHING of application. |
|
| 22. |
What do you mean by Closures? |
|
Answer» A closure is the capability of an INNER function to have access to variables in local scope in which internal function was CREATED. EVEN if the out function has finished execution, closure MEANS the inner function has access to its local variables. |
|
| 23. |
What is the prototype in javascript and how do you use it? |
|
Answer» PROTOTYPES are objects CREATED in Javascript. They are the “parent” objects. If we WANT to create COMMON TASKS (properties/methods) for all the objects inherited from the parent object we need to define them in the prototype object. |
|
| 24. |
What do you mean by promise? |
|
Answer» A PROMISE is an OBJECT which shows the result of the asynchronous operation. The result can be a resolved value or a REASON why the process failed like “a network ERROR occurred. A promise can be any of the 3 states:-
|
|
| 25. |
What the differences are between == and ===? |
||||||
Answer»
Note: The following Full Stack DEVELOPER interview questions are a guide to a basic understanding of the subject. Must read for Engineers switching to Full-Stack. |
|||||||
| 26. |
Explain the difference between horizontal scaling and vertical scaling in the database? |
||||||||||||
Answer»
|
|||||||||||||
| 27. |
What are two phases commit in the database? Explain |
|
Answer» Two-phase COMMIT (2PC) is the feature of transaction processing systems which enables databases that they return to the pre-transaction state if an error condition OCCURS. The two-phase commit strategy is designed to make SURE that either all the databases are UPDATED or none of them is updated. As a result, the databases remain SYNCHRONIZED. |
|
| 28. |
What are normalization and denormalization? |
|
Answer» Normalization means MERELY a process of reducing or eliminating the DATA REDUNDANCY. As a result, space is saved, and the consistency of data is increased. The DENORMALIZATION is an optimization process to increase the data redundancy in the database. As a result, the JOINS are avoided, and the performance of the database structure is improved. Denormalization is done after the normalization process
|
|
| 29. |
What is difference between left and right join? |
||||||
Answer»
SELECT column_list FROM table_1 LEFT JOIN table_2 ON column_name1 = column_name2 WHERE join_condition 2. Right JoinSELECT column_list FROM table_1 RIGHT JOIN table_2 ON column_name1 = column_name2 WHERE join_condition |
|||||||
| 30. |
What does acid stand for in database? |
|
Answer» The ACRONYM ACID STANDS for Atomicity, CONSISTENCY, ISOLATION, and Durability. |
|
| 31. |
What are the difference between "resetting" and "normalizing" CSS? |
|||||||||
Answer»
|
||||||||||
| 32. |
What is the difference between defer and async? |
|||||||||
Answer»
|
||||||||||
| 33. |
What are the difference between MVP and MVC? |
||||||||||||
Answer»
|
|||||||||||||
| 34. |
What do you mean by data attributes and why it is used? |
|
Answer» HTML 5 has “data-*” which are custom attributes defined by the developer. They are used when any existing characteristic is not SUITABLE to be used. These attributes are only used on the page they are written on, and they do not need AJAX calls. These are Global attributes, so they can be applied to any element. Point to be noted: GO through this Q&A very thoroughly as this is one of the essential full STACK developer INTERVIEW questions. |
|
| 35. |
What is a callback in JavaScript? |
|
Answer» A Callback Function is a function which is passed as a parameter to another function,.The callback function RUN INSIDE of the function into which it was passed. JavaScript Callback Functions can be used SYNCHRONOUSLY, and it can also be used asynchronously. Application PROGRAMMING interfaces of the Node are written in such a way that they all support CALLBACKS. |
|
| 36. |
What is RESTful API and why it is used? |
|
Answer» A RESTful API is also known as RESTful WEB service. Full form of REST is Representational state transfer, and complete KIND of API is Application program interface. This program interface uses HTTP PROTOCOL to define the set of function such as GET, PUT, POST and DELETE data. RESTful API is used. REST is mostly used in developing Web applications. |
|
| 37. |
What languages should a full stack developer know? |
|
Answer» A full stack developer should know:- 1. Programming languagesMUST be proficient in multiple languages, including PHP, Java, C #, Ruby, Perl, Python, etc. Must be familiar with different ways to structure, design, implement and test the project based on languages. 2. Frameworks:Must know the words that are accompanied by development frameworks, such as Spring, JAVA, MyBatis, Python Django, PHP think PHP, Hibernate, nodeJs express, yin, etc. 3. Front-end:Must master necessary front-end technologies such as CSS3, HTML5, and JAVASCRIPT. Additional study of third-party libraries such as JQuery, SASS, LESS, AngularJS, or REACT is also required. 4. Databases:Knowledge of at least one database is expected. Currently, the popular databases are MYSQL, Oracle, MONGODB, SQLServer and Redis. 5. Design ability:Basic knowledge of the principle of prototype design, UI and UX design is needed. |
|
| 38. |
What is difference between abstract and interface? |
||||||||
Answer»
|
|||||||||