Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
This round had questions from Java, OOPS and MVC. More emphasis was given on the fundamentals of the subject rather than the advanced topics.
How ConcurrentHashMap works in Java
According to ConcurrentHashMap Oracle docs,
The constructor of ConcurrentHashMap looks like this :
public ConcurrentHashMap (int initialCapacity, float loadFactor, int concurrencyLevel)
So the above line creates a new, empty map with the specified initial capacity, load factor and concurrency level.
where,
Important Parameters to consider from ConcurrentHashMap Constructor :
initialCapacity - the initial capacity. The implementation performs internal sizing to accommodate this many elements.
concurrencyLevel - the estimated number of concurrently updating threads. The implementation performs internal
sizing to try to accommodate this many threads.
In the ConcurrentHashMap Api , you will find the following constants.
static final int DEFAULT_INITIAL_CAPACITY = 16;
static final int DEFAULT_CONCURRENCY_LEVEL = 16;
initial capacity parameter and concurrency level parameters of ConcurrentHashMap constructor (or Object) are set to
16 by default.
1) Thus, instead of a map wide lock, ConcurrentHashMap maintains a list of 16 locks by default ( number of locks
equal to the initial capacity , which is by default 16) each of which is used to lock on a single bucket of the Map.
2) This indicates that 16 threads (number of threads equal to the concurrency level , which is by default 16) can
modify the collection at the same time , given ,each thread works on different bucket.
3) So unlike hashtable, we perform any sort of operation ( update ,delete ,read ,create) without locking on entire map
in ConcurrentHashMap.
Retrieval operations (including get) generally do not block, so may overlap with update operations (including put and
remove). Retrievals reflect the results of the most recently completed update operations holding upon their onset.
1) The allowed concurrency among update operations is guided by the optional concurrencyLevel constructor
argument (default 16), which is used as a hint for internal sizing.
2) The table is internally partitioned to try to permit the indicated number of concurrent updates without contention.
3) Because placement in hash tables is essentially random, the actual concurrency will vary. Ideally, you should
choose a value to accommodate as many threads as will ever concurrently modify the table.
4) Using a significantly higher value than you need can waste space and time, and a significantly lower
value can lead to thread contention
Explain the use of final keyword in variable, method and class.
In Java, the final keyword is used as defining something as constant /final and represents the non-access modifier.
1) final variable :
i) When a variable is declared as final in Java, the value can’t be modified once it has been assigned.
ii) If any value has not been assigned to that variable, then it can be assigned only by the constructor of the class.
2) final method :
i) A method declared as final cannot be overridden by its children's classes.
ii) A constructor cannot be marked as final because whenever a class is inherited, the constructors are not inherited.
Hence, marking it final doesn't make sense. Java throws compilation error saying - modifier final not allowed here
3) final class :
No classes can be inherited from the class declared as final. But that final class can extend other classes for its
usage.
Differentiate between HashSet and HashMap.
Hash Set :
1) It implements the Set Interface.
2) It does not allow duplicate values.
3) While adding an element it requires only one object as a parameter.
4) Internally, HashSet uses HashMap to add entries. The key K in a HashSet is the argument supplied in the
add(Object) method. For each value supplied in the add(Object) method, Java assigns a dummy value.
5) It is slower than HashMap.
Hash Map :
1) It implements the Map Interface.
2) The key needs to be unique while two different keys can have the same value.
3) While adding an entry, it requires two object values, the Key and the Value as the parameter.
4) There is no concept of duplicate values.
5) It is faster than HashSet.
Differentiate between ArrayList and Vector in java.
Following are the differences between ArrayList and Vector in java :
1) Synchronization : Vector is synchronized, which means that only one thread can access the code at a time,
however, ArrayList is not synchronized, which means that multiple threads can operate on ArrayList at the same time.
2)Data Growth : Both ArrayList and Vector dynamically expand and shrink to make the most use of storage space,
but the manner they do it is different. If the number of elements in an array exceeds its limit, ArrayList increments
50% of the current array size, while vector increments 100%, thereby doubling the current array size.
3) Performance : ArrayList is faster than vector operations because it is non-synchronized, but vector operations are
slower since they are synchronized (thread-safe). When one thread works on a vector, it acquires a lock on it,
requiring any other threads working on it to wait until the lock is released.
4) Ease of Iteration : Vector can traverse over its elements using both Enumeration and Iterator, whereas ArrayList
can only traverse using Iterator.
What is meant by Interface?
Multiple inheritances cannot be achieved in java. To overcome this problem the Interface concept is
introduced. An interface is a template which has only method declarations and not the method implementation.
Some imp. points about Interface :
1) All the methods in the interface are internally public abstract void.
2) All the variables in the interface are internally public static final that is constants.
3) Classes can implement the interface and not extends.
4) The class which implements the interface should provide an implementation for all the methods declared in the
interface.
Difference between Abstract class and Interface.
The differences between Abstract Class and Interface are as follows :
Abstract Class:
1) Abstract classes have a default constructor and it is called whenever the concrete subclass is instantiated.
2) It contains Abstract methods as well as Non-Abstract methods.
3) The class which extends the Abstract class shouldn’t require the implementation of all the methods, only Abstract
methods need to be implemented in the concrete sub-class.
4) Abstract class contains instance variables.
Interface:
1 )It doesn’t have any constructor and couldn’t be instantiated.
2) The abstract method alone should be declared.
3) Classes that implement the interface should provide the implementation for all the methods.
4) The interface contains only constants.
Explain in brief the role of different MVC components?
The different MVC components have the following roles -
1) Presentation: This component takes care of the visual representation of a particular abstraction in the application.
2) Control: This component takes care of the consistency and uniformity between the abstraction within the system
along with their presentation to the user. It is also responsible for communicating with all other controls within the
MVC system.
3) Abstraction: This component deals with the functionality of the business domain within the application.
How is the routing carried out in MVC?
1) The RouteCollection contains a set of routes that are responsible for registering the routes in the application.
2) The RegisterRoutes method is used for recording the routes in the collection.
3) The URL patterns are defined by the routes and a handler is used which checks the request matching the pattern.
4) The MVC routing has 3 parameters.
4.1) The first parameter determines the name of the route.
4.2) The second parameter determines a specific pattern with which the URL matches.
4.3) The third parameter is responsible for providing default values for its placeholders.
In this round, I was asked questions mainly from Jenkins, CI/CD and some more questions revolving around common HTTP methods and Microservices.
What is Jenkins?
Jenkins is a self-contained, open-source automation server that can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software. Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.
What are the types of Jenkins pipelines?
1) Jenkins Pipelines can be either - a Declarative pipeline or a Scripted Pipeline.
2) Declarative pipeline makes use of numerous, generic, predefined build steps/stages (i.e. code snippets) to build our job according to our build/automation needs.
3) Whereas, with Scripted pipelines, the steps/stages can be custom-defined & used using a groovy syntax which provides better control & fine-tuned execution levels.
Explain Jenkins Multibranch Pipeline?
It is a pipeline job that can be configured to Create a set of Pipeline projects according to the detected branches in one SCM repository. This can be used to configure pipelines for all branches of a single repository e.g. if we maintain different branches (i.e. production code branches) for different configurations like locales, currencies, countries, etc.
What are the credential types supported by Jenkins?
In Jenkins, credentials are a set of information used for authentication with internal/external services to accomplish an action. Jenkins credentials are provisioned & managed by a built-in plugin called - Credentials Binding - plugin. Jenkins can handle different credentials as follows -
1) Secret text - A token such as an API token, JSON token, etc.
2) Username and password - Basic Authentication can be stored as a credential as well.
3) Secret file - A secret file used to authenticate some secure data services & security handshakes.
4) SSH Username with a private key - An SSH public/private key pair for Machine to Machine authentication.
5) Certificate - a PKCS#12 certificate file and an optional password.
6) Docker Host Certificate Authentication credentials.
And as we can guess, this can be extended to several other extensible credential types like - AWS credential, Azure secrets, etc. using commonly available plugins.
Difference between PUT and POST methods?
1) PUT method is called when you have to modify a single resource while POST method is called when you have to
add a child resource.
2) PUT method response can be cached but you cannot cache POST method responses.
3) You can use UPDATE query in PUT whereas you can use create query in POST.
4) In PUT method, the client decides which URI resource should have, and in POST method, the server decides
which URI resource should have.
5) PUT works as specific while POST work as abstract.
6) If you send the same PUT request multiple times, the result will remain the same but if you send the same POST
request multiple times, you will receive different results.
7) PUT method is idempotent whereas POST method is not idempotent.
Explain how independent microservices communicate with each other.
Communication between microservices can take place through:
1) HTTP/REST with JSON or binary protocol for request-response
2) Websockets for streaming.
3) A broker or server program that uses advanced routing algorithms.
RabbitMQ, Nats, Kafka, etc., can be used as message brokers; each is built to handle a particular message
semantic. You can also use Backend as a Service like Space Cloud to automate your entire backend.
Explain OAuth.
Generally speaking, OAuth (Open Authorization Protocol) enables users to authenticate themselves with third-party
service providers. With this protocol, you can access client applications on HTTP for third-party providers such as
GitHub, Facebook, etc. Using it, you can also share resources on one site with another site without requiring their
credentials.
This was a Technical Cum HR round where I was first asked some basic Java related concepts and then we discussed
about my expectations from the company , learnings and growth in the forthcomig years. I would suggest be honest and
try to communicate your thoughts properly in these type of rounds to maximise your chances of getting selected.
Why should we hire you ?
What are your expectations from the company?
How was your overall interview experience?
What are your strengths and weakness according to you?
Where do you see yourself in the next 5 years?
Why are you looking for a job change?
Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round,
like what are the projects currently the company is investing, which team you are mentoring. How all is the work
environment etc.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?