 
| 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. | 
| 
 | |||
|  | ||||
| Interview Questions and Answers - Order By Rating | ||||
|    | ||||
| 
 | ||||
|  This question was recently asked at 'Y Media 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  : | ||||
|  Discuss  Correct / Improve   log4j vs slf4j  Asked in 1 Companies | ||||
| 
 | ||||
|  This question was recently asked at 'Software AG'.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  : | ||||
|  Discuss  Correct / Improve     Asked in 1 Companies | ||||
| 
 | ||||
| Ans. 1. Property files 2. config xml 3. Database | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   config  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  : | ||||
|  Discuss  Correct / Improve   config  property files | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve   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  : | ||||
|  Discuss  Correct / Improve   Log4j | ||||
| 
 | ||||
| Ans. Generally one reducer runs for all mappers, but it can be increased as per requirements. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   Hadoop  BigData  Asked in 1 Companies | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve   Log4j  DEBUG vs TRACE | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve   Log4j  Log4j levels | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve   Log4j levels hierarchy  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  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
| Ans. 1 day | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
| Ans. By changing the Root Level within Log4j config. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
|  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  : | ||||
|  Discuss  Correct / Improve   log4j  RollingFile  RollingRandomAccessFile | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve   Log4j  TimeBasedRollingPolicy  SizeBasedTriggeringPolicy | ||||
| 
 | ||||
| Ans. Yes, but in that case the derived class itself should be abstract. We cannot have an object of a class without definition for the method which has been declared abstract in the parent. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   overriding  overriding abstract methods  abstract methods | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve   acl  file system  file security  object security  operating system | ||||
| 
 | ||||
| Ans. Abstract methods are the methods that need to be overridden in the derived class ( either as implementing method or again abstract method ) so it's not only allowed but its required to override abstract method in the derived class. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   overriding  abstract methods  overriding abstract methods | ||||
| 
 | ||||
| Ans. Yes | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   overloading  abstract methods  overloading abstract methods | ||||
| 
 | ||||
| Ans. http://introcs.cs.princeton.edu/java/11precedence/ | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   operators  operator precedence  basic | ||||
| 
 | ||||
| Ans. Substitutability means that the type of the variable does not have to exactly match with the type of the value assigned to that variable. For example - Object reference of Parent object can hold derived object. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve    | ||||
| 
 | ||||
| Ans. Through common memory area. | ||||
|  Help us improve. Please let us know the company, where you were asked this question  : | ||||
|  Discuss  Correct / Improve   threads  Asked in 1 Companies | ||||
| 
 | ||||
|  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  : | ||||
|  Discuss  Correct / Improve     Asked in 1 Companies | ||||
| 
 | ||||
|  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  : | ||||
|  Discuss  Correct / Improve     Asked in 1 Companies | ||||
| 
 | ||||
| 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  : | ||||
|  Discuss  Correct / Improve   Linkedlist  data structures  algorithm  Asked in 2 Companies  basic | ||||
|    | ||||