Recently I had a technical discussion in one interview process. He asked me below scenario,
Class Employee
{
int empId;
String empName;
String salary;
}
Now I'm storing 1000 (This could go high) employee object in an Arraylist. What is the best way in terms of time complexity, wherein I could search by empName from this list.
Can anyone please suggest the best possible way for this...?