Interview Questions and Answers for 'Emory' | 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

   
 Q41. Why do we need Garbage collection ?Core Java
Ans. Garbage collection mechanism frees up the memory that is no longer needed. In languages like C / C++ the deallocation needs to be done explicitly by the programmer and hence any leniency may result in memory leak. Garbage collection in java ensures that all unused memory is reclaimed and hence there are no memory leaks.Moreover it relieves the programmer from the hassle of carefully releasing all memory.

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

   Like         Discuss         Correct / Improve     Garbage Collection  memory management     Asked in 2 Companies


 Q42. What is JVM ?Core Java
Ans. JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.JVMs are available for many hardware and software platforms (i.e. JVM is platform dependent).Runtime Instance Whenever you write java command on the command prompt to run the java class, an instance of JVM is createdThe JVM performs following operation:Loads codeVerifies codeExecutes codeProvides runtime environment

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

   Like         Discuss         Correct / Improve     memory management  jvm     Asked in 3 Companies      basic        frequent


 Q43. How is garbage collection in Java 8 different from Java 7 ? 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     memory management  garbage collection


 Q44. What is the purpose of String Pool ? Don't you think it's a performance overhead to have unnecessary check for string in string pool ?Core Java
Ans. String Pool makes Java more memory efficient by providing a reusable place for string literals. It might be a little performance inconvenience but results in good amount memory saving.

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

   Like         Discuss         Correct / Improve     string pool  memory management      Intermediate


 Q45. In which memory segment - heap or stack, the following stored by JVM

1. static members
2. objects
3. object references
4. local or method variables

Core Java
Ans. static members are stored in method area of heap

objects are stored on heap

object references are stored on stack

local or method variables are stored on stack

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

   Like         Discuss         Correct / Improve     jvm  memory management  stack  heap


 Q46. What are different methods to get the permanent gen space of running application?Core Java
 This question was recently asked at 'Apcolite'.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     jvm  memory management     Asked in 1 Companies      advanced


 Q47. Which memory segment is cleaned by Garbage Collection - stack or heap ?Core Java
Ans. Heap as objects are stored ink heap.

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

   Like         Discuss         Correct / Improve     memory management   stack  heap  garbage collection


 Q48. Which memory segment holds the byte code ?Core Java
Ans. Code Segment

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

   Like         Discuss         Correct / Improve     Memory Management  Code Memory Segment  Code Segment Memory  Code Segment


 Q49. How many heaps will be there with 3 threads ?Core Java
Ans. All threads share a common heap.

Each thread has a private stack, which it can quickly add and remove items from. This makes stack based memory fast, but if you use too much stack memory, as occurs in infinite recursion, you will get a stack overflow.

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

   Like         Discuss         Correct / Improve     memory management  heap memory     Asked in 1 Companies


 Q50. Explain memory leaks and how to prevent them.
 This question was recently asked at 'Polaris'.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 leak     Asked in 1 Companies


 Q51. Should we do anything to avoid memory leaks in Java ?Core Java
Ans. Java has a intrinsic way of checking leaks and reclaiming memory called garbage collection. Moreover Java doesn't support pointer arithmetics , so there is very low comparative chance of memory leaks, compared to C,C++

Though there may be tools that may audit code to make sure that we are not leaving much for the garbage collection to work but I have never heard anyone doing anything for memory leaks in Java.

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

   Like         Discuss         Correct / Improve     memory leak in java


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


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


 Q54. Function variables are kept in ..Core Java
a. Stack
b. Heap
c. Both Stack and Heap
d. None of them

Ans.a. Stack

 Q55. Which memory segment holds String Pool ?Core Java
a. Stack
b. Heap
c. Code Segment
d. Class Segment

Ans.b. Heap

 Q56. In this code

public class BuggyBread1{
   private static String staticVariable = "static Variable";
   
   private String instanceVariable = "instance Variable";
   
   public static void main (String args[]) {
String localVariable = "local Variable";
}
}

Where will the value 'static Variable' be stored ?
Core Java
a. Stack Memory Segment
b. Heap Memory Segment
c. Runtime Constant Pool within Heap Segment
d. Code Segment

Ans.c. Runtime Constant Pool within Heap Segment

 Q57. In this code

public class BuggyBread1{
   private static String staticVariable = "static Variable";
   
   private String instanceVariable = "instance Variable";
   
   public static void main (String args[]) {
String localVariable = "local Variable";
}
}

Where will the value 'static Variable' be stored ?
Core Java
a. Stack Memory Segment
b. Heap Memory Segment
c. Runtime Constant Pool within Heap Segment
d. Code Segment

Ans.c. Runtime Constant Pool within Heap Segment

 Q58. In this code

public class BuggyBread1{
   private static String staticVariable = "static Variable";
   
   private String instanceVariable = "instance Variable";
   
   public static void main (String args[]) {
String localVariable = new String("local Variable");
}
}

Where will the value 'local Variable' be stored ?
Core Java
a. Stack Memory Segment
b. Heap Memory Segment
c. Runtime Constant Pool within Heap Segment
d. Code Segment

Ans.a. Stack Memory Segment

 Q59. In this code

public class BuggyBread1{
   private static String staticVariable = new String("static Variable");
   
   private String instanceVariable = "instance Variable";
   
   public static void main (String args[]) {
String localVariable = "local Variable";
}
}

Where will the value 'static Variable' be stored ?
Core Java
a. Stack Memory Segment
b. Heap Memory Segment
c. Runtime Constant Pool within Heap Segment
d. Code Segment

Ans.b. Heap Memory Segment

 Q60. Which of following memory segment is cleaned by Garbage Collection Mechanism ?Core Java
a. Stack
b. Heap
c. Code
d. Cache

Ans.b. Heap

previous 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: