Interview Questions and Answers - Order By Newest Q2011. 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 Q2012. 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 Q2013. 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 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 Q2015. 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 Q2016. 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 Q2017. 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 Q2018. 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 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 Q2020. 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 Q2021. 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 Q2022. 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 Q2023. 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 Q2024. 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 Q2025. 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 Q2026. 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 Q2027. 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 Q2028. 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 Q2029. 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 Q2030. 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 Q2031. 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 Q2032. Are final methods faster than regular instance methods ? Core Java
Ans. Yes. As they cannot be overridden , there is no use of virtual table concept which is used for dynamic binding resolution. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  final methods   final keyword expert Q2033. What is virtual table with respect to method overriding in Java ? 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  vtable  virtual method table   method overriding  runtime polymorphism  object oriented programming (oops)  oops concepts Q2034. How is the virtual method table implemented in Java? 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  virtual method table   method overriding  runtime polymorphism  object oriented programming (oops)  oops concepts expert   rare Q2035. How many VTables are there for each class ? Core Java
Ans. There is one VTable for each class. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  virtual table method  vtable  runtime polymorphism  object oriented programming (oops)  oops concepts   method overriding intermediate   rare Q2036. Can an In Memory Data Management play a significant role for Big Data Analytics? BigData
This question was recently asked at 'Jean Martin'.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 Q2037. Explain the use of Client certificates for authentication ? Authentication
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  authentication  client certificates Q2038. How cookies helps by storing encrypted passwords ? Authentication
Ans. It helps user autofill password on the form where its presented for authentication Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  cookie  authentication Q2039. Have you ever worked with encrypted Tokens and How ? Authentication
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   Q2040. How did you use authentication in node.js ? Node,js
Ans. Using JWT Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  authentication  node.js Asked in 2 Companies