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

Search Java Interview Questions


 2158 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Ancestry


   




Interview Questions and Answers for 'Ancestry' - 10 question(s) found - Order By Newest

Very frequently asked in different variations. Frequently asked in Deloitte ( 2 feedback ) , HCL Tech ( 3 feedback ) and Coginizant (CTS)
  Q1. Explain the scenerios to choose between String , StringBuilder and StringBuffer ?

or

What is the difference between String , StringBuilder and StringBuffer ?
Core Java
Anonymous
Ans. If the Object value will not change, use String Class because a String object is immutable.

If the Object value can change and will only be modified from a single thread, use StringBuilder because StringBuilder is unsynchronized(means faster).

If the Object value may change, and can be modified by multiple threads, use a StringBuffer because StringBuffer is thread safe(synchronized).

  Sample Code for String

  Sample Code for StringBuffer

  Sample Code for StringBuilder

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

   Like      Discuss      Correct / Improve     java   string class   string   stringbuilder   stringbuffer     Cognizant (CTS)   San Jose State University (SJSU)  HCL Technologies   Deloitte  Sophos  Hitachi  JPMorgan Chase  IBM  Kony Labs  Keystone  ebay  TIAA Financial Services  Ancestry   Rakuten      basic        frequent

Try 3 Question(s) Test


Frequently asked in face to face interviews.
  Q2. Write a program to print fibonacci series.Core Java

Ans. int count = 15;
int[] fibonacci = new int[count];
fibonacci[0] = 0;
fibonacci[1] = 1;
for(int x=2; x < count; x++){
fibonacci[x] = fibonacci[x-1] + fibonacci[x-2];
}

for(int x=0; x< count; x++){
System.out.print(fibonacci[x] + " ");
}

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

   Like      Discuss      Correct / Improve     ebay   fibonacci series     Manvish eTech  Belvedere Trading  King UK  FinaTel  Goldman Sachs  Enlighten Software  Misys  Mahindra Comviva  ZapCom  Nucleus Software Exports  Enlighten  Sears  Mahindra Satyam  Insperity  General Motors  AVIS e Solutions  Paddy Power Betfair  TurningCloud  Polestar Solutions  BlueWhale Solutions  CitiusTech  Zuhlke  Comcast  KGFSL  Quickr  Paramatrix Technologies  CalSoft  Ancestry.com  OnMobile Global  NBCUniversal  Inventum Technologies  Hughes Systique  Flextronics  Geometric Soft  Check Point Software Technologies  ZapLabs  Indecomm Global Services  HTC Global  Quovantis Technologies  Mobiloitte  Riktam Technologies  DMX Technologies  Mojo Networks  Tata Elxsi  Ciena  ServiceNow  EverBridge  LendingClub  Virtusa Polaris  West Corporation  Ebay  Walmart  HomeAway  AllClear ID  Quinnox Software  Acquity Group  Cadence Design Systems  SmartPrix  Leidos  Zoho  Varian Medical Systems  HealthSparq      basic        frequent


 Q3. Why shouldn't we use string concatenation extensively or in a loop ?Core Java2017-08-08 09:52:53

Ans. Because String being an immutable object creates a new object upon each concatenation cycle. If there is any such need , we should use String Builder whose object is immutable.

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

   Like      Discuss      Correct / Improve     string  string immutable     Ancestry


 Q4. What do you do when told to do something that you don't agree with? General2017-08-24 19:58:50

 This question was recently asked at 'Ancestry,Sofi'.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          Ancestry  Sofi


 Q5. Which immutable classes have you worked with ? Can you name some immutable Collections ? How to make an immutable collection ?Core Java2017-08-28 17:11:22

 This question was recently asked at 'Ancestry,HCL Technologies,Tata Consultancy (TCS)'.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     immutability  immutable classes   immutable collections     Ancestry  HCL Technologies  Tata Consultancy (TCS)


 Q6. What are the benefits of immutability or Immutable classes ?Core Java2017-08-28 19:36:18

Ans. Immutable objects are thread-safe so you will not have any synchronization issues.Immutable objects are good for Map keys and Set elements, since these typically do not change once created.Immutability makes it easier to write, use and reason about the code (class invariant is established once and then unchanged)Immutability makes it easier to parallelize your program as there are no conflicts among objects.The internal state of your program will be consistent even if you have exceptions.References to immutable objects can be cached as they are not going to change.

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

   Like      Discuss      Correct / Improve     immutable classes   benefits of immutable classes     Ancestry


 Q7. What is the difference between SDLC and Agile ?Process2017-08-28 19:37:08

 This question was recently asked at 'Ancestry,HCL Technologies,Infosys'.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     sdlc  agile  adlc vs agile     Ancestry  HCL Technologies  Infosys


 Q8. What is the difference between Kan Ban and Agile ? Which one do you prefer ?Process2017-08-28 19:37:30

 This question was recently asked at 'Ancestry'.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     kanban  agile  kanban vs agile     Ancestry


 Q9. How is LinkedList collection class internally implemented ? Is it a Linked List or Doubly Linked List ? Core Java2017-08-28 19:40:39

 This question was recently asked at 'Ancestry'.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     linkedlist  internal implementation of linkedlist     Ancestry



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



  Q10. What is collection framework in Java ?Core Java2017-12-27 19:17:14

 This question was recently asked at 'Tata Consultancy (TCS),HCL Technologies,Ancestry,Cerner,Accenture,Global Logic,MasterCard'.This question is still unanswered. Can you please provide an answer.


  Sample Code for Map

  Sample Code for HashMap

  Sample Code for Treemap

  Sample Code for set

  Sample Code for hashset

  Sample Code for treeset

  Sample Code for list

  Sample Code for arraylist

  Sample Code for linkedlist

  Sample Code for queue

  Sample Code for priorityqueue

  Sample Code for concurrenthashmap

  Sample Code for vector

  Sample Code for stack

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

   Like      Discuss      Correct / Improve     collections     Tata Consultancy (TCS)  HCL Technologies  Ancestry  Cerner  Accenture  Global Logic  MasterCard      basic        frequent




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

2 person from Ashburn are looking for questions for 'Ancestry'. Connect with them to better prepare for your interview.Click here and post a message

Ancestry: Coding assignment comprising of 3 questions, 1 object oriented ... Anonymous

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: