Interview Questions and Answers for 'Compro Technologies' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Interview Questions


 3167 questions in repository.
 There are more than 200 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 for 'Compro Technologies' - 10 question(s) found - Order By Newest

Frequently asked in all types of companies especially Indian Services companies. Frequently asked in CTS (Based on 2 feedback)
  Q1. What is the use of hashcode in Java ?Core Java
Anonymous
Ans. Hashcode is used for bucketing in Hash implementations like HashMap, HashTable, HashSet etc. The value received from hashcode() is used as bucket number for storing elements. This bucket number is the address of the element inside the set/map. when you do contains() then it will take the hashcode of the element, then look for the bucket where hashcode points to and if more than 1 element is found in the same bucket (multiple objects can have the same hashcode) then it uses the equals() method to evaluate if object are equal, and then decide if contain() is true or false, or decide if element could be added in the set or not.

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


   Like      Discuss      Correct / Improve     java   collections   hashcode   advanced  hashtable     Cognizant (CTS)  Compro Technologies  VigLink  Proofpoint  Accolite  Foot Locker  IMC Trading  LG Mobile Phones  Probity Soft  EPPS Infotech  AbeBooks  LiquidNet  Google  Girmiti Software  Hashcode IT Solutions  Aurionpro Solutions  Insonix  Genpact  Trentor  CatalystOne Solutions  RedBlink  Bayatree Infocom  Security Weaver  Steg Technologies  Roshi Software Solutions  DreamSoft4u  Decipher Zone Softwares  Precise Automation & Robotics  Componence  Dainik Navajyoti  Bodacious IT Hub  Naggaro      intermediate        frequent

Try 1 Question(s) Test


  Q2. What is reflection ?
Anonymous
Ans. It is the process of examining / modifying the behaviour of an object at runtime.

  Sample Code for reflection

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

   Like      Discuss      Correct / Improve     java   reflection   reflection api   ebay   mindtree     HSBC  T.G. Mercer  Appirio  DataArt  DonLen  Rackspace  Gruppo Banca Sella  HCL Technologies  Infosys  Wipro  Tata Consultancy (TCS)  Cognizant (CTS)  SailPoint Technologies  Hospira  Virtusa  EPAM  Synechron  NSEiT  Full Creative  Knoldus Software  Mobisoft Infotech  Amdocs  Compro Technologies  Wissen Infotech  CMSS Pvt Ltd  Accenture  Accenture India      basic        frequent


 Q3. Find the third last element in a linked list ?Data Structure2017-03-27 08:53:16

Ans. First Find the number of nodes in the linked list and take it as n.then find the data at n-3 element.

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

   Like      Discuss      Correct / Improve     linkedlist     Compro Technologies


  Q4. What is a Destructor ? Do we have Destructors in Java ?Core Java

Ans. Destructor is used to de-allocate memory allocated by objects.

There are no destructors in Java. Alternatively, Java provides Automatic garbage collection i.e automatically releasing the un-referenced memory.

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

   Like      Discuss      Correct / Improve     destructor  garbage collection     Mahindra Comviva  Quinnox  MathWorks  Wipro  Publishers Clearing House (PCH)  Compro Technologies      Basic        frequent

Try 1 Question(s) Test


 Q5. Write a Program to reverse a Linked List ?Data Structure2016-12-13 14:58:09

 This question was recently asked at 'Myntra,Compro 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          Myntra  Compro Technologies


 Q6. Write a Program to print count of each character in a String.Core Java2017-01-27 20:32:20

Ans. public class BuggyBread {
public static void main(String args[]) {
Map<Character, Integer> countMap = new HashMap();
String str = "hello world";
for (char character : str.toCharArray()) {
if (countMap.containsKey(character)) {
countMap.put(character, countMap.get(character) + 1);
} else {
countMap.put(character, 1);
}
}
System.out.println(countMap);
}
}

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

   Like      Discuss      Correct / Improve     String  Code  Coding  Character     Compro Technologies


 Q7. Write a program for 0 and cross games? Core Java2017-03-27 08:48:50

 This question was recently asked at 'Compro 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     code.coding.0 and cross game     Compro Technologies


 Q8. Given 2 jars of 5 ltr and 3 ltr, how will you get 4 ltrs in one of those jars ?Puzzle2017-03-27 08:38:54

Ans. Number 1 -

Fill the 5 litre can from the tap

Empty the 5 litre can into the 3 litre can leaving 2 litres in the 5 litre can.

Pour away the contents of the 3 litre can.Fill the 3 litre can with the 2 litres from the 5 litre can leaving 2 litres in the 3 litre can.

Fill the 5 litre can from the tap.Fill the remaining 1 litre space in the 3 litre can from the 5 litre can.Leaving 4 litres in the 5 litre can.

Number 2 -

Fill the 3 litre can from the tap.Empty the contents of the 3 litre can into the 5 litre can.

Fill the 3 litre can from the tap.Empty the contents of the 3 litre can into the 5 litre can leaving the 5 litre can full and 1 litre in the 3 litre can.

Pour away the contents of the 5 litre can. Pour the 1 litre from the 3 litre can into the 5 litre can.

Fill the 3 litre can from the tap. Empty the contents of the 3 litre can into the 5 litre can leaving 4 litres in the 5 litre can.

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

   Like      Discuss      Correct / Improve          Compro Technologies


 Q9. Why do we need Garbage collection ?Core Java2017-03-27 08:44:06

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     Compro Technologies  General Atomics



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q10. Write a Program to merge two sorted arrays ?Data Structure2017-03-27 08:46:57

Ans. We can merge two sorted array by using quick sort algorithm

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

   Like      Discuss      Correct / Improve     arrays  merge sorted arrays     Compro Technologies  ECI Telecom




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

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:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: