Altisource Java Interview Questions

What do you understand by collections framework in Java programming language?

A collection is an object that groups or stores multiple objects of similar types. The objects that are stored in the collection are also called as elements of the collection.

Collections framework in Java programming language consists of the following.

1. Interfaces that represent different types of collections. 2. Concrete implementations of the collection interfaces. 3. Algorithmic implementations that perform useful computations, sorting, searching etc. on objects implementing the collection interfaces.

What are the key steps in reading writing to sockets?

1. Open a socket 2. Open an input stream and output stream to a socket

*** See complete answer in the Java Interview Guide.

What is the difference between RecursiveTask and RecursiveAction?

RecursiveTask’s compute() method returns a value, whereas RecursiveAction’s compute() method returns void…

*** See complete answer in the Java Interview Guide

How many parameters can a lambda expression have?

A lambda expression can have zero, one or multiple parameters.

How do you sort an array of objects using the java.util.Arrays class?

The java.util.Arrays utility class provides the sort() method that sorts an array of objects in ascending order, according to the natural ordering of its elements.

Implemenation Algorithm – The sort() method for sorting arrays containing objects uses Mergesort algorithm instead of the Quicksort algorithm used for sorting arrays containg primitive data types.

Time Complexity – O(N log(N))

*** See complete answer and code snippet in the Java Interview Guide.

Java programming language provides numerous kinds of data structures and packages them within the Collections API. Java collections interview questions are very frequently asked both in telephonic screening interviews as well as in face-to-face interviews.

Following are some frequently asked questions in Java – Collections

What are Java class loaders? What are the key features of Java class loader

Java class loaders are components in JVM that load Java class file at runtime, when they are referenced for the first time. Each class loader has its own specific namespace, in which it stores the classes that it loads.

Following are the key characteristics of Java class loaders

Hierarchy – Java class loaders in JVM are hierarchal with a parent-child relationship. Bootstrap class loader is the parent of all class loaders.

Delegation model – Before a class loader loads a class, it checks if its parent class loader has already loaded that class. If the parent class loader has loaded that class, then that class is used. If the parent class loader has not loaded the class, then the child class loader loads the class and uses it.

Visibility – …

*** See complete answer in the Java Interview Guide

What are the benefits and dis-advantages of garbage collector?

Benefits:

  • Garbage collector automatically manages the JVM memory by deleting objects that are no longer referenced and used. A Java developer can concentrate on program logic instead of worrying about object deletion and memory management.
  • The garbage collector has inbuilt efficient algorithms which determine when to run the garbage collector.
  • Dis-advantages:

  • There is a possibility that during garbage collection process the application performance may be impacted. In certain situations, called stop the world, the application process is completely stopped while the garbage collection process takes place.
  • You can indicate to the JVM to run the garbage collector, but it is not guaranteed. So as a developer you do not know when the garbage collection process happens.
  • During garbage collection process, the JVM may stop all the application process threads from execution. This freezing of application processes is termed as Stop The World

    Nailing your Java Interview

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *