Hi Friends,
I'm sharing my recent interview @ NexGen Solutions. It was for the position of Technical Architect and was very simple one.
You can also go through my other real time interviews:
Interview @ Dew Solutions
Interview @ RBS
Interview @ Aricent
Question 1: What is the benefit of Executor framework?
Answer:
Executor Framework provides separation of Command submission from Command execution.
It has several interfaces. Most important ones are:
Question 2: Asked me to write custom ArrayList.
//You can write your own implementation
Question 3: In your Custom ArrayList, there are multiple methods. How will you provide synchronization?
Answer:
We have two ways of providing synchronization in this source code:
Question 4:
How did you use Amazon EC2?
Answer:
I installed EC2 instance using Amazon Management console after login into it.
I used General instance for my purpose, as in my application I needed to send multiple emails to client very fast.
Question 5:
What is the benefit of Generics in java?
Answer:
Generics provides Compile-time safety. And it also avoids ClassCastException. It was introduced in Java 5.
Question 6:
How Generic code written in java 5 runs in Java 4 compiler?
Answer:
Java compiler uses type check information at compile time and after all validation it generates type erased byte code which is similar to the byte code generated by Java 4. So, it provides backward compatibility.
Question 7: Asked about my last project.
Answer:
I explained it.
Question 8:
Why we can't pass List<String> to List<Object> in java?
Answer:
String is a subclass of Object, but List<String> is not a subclass of List<Object>.
If it would be allowed, then look at below code:
List<Object> listO = new ArrayList<String>();
listO.add("String");
listO.add(new Object());
Now, in the same List , we have both a String and Object object. Which is wrong.
That's all from this interview.
Hope this post helps everybody in their job interviews.
Thanks for reading.
I'm sharing my recent interview @ NexGen Solutions. It was for the position of Technical Architect and was very simple one.
You can also go through my other real time interviews:
Interview @ Dew Solutions
Interview @ RBS
Interview @ Aricent
Question 1: What is the benefit of Executor framework?
Answer:
Executor Framework provides separation of Command submission from Command execution.
It has several interfaces. Most important ones are:
- Executor
- ExecutorService
- ScheduledExecutorService
Executors is Factory methods class used in this framework.
Question 2: Asked me to write custom ArrayList.
//You can write your own implementation
Question 3: In your Custom ArrayList, there are multiple methods. How will you provide synchronization?
Answer:
We have two ways of providing synchronization in this source code:
- Make each method synchronized by placing synchronized keyword before return type of method
- Use synchronized block inside method body.
Question 4:
How did you use Amazon EC2?
Answer:
I installed EC2 instance using Amazon Management console after login into it.
I used General instance for my purpose, as in my application I needed to send multiple emails to client very fast.
Question 5:
What is the benefit of Generics in java?
Answer:
Generics provides Compile-time safety. And it also avoids ClassCastException. It was introduced in Java 5.
Question 6:
How Generic code written in java 5 runs in Java 4 compiler?
Answer:
Java compiler uses type check information at compile time and after all validation it generates type erased byte code which is similar to the byte code generated by Java 4. So, it provides backward compatibility.
Question 7: Asked about my last project.
Answer:
I explained it.
Question 8:
Why we can't pass List<String> to List<Object> in java?
Answer:
String is a subclass of Object, but List<String> is not a subclass of List<Object>.
If it would be allowed, then look at below code:
List<Object> listO = new ArrayList<String>();
listO.add("String");
listO.add(new Object());
Now, in the same List , we have both a String and Object object. Which is wrong.
That's all from this interview.
Hope this post helps everybody in their job interviews.
Thanks for reading.