Interview Questions and Answers - Order By Rating Q661. What is the use of load-on-startup ? Design
Ans. The load-on-startup element of web-app loads the servlet at the time of deployment or server start if value is positive. It is also known as pre initialization of servlet.You can pass positive and negative value for the servlet. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  load on startup   web application Asked in 1 Companies Q662. What is OSGI ? OSGI
Ans. OSGI is open service gateway initiative, its used as java framework for developing and deploying the modular softwares. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 23 Companies Q663. Have you worked on Linux Systems ? General
This question was recently asked at 'HCL Technologies,Symantec'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 2 Companies Q664. Which memory segment is cleaned by Garbage Collection - stack or heap ? Core Java
Ans. Heap as objects are stored ink heap. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  memory management   stack  heap  garbage collection Q665. Set Locators priority wise in selenium WebDriver. Selenium
Ans. Id locators,Name locators,CSS locators,Xpath locators,DOM locators Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  selenium  WebDriver Asked in 1 Companies Q666. While working on a web application, you are informed that there is no new data in Database for last few hours ? How would you go about debugging this problem ?
Solution
Ans. Will look into access logs to see if web application is getting any traffic. If not , then will inform the server support team.
Will look into intermediary infrastructure , queues , streams etc to see if there is any choke or throttle there.
If there is any throttle at any point, would make request for either debugging the cause or increasing the infrastructure. For ex - increasing shards in Kinesis. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Solution  Designing  Solutioning Asked in 2 Companies Q667. What are custom annotations and How can we create one ? Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  annotations  custom annotations basic Q668. Can we have interface as a replacement for utility class ? Core Java
Ans. Yes, With Java 8 we can use Interfaces as collection of utility methods through the use of default methods. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 8  interfaces  utility class   utility classes Q669. Difference between Component-Scan and @Component annotation ? Spring
Ans. @component mark a java class as a bean so that component scan mechanism of spring pick it up and register in IOC container. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q670. Given an Employee Table with Salary Column, Find 2nd and 5th highest salary in a particular department. SQL
Ans. Select salary from (select salary from employee where department = order by salary desc limit 5) emp order by salary limit 1 AND Select salary from (select salary from employee where department = order by salary desc limit 2) emp2 order by salary limit 1 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql  database   find 2nd highest salary sql database Asked in 1 Companies Q671. How to sort objects based on one of the field ? Core Java
Ans. Using comparable and comparator and sorted collections like TreeSet or TreeMap.
or
use stream api from java 8 onwards which internally refers to comparable and comparator through lambda expressions Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sort  sorting  comprator  comparable  treeset  treemap  sorting collections Asked in 1 Companies Basic   frequent Q672. What are different types of IOC containers ? Design
Ans. J2ee Web Containers and Core Containers Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Ans. Generally used to indicate termination Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q674. If SOAP is more secure than Rest, Why many applications today use Rest ? Web Service
Ans. SOAP supports only xml whereas Rest support many other formats.
Rest services are very light weight compared to SOAP.
SOAP services are code heavy as they require creation. of stubs and skeltons. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  soap  rest  soap vs rest Asked in 2 Companies Q675. If your application has multiple databases, how many changes you have to made in Hibernate? Hibernate
Ans. If you have mulitple Databases you just need to add multiple configuration files and create the corresponding SessionFactory object. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q676. Write code to print a Pyramid pattern ? Core Java
Ans. public static void printTriagle(int n)
{
// outer loop to handle number of rows
// n in this case
for (int i=0; i1; j--)
{
// printing spaces
System.out.print(" ");
}
// inner loop to handle number of columns
// values changing acc. to outer loop
for (int j=0; j<=i; j )
{
// printing stars
System.out.print("* ");
}
// ending line after each row
System.out.println();
}
}
// Driver Function
public static void main(String args[])
{
int n = 5;
printTriagle(n);
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Ans. WEB APP |WEB-INF - META-INF | | | META-INF.MF | lib - WEB.xml - Classes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  web application Asked in 3 Companies intermediate   frequent Q678. Can we have multiple inheritance in java using abstract class ? Core Java
Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  abstract class   multiple inheritance  object oriented programming (oops)  oops concepts Asked in 2 Companies Q679. What is the difference between abstraction and abstract class ? Core Java
Ans. Abstract class is one of the facility for achieving abstraction in Java. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Ans. == compares values === is used in scripting languages for comparing two values as well as there data tpe. like in js,php. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  ==  ===  == vs === Asked in 13 Companies basic   frequent Ans. https://www.geeksforgeeks.org/arrays-sort-in-java-with-examples/ Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  array  sorting Asked in 16 Companies basic   frequent Q682. How to calculate string length without using inbuilt function Core Java
This question was recently asked at 'Softenger'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  code  coding  design  string length Asked in 1 Companies basic Q683. Can we use Prototype Bean scope with Autowiring ? Spring
Ans. Default Bean scope in auto wiring is Singleton but Yes, that can be changed by specifying the Bean scope explicitly. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  spring boot   spring mvc  autowiring  bean scope   prototype bean scope intermediate Q684. What is the difference between Maven and Jenkins ? Tools
Ans. Maven is a build tool whereas Jenkins is continuous integration system.
Maven deals with application compilation, build and packaging whereas Jenkins tracks SCM for triggering builds and packages, triggering parent project builds upon dependencies, initiating builds and performing alerts. So Jenkins is kind of a wrapper around SCM and Build Tool for continuous integration and deployment. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  maven  jenkins  build tools Q685. Please explain with example different types of testing ? Testing
Ans. Unit Testing ( Junits )
Integration Testing ( Testing overall flow by calling the entry method or by calling the service end point )
Manual Testing ( End to End Manual User Testing, they way eventually it will be used by end users )
Automation Testing ( Machine replication of end to end testing ) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   basic   frequent Q686. What is MVC in GUI components ? Design
Ans. The Model/View/Controller pattern, a strategy for dividing responsibility in a GUI component.
The model is the data for the component.
The view is the visual presentation of the component on the screen.
The controller is responsible for reacting to events by changing the model.
According to the MVC pattern, these responsibilities should be handled by different objects. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  mvc  design pattern Asked in 1 Companies   rare Q687. Write SQL to get all members and the count of books they have checked out , even the ones that haven't checked out anything. SQL
This question was recently asked at 'Canopy Tax'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database  sql Asked in 1 Companies Library Management System has always been the favorite question. This questions is asked irrespective of level. Q688. Write data models and service end points for Library Management System ? Architecture
Ans. Following could be the business sub domains or database schemas in such a system
1. Users / Members
2. Sourcing
3. Inventory Management
4. Operations
Following services end points could be there
1. Users - addNewUser ( put ), removeUser ( post )
2. Sourcing - addSupplier ( put ), removeSupplier ( post )
3. Inventory Management - getInventory ( get )
4. Operations - checkIn ( post ), checkout ( post )
There could be following Tables in Database
1. Users / Members - MEMBER, MEMBERSHIP_TYPE
2. Sourcing - SUPPLIER, SUPPLIER_PRODUCT, PRODUCT_REORDER_LEVELS
3. Inventory Management - INVENTORY,PRODUCTS
4. Operations - TRANSACTION Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database  architecture  design Asked in 1 Companies Q689. How do you prefer to resolve team disputes , just talking or in written ? general
This question was recently asked at 'Canopy Tax'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q690. What is the Big O notation for Fibonacci series - both iterative as well as recursive ? Algorithm
This question was recently asked at 'Canopy Tax'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Big o Notation   Asked in 1 Companies expert