UST Global interview experience Real time questions & tips from candidates to crack your interview

Senior Software Developer

UST Global
upvote
share-icon
3 rounds | 18 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Algorithms, Java, Spring, MVC, DBMS, OOPS
Tip
Tip

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.

Application process
Where: Referral
Eligibility: Above 2 years of experience
Resume Tip
Resume tip

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.

Interview rounds

01
Round
Medium
Video Call
Duration60 minutes
Interview date1 Oct 2021
Coding problem7

This round had 1 question related to DSA and then the rest of the questions were from Java , OOPS and Spring Boot.

1. Find the middle of a given linked list

Easy
20m average time
80% success
0/40
Asked in companies
NoBrokerIBMHCL Technologies

Given a singly linked list of 'N' nodes. The objective is to determine the middle node of a singly linked list. However, if the list has an even number of nodes, we return the second middle node.

Note:
1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.
Problem approach

Approach :

1) If the head is NULL, we simply return HEAD.

2) If there is only one element in the linked list, we simply return it as it is the midpoint.

3) Otherwise, we initialise 2 pointers ‘fast’ and ‘slow’ both poiniting to head initially.

4) We traverse the linked list until fast is the last element or fast is beyond the linked list i.e it points to NULL.

5) In each iteration, the ‘fast’ pointer jumps 2 times faster as compared to ‘slow’ pointer.

6) Finally, once the loop terminates, ‘slow’ pointer will be pointing to the middle element of the linked list, hence we return the ‘slow’ pointer.


TC : O(N), where ‘N’ denotes the number of elements in the given Linked list.
SC : O(1)

Try solving now

2. Java Question

How ConcurrentHashMap works in Java?

Problem approach

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.


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.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. 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.


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. The table is internally partitioned to try to permit the indicated number of concurrent updates without contention. 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. Using a significantly higher value than you need can waste space and time, and a significantly lower value can lead to thread contention.

3. Java 8 Question

What are the features of a lambda expression?

Problem approach

Below are the two significant features of the methods that are defined as the lambda expressions :


1) Lambda expressions can be passed as a parameter to another method.
 

2) Lambda expressions can be standalone without belonging to any class.

4. Spring Boot Question

What is dependency Injection?

Problem approach

The process of injecting dependent bean objects into target bean objects is called dependency injection.

1) Setter Injection : The IOC container will inject the dependent bean object into the target bean object by calling the setter method.

2) Constructor Injection : The IOC container will inject the dependent bean object into the target bean object by calling the target bean constructor.

3) Field Injection : The IOC container will inject the dependent bean object into the target bean object by Reflection API.

5. API Question

Difference between PUT and POST methods?

Problem approach

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.

6. OOPS Question

Explain SOLID principles in Object Oriented Design.

Problem approach

The SOLID principle is an acronym of the five principles which is given below :

1) Single Responsibility Principle (SRP)
2) Open/Closed Principle
3) Liskov’s Substitution Principle (LSP)
4) Interface Segregation Principle (ISP)
5) Dependency Inversion Principle (DIP)

Uses of SOLID design principles :

1) The SOLID principle helps in reducing tight coupling.

2) Tight coupling means a group of classes are highly dependent on one another which we should avoid in our code.

3) Opposite of tight coupling is loose coupling and our code is considered as a good code when it has loosely-coupled classes.

4) Loosely coupled classes minimize changes in your code, helps in making code more reusable,maintainable,flexible and stable.


Explaining the 5 SOLID principles one by one :


1) Single Responsibility Principle : This principle states that “a class should have only one reason to change” which means every class should have a single responsibility or single job or single purpose.
Use layers in your application and break God classes into smaller classes or modules.


2) Open/Closed Principle : This principle states that “software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification” which means you should be able to extend a class behavior, without modifying it. Using this principle separates the existing code from the modified code so it provides better stability,maintainability and minimizes changes as in your code.


3) Liskov’s Substitution Principle : According to this principle “Derived or child classes must be substitutable for their base or parent classes“. This principle ensures that any class that is the child of a parent class should be usable in place of its parent without any unexpected behavior.


4) Interface Segregation Principle : This principle is the first principle that applies to Interfaces instead of classes in SOLID and it is similar to the single responsibility principle. It states that “do not force any client to implement an interface which is irrelevant to them“. Here your main goal is to focus on avoiding fat interface and give preference to many small client-specific interfaces.


5) Dependency Inversion Principle : Two key points are here to keep in mind about this principle
a) High-level modules/classes should not depend on low-level modules/classes. Both should depend upon abstractions.
b) Abstractions should not depend upon details. Details should depend upon abstractions.

7. OOPS Question

What do you mean by virtual functions in C++?

Problem approach

1) A C++ virtual function is a member function in the base class that you redefine in a derived class. It is declared using the virtual keyword.

2) It is used to tell the compiler to perform dynamic linkage or late binding on the function.

3) When the function is made virtual, C++ determines which function is to be invoked at the runtime based on the type of the object pointed by the base class pointer.

Some rules regarding virtual function :

i) Virtual functions must be members of some class.

ii) Virtual functions cannot be static members.

iii) They are accessed through object pointers.

iv) They can be a friend of another class.

v) A virtual function must be defined in the base class, even though it is not used.

vi) We cannot have a virtual constructor, but we can have a virtual destructor.

02
Round
Medium
Video Call
Duration60 minutes
Interview date1 Oct 2021
Coding problem9

This round started with some questions from Spring Boot and Hibernate and then the interviewer moved on to some more questions from MVC and Microservices.

1. Spring Boot Question

What Are the Basic Annotations that Spring Boot Offers?

Problem approach

The primary annotations that Spring Boot offers reside in its "org.springframework.boot.autoconfigure" and its sub-packages. Here are a couple of basic ones :

@EnableAutoConfiguration – to make Spring Boot look for auto-configuration beans on its classpath and automatically apply them.

@SpringBootApplication – used to denote the main class of a Boot Application. This annotation combines @Configuration, @EnableAutoConfiguration, and @ComponentScan annotations with their default attributes.

2. Spring Boot Question

Explain @RestController annotation in Sprint boot?

Problem approach

It is a combination of @Controller and @ResponseBody, used for creating a restful controller. It converts the response to JSON or XML. It ensures that data returned by each method will be written straight into the response body instead of returning a template.

3. Hibernate Question

What is hibernate caching?

Problem approach

Hibernate caching is the strategy for improving the application performance by pooling objects in the cache so that the queries are executed faster. Hibernate caching is particularly useful when fetching the same data that is executed multiple times. Rather than hitting the database, we can just access the data from the cache. This results in reduced throughput time of the application. 

Types of Hibernate Caching

First Level Cache :

1) This level is enabled by default.
2) The first level cache resides in the hibernate session object.
3) Since it belongs to the session object, the scope of the data stored here will not be available to the entire application as an application can make use of multiple session objects.

Second Level Cache :

1) Second level cache resides in the SessionFactory object and due to this, the data is accessible by the entire application.
2) This is not available by default. It has to be enabled explicitly.
3) EH (Easy Hibernate) Cache, Swarm Cache, OS Cache, JBoss Cache are some example cache providers.

4. Hibernate Question

Can you tell something about the N+1 SELECT problem in Hibernate?

Problem approach

N+1 SELECT problem is due to the result of using lazy loading and on-demand fetching strategy. Let's take an example. If you have an N items list and each item from the list has a dependency on a collection of another object, say bid. In order to find the highest bid for each item while using the lazy loading strategy, hibernate has to first fire 1 query to load all items and then subsequently fire N queries to load big of each item. Hence, hibernate actually ends up executing N+1 queries.

5. Hibernate Question

What are the concurrency strategies available in hibernate?

Problem approach

Concurrency strategies are the mediators responsible for storing and retrieving items from the cache. While enabling second-level cache, it is the responsibility of the developer to provide what strategy is to be implemented to decide for each persistent class and collection.

Following are the concurrency strategies that are used :

1) Transactional: This is used in cases of updating data that most likely causes stale data and this prevention is most critical to the application.

2) Read-Only: This is used when we don't want the data to be modified and can be used for reference data only.

3) Read-Write: Here, data is mostly read and is used when the prevention of stale data is of critical importance.

4) Non-strict-Read-Write: Using this strategy will ensure that there wouldn't be any consistency between the database and cache. This strategy can be used when the data can be modified and stale data is not of critical concern.

6. MVC Question

Explain in brief the role of different MVC components?

Problem approach

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.

7. MVC Question

How is the routing carried out in MVC?

Problem approach

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.

8. Microservices Question

Explain how independent microservices communicate with each other.

Problem approach

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.

9. Microservices Question

Explain OAuth.

Problem approach

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.

03
Round
Easy
HR Round
Duration30 minutes
Interview date1 Oct 2021
Coding problem2

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.

1. Basic HR Questions

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?

Problem approach

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.

2. Basic HR Question

Why are you looking for a job change?

Problem approach

Tip : For an experienced professional seeking a change, this is a common question. The easiest method to respond to this question is to state that you are leaving your current work in order to advance your career. Make sure you don't criticize or speak poorly about the company where you now work.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
Senior Software Engineer
3 rounds | 15 problems
Interviewed by UST Global
2174 views
0 comments
0 upvotes
Selenium Automation Tester
3 rounds | 18 problems
Interviewed by UST Global
2980 views
0 comments
0 upvotes
Senior Software Engineer
3 rounds | 6 problems
Interviewed by UST Global
2454 views
0 comments
0 upvotes
Senior Systems Engineer
3 rounds | 23 problems
Interviewed by UST Global
1618 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Senior Software Developer
3 rounds | 3 problems
Interviewed by BNY Mellon
1360 views
0 comments
0 upvotes
company logo
Senior Software Developer
4 rounds | 5 problems
Interviewed by Ernst & Young (EY)
3210 views
0 comments
0 upvotes