Interview Questions and Answers - Expert 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 - Expert Level - 83 question(s) found - Order By Rating

next 30
 Q1. Can we do a thread specific heap allocation ?Memory Management
 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     memory management  heap memory   heap allocation      expert


 Q2. Do threads have a distinct heap ?Memory Management
 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     memory management  heap memory      expert


 Q3. What is the O notation for the ArrayList and List? And which one would you choose to insert item in the middle?Data Structure
 This question was recently asked at 'ExpertSoft'.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


 Q4. How does Garbage Collector work? What are the realizations of Garbage Collector.Core Java
 This question was recently asked at 'ExpertSoft'.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


 Q5. What is something faulty about java ?Core Java
Ans. Not purely object oriented Language.

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

   Like         Discuss         Correct / Improve           expert


 Q6. What will happen if there are no interfaces in Java ?Core Java
Ans. Abstract classes can take care of that to a certain extent. Though they are little heavier than Interfaces but An abstract class with all abstract methods and no instance variables will be able to help with everything that currently an interface does.

The only problem is that a class can only extend one class whereas it can implements multiple interfaces and that is the reason Interfaces were introduced in Java, i.e to get over the problem of multiple inheritance.

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

   Like         Discuss         Correct / Improve     interfaces      expert


 Q7. Why Concurrent Collection Classes are fail-fast 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     concurrent collection classes   fail fast   fail-fast  collections  collection classes      expert


 Q8. 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


 Q9. 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


 Q10. What could be the reasons for restricting inheritance using final class ?Core Java
Ans. 1. Enforcing composition over inheritance
2. Restricting overriding of certain methods
3. Final methods are faster than regular instance methods
4. Enforcing Immutability

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

   Like         Discuss         Correct / Improve     final class   reasons for final class   restricting inheritance  object oriented programming (oops)  oops concepts      expert


 Q11. Does use of Final class enforces composition over Inheritance in Java ? Core Java
Ans. Yes, to a certain extent. But the objective for Final class could be beyond just enforcing composition as certain classes might have been created without inheritance or composition in mind.

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

   Like         Discuss         Correct / Improve     final class   composition  object oriented programming (oops)  oops concepts  inheritance  object oriented programming (oops)  oops concepts  composition  object oriented programming (oops)  oops concepts vs inheritance  object oriented programming (oops)  oops concepts      expert


 Q12. What is the Big O notation for Fibonacci series - both iterative as well as recursive ?Algorithm
 This question was recently asked at 'Canopy Tax'.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     Big o Notation       Asked in 1 Companies      expert


 Q13. How would you design a Thread Pool ?Design
Ans. By using Executor Framework , we can create Thread pool

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

   Like         Discuss         Correct / Improve     Thread Pool     Asked in 1 Companies      expert


 Q14. Design database schema for Facebook like application.Database
 This question was recently asked at '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     database design     Asked in 1 Companies      expert


 Q15. Write a method that takes a string as input and identifies if any permutation of the String is Palindrome ? For example - ttoobb has a permutation 'bottob' which is a palindrome. Design
 This question was recently asked at 'Canopy Tax'.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      expert


 Q16. What are the ways to break singleton pattern ?Design
Ans. If we don't have double checked locking, it can be broken easily through multi threaded access.

Through Reflection.

If multiple class loaders are loading the class.

If the class is serializable or cloneable.


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

   Like         Discuss         Correct / Improve     singleton     Asked in 2 Companies      expert


 Q17. Why do we need to specify import statement ? Don't you think Java could have been designed in such a way to automatically import everything that's in the class path ?Core Java
Ans. Java could design it in such a manner but would result in ambiguity if there are multiple files with the same name. The only way to get over it to show the message when you use any such class to provide explicit import with the package prefix. The other problem could be that Java might have to change the early import to Late import and check what's being used to decide what needs to be imported as otherwise you will see errors regarding the ambiguous imports with duplicate file name.

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

   Like         Discuss         Correct / Improve     import      expert


 Q18. How ConcurrentHashMap provides better performance compared to HashTable ?Core Java
Ans. ConcurrentHashMap uses multiple buckets to store Data and hence avoid read locks which facilitates better performance.

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

   Like         Discuss         Correct / Improve     ashTabl      expert        rare


 Q19. Why can we have a static inner class but not a static Top level class 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     static class  inner classes   nested classes      Expert        rare


 Q20. What are the advantage of Abstract classes over interfaces with respect to Java 7 ? and What changed in Java 8 to help facilitate that in Java 8 ?Core Java
Ans. Abstract Classes provide default implementations of methods that are inherited by the classes that extend them, which was not the case for Interfaces. This changed in Java 8, where default implementations are provided for methods.

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

   Like         Discuss         Correct / Improve     abstract classes  interfaces  default method     Asked in 1 Companies      expert


 Q21. In Java, would you like to see an explicit destructor?Core Java
Ans. Yes , a gc method to explicitly call garbage collection immediately on the object. It will provide better flexibility over application that require optimal usage of memory.

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

   Like         Discuss         Correct / Improve     destructor  garbage collection     Asked in 1 Companies      expert


 Q22. How does making string as immutable helps with securing information ? How does String Pool pose a security threat ?Core Java
Ans. String is widely used as parameter for many java classes, e.g. network connection, opening files, etc. Making it mutable might possess threats due to interception by the other code segment or hacker over internet.

Once a String constant is created in Java , it stays in string constant pool until garbage collected and hence stays there much longer than what's needed. Any unauthorized access to string Pool pose a threat of exposing these values.


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

   Like         Discuss         Correct / Improve     Security  String pool   string immutable  immutability      expert        rare


  Q23. Explain OOPs

or

Explain OOPs Principles

or

Explain OOPs Concepts

or

Explain OOPs features

or

Tell me something about OOPs
Core Java
Ans. OOPs or Object Oriented Programming is a Programming model which is organized around Objects instead of processes. Instead of a process calling series of processes, this model stresses on communication between objects. Objects that all self sustained, provide security by encapsulating it's members and providing abstracted interfaces over the functions it performs. OOP's facilitate the following features

1. Inheritance for Code Reuse
2. Abstraction for modularity, maintenance and agility
3. Encapsulation for security and protection
4. Polymorphism for flexibility and interfacing

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

   Like         Discuss         Correct / Improve     oops  oops features     Asked in 260 Companies      basic        frequent


 Q24. Why Java doesn't provide a default constructor if we define an argument constructor ?Core Java
Ans. Java provides a default constructor ( no argument ) if no constructor is provided by the programmer. Java makes a check during pre compilation if there is any constructor provided by the programmer. If any constructor is provided, Java understands that programmer has provided all the mechanism for initialization and construction of the object and may not even intend to create objects by calling a no argument constructor. For example - One may like to have objects created with self defined state otherwise restrict its creation.

We make the constructor private if we want to make a class singleton as we would like to restrict creation of new objects using new operator and default constructor. Similar could be the situation wherein we would like to construct objects in a particular manner only.

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

   Like         Discuss         Correct / Improve     default constructor      expert


 Q25. How Marker interfaces works internally ?Core Java
 This question was recently asked at 'GGK Technologies'.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     marker interfaces  interfaces     Asked in 1 Companies      expert        rare


 Q26. Which memory segment holds String Pool in Java ?Core Java
Ans. String Pool resides in runtime constant Pool which is a part of Heap memory segment.

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

   Like         Discuss         Correct / Improve     string pool  memory management      Expert        rare


 Q27. Can we declare static variables as transient ?Core Java
Ans. It's weird that compiler doesn't complain if we declare transient with static variable because it makes no sense. At least a warning message saying "transient is useless in this situation" would have helped with code cleaning.

Static variables are never serialized and transient is an indication that the specified variable shouldn't be serialized so its kind of double enforcement not to serialize.

It could be that as it makes no different to the variable behavior and hence using both keywords with a variable are permitted.

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

   Like         Discuss         Correct / Improve     static  transient  serialization     Asked in 1 Companies      expert        rare

Try 1 Question(s) Test


 Q28. Can constructor be synchronized in Java ?Core Java
Ans. No, constructors can not be synchronized in Java. In fact using the keyword synchronized with a constructor results in compilation error.

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies      expert


 Q29. How is hashcode calculated in java ?

or

What are the rules for hashcode calculation ?
Core Java
Ans. General contract of hashCode is:

1.Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer,

2.If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.

3.It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results.

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

   Like         Discuss         Correct / Improve     hashcode     Asked in 1 Companies      expert


 Q30. What is serialVersionUID ?Core Java
Ans. Everytime an object is serialized the java serialization mechanism automatically computes a hash value by passing the meta information for the class. This id is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization

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

   Like         Discuss         Correct / Improve     serialVersionUID  serialization     Asked in 3 Companies      expert        rare


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: