Interview Questions and Answers - Intermediate Level | 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
 Q41. Does java allow implementation of multiple interfaces having Default methods with Same name and Signature ?Core Java
Ans. No. Compilation error.

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

   Like         Discuss         Correct / Improve     java   java8   default method   yes-no     Asked in 1 Companies      intermediate


 Q42. Difference between Stack and Heap memory ?Core Java
Ans. Stack memory areas is used to hold method and local variables while objects are always allocated memory in the heap. The heap memory is shared between multiple threads whereas Stack memory isn't.

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

   Like         Discuss         Correct / Improve     java   memory management   stack memory   heap memory   difference between   ebay     Asked in 2 Companies      intermediate        frequent

Try 1 Question(s) Test


Recently asked in Capital One.
 Q43. What will happen if we call perform(null) ?

public void perform(Object obj) {
System.out.println("Object");
}

public void perform(Integer int) {
System.out.println("Integer");
}
Core Java
Ans. compiler will throws error as ambiguous methods

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

   Like         Discuss         Correct / Improve     overloading   method overloading     Asked in 1 Companies      intermediate


Very Frequently asked to Senior Software Engineers or Developers.
  Q44. Describe some of the Design Patterns you have used ?Design
Ans. [Open Ended Answer]

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

   Like         Discuss         Correct / Improve     design patterns     Asked in 17 Companies      intermediate        frequent


  Q45. What is database Normalization ?Database
Ans. https://en.wikipedia.org/wiki/Database_normalization

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

   Like         Discuss         Correct / Improve     normalization  database     Asked in 35 Companies      intermediate        frequent


 Q46. When is the situation when finally section won't execute ?Core Java
Ans. If the process / app is abruptly killed or terminated.

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

   Like         Discuss         Correct / Improve     exception handling  finally     Asked in 2 Companies      intermediate

Try 1 Question(s) Test


 Q47. How can we ensure thread safety in static method ?Core Java
Ans. By using synchronized static method or synchronized block

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

   Like         Discuss         Correct / Improve     threads  synchronization  static methods     Asked in 2 Companies      intermediate


 Q48. Describe structure of a Web application.architecture
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


 Q49. Does java allow overriding static methods ?Core Java
Ans. No. Static methods belong to the class and not the objects. They belong to the class and hence doesn't fit properly for the polymorphic behavior.

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

   Like         Discuss         Correct / Improve     java   oops   static   static method   overriding      intermediate

Try 3 Question(s) Test


 Q50. What are transient variables in java?Core Java
Ans. Transient variables are variable that cannot be serialized.

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

   Like         Discuss         Correct / Improve     java   serialization   transient     Asked in 15 Companies      intermediate        rare


 Q51. Why Java don't use pointers ?
Ans. Pointers are vulnerable and slight carelessness in their use may result in memory problems and hence Java intrinsically manage their use.

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

   Like         Discuss         Correct / Improve     java   jvm   memory management   pointers      intermediate


 Q52. What is the difference between System.console.write and System.out.println ?
Ans. System.console() returns null if your application is not run in a terminal (though you can handle this in your application)System.console() provides methods for reading password without echoing charactersSystem.out and System.err use the default platform encoding, while the Console class output methods use the console encoding

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

   Like         Discuss         Correct / Improve     java   system class   system.out.println   system.console.write   input output   java6      intermediate        rare


Usually asked only to fresh graduates and less experienced developers.
  Q53. What is a daemon thread? Give an Example ?
Ans. These are threads that normally run at a low priority and provide a basic service to a program or programs when activity on a machine is reduced. garbage collector thread is daemon thread.

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

   Like         Discuss         Correct / Improve     java   threads   multi threading   operating system   daemon thread   garbage collection     Asked in 10 Companies      intermediate        frequent

Try 2 Question(s) Test


 Q54. Does every class needs to have one non parameterized constructor ?Core Java
Ans. No. Every Class only needs to have one constructor - With parameters or without parameters. Compiler provides a default non parameterized constructor if no constructors is defined.

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

   Like         Discuss         Correct / Improve     java   oops   constructor   default constructor   yes no      intermediate

Try 3 Question(s) Test


 Q55. Can we use "this" within static method ? Why ?Core Java
Ans. No. Even though "this" would mean a reference to current object id the method gets called using object reference but "this" would mean an ambiguity if the same static method gets called using Class name.

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

   Like         Discuss         Correct / Improve     java   oops   static   this keyword   this   yes no   why questions      intermediate


  Q56. What is Comparable Interface?Core Java
Ans. It is used to sort collections and arrays of objects using the collections.sort() and java.utils. The objects of the class implementing the Comparable interface can be ordered.

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

   Like         Discuss         Correct / Improve     java   collections   comparable interface     Asked in 7 Companies      intermediate        frequent

Try 1 Question(s) Test


 Q57. What is the Locale class?
Ans. The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region

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

   Like         Discuss         Correct / Improve     java   locale   internationalization      intermediate        rare


 Q58. How do you check memory leak in Java?Core Java
Ans. You need to capture heap dump when it's in the healthy state. Start your application. Let it take real traffic for 10 minutes. At this point, capture heap dump. Heap Dump is basically the snapshot of your memory. It contains all objects that are residing in the memory, values stored in those objects, inbound

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

   Like         Discuss         Correct / Improve     memory leaks  heap dump     Asked in 1 Companies      intermediate


 Q59. Difference between PATH and CLASSPATH ?Operating System
Ans. PATH is the variable that holds the directories for the OS to look for executables. CLASSPATH is the variable that holds the directories for JVM to look for .class files ( Byte Code ).

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

   Like         Discuss         Correct / Improve     java   path   classpath   byte code   jvm   basic interview question     Asked in 3 Companies      intermediate        rare


Very Frequently asked. Favorite question in walkins and telephonic interviews. Usually among first few questions. Asked in different variants. Must know for intermediate and expert professionals.Among Top 10 frequently asked questions.
  Q60. What is rule regarding overriding equals and hashCode method ?Core Java
Ans. A Class must override the hashCode method if its overriding the equals method.

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

   Like         Discuss         Correct / Improve     java   collections   hashcode  hash code   equals   collections     Asked in 44 Companies      intermediate        frequent

Try 1 Question(s) Test


 Q61. Is It Good to use Reflection in an application ? Why ?Core Java
Ans. no, It's like challenging the design of application.

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

   Like         Discuss         Correct / Improve     java   reflection api   yes-no   architecture     Asked in 1 Companies      intermediate


Very frequently asked. Usually followed by questions related to private constructor and synchronized access. Frequently asked in JPMorgan and TCS (Based on 2 feedback)
  Q62. Explain Singleton Design Pattern ?Design
Ans. http://www.buggybread.com/2014/03/java-design-pattern-singleton-interview.html

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

   Like         Discuss         Correct / Improve     java   design pattern   singleton   at&t   ebay  fidelity india  united healthcare india     Asked in 46 Companies      intermediate        frequent


 Q63. Can we extend an Enum ?Core Java
Ans. No. Enums are final by design.

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

   Like         Discuss         Correct / Improve     java   enums   inheritance  object oriented programming (oops)  oops concepts   yes-no     Asked in 1 Companies      intermediate


 Q64. What is Closeable ?Core Java
Ans. A Closeable is an interface which is a source or destination of data that can be closed.

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

   Like         Discuss         Correct / Improve     closeable   interfaces      intermediate        rare


 Q65. Name few Locale classes and interfaces ?
Ans. http://www.buggybread.com/2015/01/java-locale-classes-and-interfaces.html

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

   Like         Discuss         Correct / Improve     java   util   java.util   locale      intermediate        rare


 Q66. What is collision in hash collections ?Core Java
Ans. Collision is the situation when two different elements have the same Hash Code.

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

   Like         Discuss         Correct / Improve     java   collections   collision   hashcode  hash code   hash collections   ebay     Asked in 1 Companies      intermediate        frequent


 Q67. When are static and instance methods resolved ? During compile time or Runtime ?
Ans. Static methods are resolved during compile time and hence they cannot participate in runtime polymorphism. Instance methods are resolved during runtime.

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

   Like         Discuss         Correct / Improve     java   static methods   methods   runtime polymorphism      intermediate


 Q68. What are fail-fast Iterators ?Core Java
Ans. Fail-fast iterators detect illegal concurrent modification during iteration and fail quickly and cleanly rather than risking arbitrary, non deterministic behavior at an undetermined time in future. Example could be of an Iterator failing if it smells ConcurrentModificationException.

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

   Like         Discuss         Correct / Improve     fail-fast Iterators  Iterators     Asked in 5 Companies      intermediate


 Q69. What is the use of Synchronized block ?Core Java
Ans. The goal of a synchronised block is to achieve mutual exclusion i.e at one time, the segment of the code should be executed by single thread only and hence the lock needs to be retrieved before executing the segment and then released.

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

   Like         Discuss         Correct / Improve     synchronized block   synchronized   synchronization   multithreading   threads   mutual exclusion   concurrency     Asked in 4 Companies      intermediate        frequent

Try 1 Question(s) Test


Recently asked in Sophos
 Q70. Write a Method to get a map of words and their count by passing in the stringCore Java
Ans. http://javasearch.buggybread.com/CodeSnippets/searchCodeSamples.php?keyword=Method+to+get+a+map+of+words&category=code

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

   Like         Discuss         Correct / Improve     map  collections     Asked in 2 Companies      intermediate


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: