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

Technology Consultant

Virtusa
upvote
share-icon
3 rounds | 15 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 5 Months
Topics: Data Structures, Algorithms, OOPS , Java , Spring
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.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application process
Where: Campus
Eligibility: Above 7 CGPA
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
Duration50 Minutes
Interview date28 Jul 2021
Coding problem7

In this round, the interviewer first asked me a preety basic coding question related to Backtracking. Then he switched to questions revolving around Java , Spring Boot and Kafka.

Easy
30m average time
80% success
0/40
Asked in companies
OYOThought WorksPaytm (One97 Communications Limited)

You are given an input string 'S'. Your task is to find and return all possible permutations of the input string.

Note:
1. The input string may contain the same characters, so there will also be the same permutations.

2. The order of permutation does not matter.
Problem approach

Approach : 
We can find all the permutations by Backtracking.

1) Fix a character then swap all the rest of the remaining character with a fixed character.

2) Then find all permutations for all remaining characters by the recursive call.

3) The base case for the recursion will be when there is only one character left unprocessed.


TC : O(N*N!), where N = length of the String.
SC : O(N)

Try solving now

2. Java Question

Explain the use of final keyword in variable, method and class.

Problem approach

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 :
i) No classes can be inherited from the class declared as final. But that final class can extend other classes for its
usage.

3. Java Question

How would you differentiate between a String, StringBuffer, and a StringBuilder?

Problem approach

1) Storage area : In string, the String pool serves as the storage area. For StringBuilder and StringBuffer, heap
memory is the storage area.

2) Mutability : A String is immutable, whereas both the StringBuilder and StringBuffer are mutable.

3) Efficiency : It is quite slow to work with a String. However, StringBuilder is the fastest in performing operations. The
speed of a StringBuffer is more than a String and less than a StringBuilder. (For example appending a character is
fastest in StringBuilder and very slow in String because a new memory is required for the new String with appended
character.)

4) Thread-safe : In the case of a threaded environment, StringBuilder and StringBuffer are used whereas a String is
not used. However, StringBuilder is suitable for an environment with a single thread, and a StringBuffer is suitable for
multiple threads.

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. Spring Boot Question

What is the root application context in Spring MVC? How is it loaded?

Problem approach

In Spring MVC, the context loaded using ContextLoaderListener is called the "root" application context which belongs
to the whole application while the one initialized using DispatcherServlet is actually specific to that servlet.

Technically, Spring MVC allows multiple DispatcherServlet in a Spring MVC web application and so multiple such
contexts each specific for respective servlet but having the same root context may exist.

6. Kafka Question

What are the four core API architectures that Kafka uses?

Problem approach

Following are the four core APIs that Kafka uses : 

1) Producer API : In Apache Kafka, the Producer API allows an application to publish a stream of records to one or more Kafka topics.

2) Consumer API : In Apache Kafka, the consumer API allows an application to subscribe to one or more Kafka topics. It also enables the application to process streams of records generated about such topics.

3) Streams API : In Apache Kafka, the Kafka Streams API allows an application to use a stream processing architecture to process data in Kafka. We can also use this application API to take input streams from one or more topics, process those using stream operations, and generate output streams to transmit to more topics. We can also use the Streams API to convert input streams into output streams.

4) Connect API : In Apache Kafka, the Kafka Connect API (also called Connector API) connects Kafka topics to applications. This API constructs and manages the operations of producers and consumers and establishing reusable links between these solutions. For example, A Connect API may capture all database updates and ensure they are made available in a Kafka topic.

7. Kafka Question

What are the use cases of Kafka monitoring?

Problem approach

Following are the use cases of Apache Kafka monitoring : 

1) Apache Kafka monitoring can keep track of system resources consumption such as memory, CPU, and disk utilization over time.

2) Apache Kafka monitoring is used to monitor threads and JVM usage. It relies on the Java garbage collector to free up memory, ensuring that it frequently runs, thereby guaranteeing that the Kafka cluster is more active.

3) It can be used to determine which applications are causing excessive demand, and identifying performance bottlenecks might help rapidly solve performance issues.

4) It always checks the broker, controller, and replication statistics to modify the partitions and replicas status if required.

02
Round
Medium
Video Call
Duration60 Minutes
Interview date28 Jul 2021
Coding problem7

This round primarily focused on questions related to Spring Boot and Hibernate. As I already had some projects in Java , I was familiar to both Spring and Hibernate - what are they used for , their basic understanding and all . So, this round also went preety well as I was able to answer most of the questions with little to no hints as far as possible.

1. Spring Boot Question

How does Spring Boot works?

Problem approach

Spring Boot automatically configures your application based on the dependencies you have added to the project by using annotation. The entry point of the spring boot application is the class that contains @SpringBootApplication annotation and the main method.

Spring Boot automatically scans all the components included in the project by using @ComponentScan annotation.

2. Spring Boot Question

What are the major differences between RequestMapping and GetMapping?

Problem approach

RequestMapping can be used with GET, POST, PUT, and many other request methods using the method attribute on the annotation. Whereas GetMapping is only an extension of RequestMapping, which helps you to improve clarity on requests.

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

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

5. Hibernate Question

How do you create an immutable class in hibernate?

Problem approach

Immutable class in hibernate creation could be in the following way. If we are using the XML form of configuration,
then a class can be made immutable by markingmutable=false. The default value is true there which indicating that
the class was not created by default.

In the case of using annotations, immutable classes in hibernate can also be created by using @Immutable
annotation.

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

7. Hibernate Question

Explain Query Cache

Problem approach

Hibernate framework provides an optional feature called cache region for the queries’ resultset. Additional configurations have to be done in code in order to enable this. The query cache is useful for those queries which are most frequently called with the same parameters. This increases the speed of the data retrieval and greatly improves performance for commonly repetitive queries.

This does not cache the state of actual entities in the result set but it only stores the identifier values and results of the value type. Hence, query cache should be always used in association with second-level cache.

03
Round
Easy
HR Round
Duration30 Minutes
Interview date28 Jul 2021
Coding problem1

This is a cultural fitment testing round. HR was very frank and asked standard questions. Then we discussed about my
role.

1. Basic HR Question

Why should we hire you ?

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.

Tip 4 : Since everybody in the interview panel is from tech background, here too you can expect some technical
questions. No coding in most of the cases but some discussions over the design can surely happen.

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 the output of print(type("Python"))?

Choose another skill to practice
Similar interview experiences
Technology Consultant
3 rounds | 3 problems
Interviewed by Virtusa
1245 views
0 comments
0 upvotes
Fullstack Developer
4 rounds | 6 problems
Interviewed by Virtusa
1221 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by Virtusa
1211 views
0 comments
0 upvotes
Analyst
3 rounds | 3 problems
Interviewed by Virtusa
1095 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Technology Consultant
3 rounds | 18 problems
Interviewed by Ernst & Young (EY)
1857 views
0 comments
0 upvotes
company logo
Technology Consultant
3 rounds | 18 problems
Interviewed by Ernst & Young (EY)
1170 views
0 comments
0 upvotes
company logo
Technology Consultant
2 rounds | 2 problems
Interviewed by Ernst & Young (EY)
2392 views
0 comments
0 upvotes