Interview Questions and Answers for 'L' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

   next 30
 Q1091. Where do you see yourself in next 5 years? General
Ans. Sample Answers -

Getting better with upcoming technologies and be a Lead developer.

In accordance with the company, working as a permenant employee.

Be an associate architect.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 2 Companies


 Q1092. What are the daily activities of build and release engineer ?
 This question was recently asked at 'greeteck infosolutions'.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     build and release     Asked in 1 Companies


 Q1093. What does the following exception means

org.hibernate.LazyInitializationException: could not initialize proxy - no Session
Hibernate
Ans. The error states that Hibernate is not able to initialize proxy / dependent entity objects as there is no session or transaction present. Very likely we are trying to load the dependent entities lazily but the call to dependent object property is not wrapped within the session or transaction.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Lazy Loading  Lazy Initialization  org.hibernate.LazyInitializationException


 Q1094. If you are given choice to avoid LazyInitializationException using any of the following measures, which are the ones you will choose and why ?

1. Set lazy=false in the hibernate config file.
2. Set @Basic(fetch=FetchType.EAGER) at the mapping.
3. Make sure that we are accessing the dependent objects before closing the session.
4. Force initialization using Hibernate.initialize
Hibernate
Ans. First resolution is a big No as it conveys no lazy loading in complete app. even second is advocating the same but for a particular mapping.

third one is most appropriate if loading and dependent entity property access is closer to each other in code and can be accomplished.

I don't mind using 4th too.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     lazy loading  lazy initialization  LazyInitializationException


 Q1095. Is it advisable to keep session or transaction open for long time just to avoid LazyInitializationException ?Hibernate
Ans. No. It's a resource and performance overhead.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     LazyInitializationException  Lazy Loading


 Q1096. How to create list that will sort it's elements dynamically?Algorithm
Ans. Override the behavior of collection class to sort the list upon each element addition. Though it's not recommended as list are sorting heavy data structures.

List<MyType> list = new ArrayList<MyType>() {
public boolean add(MyType mt) {
super.add(mt);
Collections.sort(list, comparator);
return true;
}
};

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies      intermediate


 Q1097. What is an execution engine within JVM ?Core Java
Ans. Execution engine contains interpreter and JIT compiler, which covert byte code into machine code.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     jvm  execution engine  compiler     Asked in 1 Companies


 Q1098. Write program to create a linked list and perform different operations on it.Algorithm
Ans. import java.util.*;
class LinkedListSolution{
protected LinkedList list;
public LinkedListSolution(){
list = new LinkedList();
}
public Object pop() throws NoSuchElementException{
if(list.isEmpty())
throw new NoSuchElementException();
else
return list.removeFirst();
}
public void push(Object obj){
list.addFirst(obj);
}
public Object peek() throws NoSuchElementException{
if(list.isEmpty())
throw new NoSuchElementException();
else
return list.getFirst();
}
public boolean isEmpty(){
return list.isEmpty();
}
public String toString(){
return list.toString();
}
}
class TestStack{
public static void main(String args[]){
LinkedListSolution s = new LinkedListSolution();
s.push("First");
s.push("Second");
s.push("Third");
System.out.println("Top: " s.peek());
s.push("Fourth");
while(!(s.isEmpty()))
System.out.println(s.pop());
}
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Linkedlist  data structures  algorithm     Asked in 2 Companies      basic


 Q1099. write program to do matrix multiplicationCore Java
 This question was recently asked at 'Kony Labs'.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


 Q1100. Can the foreign key column have null values ?Database
 This question was recently asked at 'Volkswagen It services'.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


 Q1101. How do threads share information ?Core Java
Ans. Through common memory area.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     threads     Asked in 1 Companies


 Q1102. What is ACL ?Operating System
Ans. Access Control List or ACL is the list of permissions attached to an object in the File System.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     acl  file system  file security  object security  operating system


 Q1103. Write a Program to delete a node from Linked List ?Data Structure
 This question was recently asked at 'Caprus IT'.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     linkedlist  delete a node from linked list     Asked in 1 Companies


 Q1104. What is the difference between TimeBasedRollingPolicy and SizeBasedTriggeringPolicy within Log4j ? Can we use both together and What would that mean ?Log4j
Ans. TimeBasedRollingPolicy enables rolling of logs based on the time / days whereas SizeBasedTriggeringPolicy enables rolling of logs based on size cap.

Yes we can use both together. In that case Logs will be rolled in case any of the condition is met i.e after the interval or if the size is reached.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Log4j  TimeBasedRollingPolicy  SizeBasedTriggeringPolicy


 Q1105. What is the difference between RollingFile and RollingRandomAccessFile in log4j ?
Log4j
 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     log4j  RollingFile  RollingRandomAccessFile


 Q1106. How can we change the Log level for the application ?Log4j
Ans. By changing the Root Level within Log4j config.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q1107. What is the default interval for TimeBasedTriggeringPolicy, if specified none like following

<Appenders>
<RollingFile name="RollingFile" fileName="logs/xyz.log" filePattern="logs/xyz-%d{MM-dd-yyyy}.log.gz"
ignoreExceptions="false">
      <TimeBasedTriggeringPolicy />
   </RollingFile>
</Appenders>
Log4j
Ans. 1 day

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q1108. In following log4j configuration file, How should we change the logging level to WARN

<Configuration status="DEBUG">
<Appenders>
<RollingFile name="File" fileName="logs/xyz.log" filePattern="logs/xyz-%d{MM-dd-yyyy}.log.gz">
      <TimeBasedTriggeringPolicy />
   </RollingFile>
</Appenders>
<Loggers>
<Root level="DEBUG">
<AppenderRef ref="File" />
</Root>
</Loggers>
</Configuration>
Log4j
Ans. We should change the root level from DEBUG to WARN

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q1109. in the following log4j config file, How should we change the file name and format


<Configuration status="DEBUG">
<Appenders>
<RollingFile name="File" fileName="logs/xyz.log" filePattern="logs/xyz-%d{MM-dd-yyyy}.log.gz">
      <TimeBasedTriggeringPolicy />
   </RollingFile>
</Appenders>
<Loggers>
<Root level="DEBUG">
<AppenderRef ref="File" />
</Root>
</Loggers>
</Configuration>
Log4j
Ans. We can specify the file name with fileName property within RollingFile. File name pattern for the rolled logs can be specified using filePattern property.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q1110. In the following log4j config, What if we don't need rolling logs

<Configuration status="DEBUG">
<Appenders>
<RollingFile name="File" fileName="logs/xyz.log" filePattern="logs/xyz-%d{MM-dd-yyyy}.log.gz">
      <TimeBasedTriggeringPolicy />
   </RollingFile>
</Appenders>
<Loggers>
<Root level="DEBUG">
<AppenderRef ref="File" />
</Root>
</Loggers>
</Configuration>
Log4j
Ans. We can change the appender from RollingFile to File or we can specify a new File appender and set that within AppenderRef

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q1111. What are some of the Log4j appenders ?Log4j
Ans. https://logging.apache.org/log4j/2.x/manual/appenders.html

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q1112. Can you organize following Log4j levels in hierarchy ?

WARN, DEBUG,INFO, ERROR
Log4j
Ans. DEBUG
INFO
WARN
ERROR

Root Log level of DEBUG will print all
Root Log Level of INFO will print INFO, WARN and ERROR
Root Log level of WARN will print WARN and ERROR
Root Log level of ERROR will print ERROR alone

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Log4j levels hierarchy  Log4j


 Q1113. What are the application Logging levels specified in your applications ? Log4j
Ans. In our Organization, the policy is to keep it WARN in production so as to reduce logging Noise. We use Info in Test environments.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q1114. What should be the logging level while logging exceptions ?Log4j
Ans. It depends on how severe the exception is. If the exception is completely unexpected and breaks the request, It should be logged as ERROR or FATAL. If it's not expected but we can live with it and the application request continue in-spite of it, It should be WARN. If it's expected , it can be just INFO.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q1115. What is the difference between INFO and DEBUG logging levels ?Log4j
Ans. Info Messages are something which we would like to see even if the application is in best of state. DEBUG messages are usually something that we would like to see while debugging some problem. DEBUG is lower level than Info. Any message logged with info gets printed if the Root level set is DEBUG.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Log4j  Log4j levels


 Q1116. What is the difference between DEBUG and TRACE logging levels ?Log4j
Ans. TRACE designates finer grained informational events than the DEBUG.TRACE is level lower than DEBUG.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Log4j  DEBUG vs TRACE


 Q1117. How to change the backup log directory using log4j ?Log4j
Ans. There is a property called "filePattern" within appender that regulates where the backed up files will be created for rolling logs. It actually contains the absolute path which can be modified to have backed up logs within some other directory.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Log4j


 Q1118. What does the property maxBackupIndex in Log4j means ?Log4j
Ans. It means that the app will only maintain these many backed up log files. Older backed up logs will be deleted.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Log4j


 Q1119. What is the use of Property files ?
Ans. Property files are used to maintain configurable values as key value pairs.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     config  property files


 Q1120. Explain bubble sort.Algorithm
Ans. array is traversed from first element to last element. Here current element is compared with next element. If current element is greater than next element it is swapped.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     sorting  bubble sort     Asked in 1 Companies


previous 30   next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: