Optum (United Health Group) | Java Full Stack Developer | Hyderabad | Oct 2020
Anonymous User
1445

F2F - Technical Interview Round 2 - Experience (2 yrs)

Problem - 1 : OOPS Encapsulation
Given a class employee which has id, name, salary as data members. The aim is to pass an object of this class to business layer under one of the following scenarios -

  • Scenario 1 :
    The class has public data members.
  • Scenario 2 :
    The class has private data members along with getters and setters.
  • Question - Which scenario would you prefer and why ?

Problem - 2
You are given 3 tables (T1, T2 and T3). During execution of a particular transaction data was committed to T1 and T2 but the system crashed and failed to update the table T3.

  • Question - How will you deal with this situation (either you re-commit or rollback/cleanup the previous tables) in Java ?
Comments (0)