Autocoder

Virtusa interview questions and answers

Last updated 2026-11-19

Virtusa is an IT services and digital engineering company, and fresher interviews for its developer roles are commonly reported to centre on Java or another core language, object-oriented design, SQL and a project walkthrough. Many candidates also meet questions on Spring, REST and microservices, particularly if those appear on their resume.

This page works through questions of that kind with worked answers. Virtusa has not published a fixed fresher process that we can cite, so the rounds below are commonly reported. For the test side see Virtusa coding round questions.

Typical rolesSoftware engineer trainee, associate engineer
Rounds (commonly reported)Online test, technical interview, HR interview
Frequent topicsJava, OOP, collections, SQL, Spring basics, projects

Rounds as commonly reported

Candidates describe an online test with aptitude, verbal and technical or coding sections, then a technical interview, and finally an HR conversation. The technical interview typically begins from your resume and moves to fundamentals, then to a coding question on paper or a shared editor.

If you list Spring Boot, Hibernate or microservices on your resume, expect follow-ups with real depth: what each annotation does, how a request flows through the layers, and what you would do when a service is slow. List only what you can explain.

Preparing the Java core

Hiring status

There is no Virtusa hiring page on this site and we hold no sourced Virtusa statement on fresher numbers, dates or packages, so none are quoted. Check Virtusa's own careers site for current roles and eligibility, and be sceptical of third-party posts that quote cutoffs.

Virtusa interview questions and answers: questions with worked answers

  1. 1

    How does HashMap work internally in Java?

    medium

    HashMap stores entries in an array of buckets. The key hashCode is spread and reduced to a bucket index; keys that collide are chained in a linked list, which Java 8 converts to a balanced tree when a bucket grows beyond a threshold, keeping worst-case lookup near O(log n). Lookup compares hash, then equals. When the load factor of 0.75 is exceeded the table doubles and entries are redistributed. Keys must have consistent equals and hashCode.

  2. 2

    What is the contract between equals() and hashCode()?

    medium

    If two objects are equal by equals(), they must return the same hashCode(). Unequal objects may share a hash code, but fewer collisions give better performance. If you override equals without hashCode, equal objects can land in different buckets, so a HashMap or HashSet fails to find them. Use the same fields in both.

  3. 3

    Why is String immutable in Java, and what is the string pool?

    easy

    Immutability makes strings safe to share between threads, safe as HashMap keys (the hash can be cached) and safe in security-sensitive uses such as class loading and file paths. The string pool stores literal strings so identical literals share one object, saving memory; new String("a") creates a separate heap object, which is why == can differ from equals. For heavy concatenation use StringBuilder.

  4. 4

    Differentiate between ArrayList and LinkedList.

    easy

    ArrayList is backed by a resizable array, so random access by index is O(1), but inserting or removing in the middle is O(n) because elements shift. LinkedList is a doubly linked list with O(1) insertion and removal at a known node and at both ends, but O(n) indexed access and more memory per element. In practice ArrayList is the better default, because of cache locality.

  5. 5

    Explain checked and unchecked exceptions and try-with-resources.

    easy

    Checked exceptions extend Exception (but not RuntimeException) and must be caught or declared, such as IOException. Unchecked exceptions extend RuntimeException or Error and need no declaration, such as NullPointerException. try-with-resources automatically closes any AutoCloseable resource declared in the parentheses when the block exits, even on an exception, replacing a manual finally block.

  6. 6

    What is the difference between synchronized and a ReentrantLock, and what is a race condition?

    medium

    A race condition occurs when the result depends on the unpredictable order of threads accessing shared data, such as two threads incrementing a counter. synchronized is built-in, block-structured and releases the monitor automatically. ReentrantLock gives more control: tryLock, timeouts, interruptible waits and fairness options, but must be unlocked in finally. For a simple counter, AtomicInteger is usually better than either.

  7. 7

    Explain Spring dependency injection and what @Autowired does.

    medium

    Dependency injection means a class receives the objects it depends on instead of creating them, which decouples code and makes testing easier by allowing mocks. In Spring the container creates beans and injects them, and @Autowired asks it to supply a matching bean by type. Constructor injection is preferred because dependencies are explicit and can be final. If there are several candidates, @Qualifier or @Primary resolves the choice.

  8. 8

    Trace what happens when a REST request hits a Spring Boot application.

    medium

    The embedded server receives the HTTP request, and the DispatcherServlet maps it to a controller method using the URL and HTTP method. Arguments are bound from the path, query or JSON body (via Jackson), the controller calls a service layer which uses repositories to access the database, and the returned object is serialised to JSON with an HTTP status. Filters, interceptors and exception handlers wrap this flow.

  9. 9

    What are microservices, and what problems do they introduce?

    medium

    Microservices split an application into small, independently deployable services, each owning its data and one business capability. Benefits include independent scaling and deployment and technology choice per service. Costs are network latency and failure handling, distributed data consistency, harder debugging and testing, and operational overhead for deployment and monitoring. A monolith is often the right start for a small team.

  10. 10

    Write a SQL query to find employees whose salary is above the average salary of their department.

    hard

    Compute each department average with a subquery or a window function and compare. The window form avoids a second scan: AVG(salary) OVER (PARTITION BY dept_id) gives the department average on every row, and an outer query filters. A correlated subquery works too but may be slower on large tables.

    sql
    SELECT name, salary, dept_id
    FROM (
      SELECT e.*, AVG(salary) OVER (PARTITION BY dept_id) AS dept_avg
      FROM Employee e
    ) t
    WHERE salary > dept_avg;
  11. 11

    Walk me through your final-year project.

    medium

    Give the problem in one sentence, the architecture (front end, back end, database), your own part, one design decision with its trade-off and one bug you solved. Expect deep follow-ups on every technology named, such as why you chose that database, so only claim what you did. Practise saying it in two minutes.

  12. 12

    Why Virtusa, and are you open to relocation and learning new stacks?

    easy

    Link your answer to the type of work you read about: digital engineering and enterprise technology projects for clients, and to the stack you want to grow in. Then answer logistics honestly, including location flexibility and willingness to be trained on technologies the project needs. A concrete example of learning something quickly supports the claim.

Frequently asked questions

Which language should I prepare for Virtusa?

Java is the most commonly reported for developer roles, but Python is also accepted in many tests. Follow your listing and your resume.

Does Virtusa ask Spring and microservices?

If they are on your resume, yes, commonly. List only what you can explain.

Is there an HR round?

Commonly reported as the final stage, covering motivation, relocation and your background.

How hard is the technical interview?

Described as moderate: fundamentals, a coding question and a project discussion.

Where do I check current Virtusa openings?

On Virtusa's own careers site or through your campus placement cell.

Related guides

More in Company Interview Questions

See all in this section