Interview Questions and Answers - Order By Rating Q1081. Check if tic tac toe has a winner Algorithm
This question was recently asked at 'Microsoft'.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 Q1082. Write code to find the node where two linked lists intersect. Algorithm
This question was recently asked at 'Amazon'.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 Q1083. Write a function that returns the depth of a tree. Algorithm
This question was recently asked at 'Amazon'.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 Q1084. Write code to check if a Binary tree is symmetrical Algorithm
This question was recently asked at 'Amazon'.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  binary tree Asked in 1 Companies 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 This question was recently asked at 'Veritas'.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 Memory vs Demand Paging Asked in 1 Companies Q1087. Difference between log4j and slf4j ? Logging
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 : Like Discuss Correct / Improve  log4j vs slf4j Asked in 1 Companies Q1088. How will you design a Log4j kind of framework. Log4j
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 : Like Discuss Correct / Improve   Asked in 1 Companies Q1089. What are the ways in which an application can maintain config variables ?
Ans. 1. Property files
2. config xml
3. Database Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  config  property files Q1090. 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 Q1091. 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 Q1092. 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 Q1093. 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 Q1094. 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 Q1095. 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   Q1096. 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   Q1097. 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 Q1098. 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   Q1099. 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   Q1100. 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   Q1101. 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   Q1102. 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   Q1103. 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   Q1104. 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 Q1105. 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  SizeBasedTriggeringPolicyAns. 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 Q1107. Can we overload abstract methods ? Core Java
Ans. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  overloading  abstract methods  overloading abstract methods Q1108. 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 Q1109. 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 Q1110. write program to do matrix multiplication Core 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