Senior Software Engineer

200+ Senior Software Engineer Interview Questions and Answers for Freshers

Updated 12 Jul 2025
search-icon
4d ago

Q. Given an array of n elements and a value k, find the kth largest element in subarrays ranging from index 0 to k, 0 to k+1, ..., 0 to n.

Ans.

Find the Kth largest element in multiple subarrays of a given array.

  • Use a max-heap or min-heap to efficiently track the Kth largest element.

  • For each subarray from index 0 to i, where i ranges from k to n, extract the Kth largest element.

  • Example: For array [3, 2, 1, 5, 6, 4] and k=2, subarrays are [3, 2], [3, 2, 1], [3, 2, 1, 5], etc.

  • The Kth largest element for each subarray can be found using sorting or a heap data structure.

3d ago

Q. How do you create GQL server, directive in GQL, Fragments in GQL how do you write unit tests for gql Queries/mutations (on the server side) TypeScript: Partial, Decorators, unions, Generics useCallback vs useMe...

read more
Ans.

Answering questions related to creating GQL server, directives, fragments, unit tests, TypeScript features, and React.js functionalities.

  • To create a GQL server, you can use tools like Apollo Server or Express with GraphQL middleware.

  • Directives in GQL are used to modify the behavior of a field or fragment in a query. For example, @include and @skip are common directives.

  • Fragments in GQL allow you to define reusable units of query logic. They can be included in queries to avoid...read more

Asked in Arcesium

6d ago

Q. Given a grid representing an ocean (where mat[i][j] = 1 represents an island and mat[i][j] = 0 represents water), find the island with the largest area.

Ans.

Find the largest island area in a grid representing an ocean using DFS or BFS.

  • Use Depth-First Search (DFS) or Breadth-First Search (BFS) to explore the grid.

  • Mark visited cells to avoid counting them multiple times.

  • Count the size of each island during the traversal.

  • Example: For a grid [[1,0,0],[1,1,0],[0,0,1]], the largest island has area 3.

  • Keep track of the maximum area found during the exploration.

4d ago

Q. Write an API to implement HTTP GET method to hit an external datasource using pagination and filter the top-rated movie in a certain Genre. There will be around 2000 entries of data objects related to movies, a...

read more
Ans.

Implement an API in Java to fetch top rated movies in a certain genre from an external datasource using pagination.

  • Create a REST API endpoint in Java using Spring Boot framework

  • Implement pagination by using query parameters for 'page' and 'size'

  • Filter the movies by genre and sort them by rating to fetch the top rated ones

  • Use a service layer to interact with the external datasource and fetch the data

  • Return the filtered and paginated movie data in the response

Are these interview questions helpful?

Asked in LTIMindtree

5d ago

Q. Explain microservice architecture and how to implement it using Spring Boot.

Ans.

Microservice architecture is a design approach where an application is composed of small, independent services that communicate over well-defined APIs.

  • Break down the application into smaller, loosely coupled services that can be developed, deployed, and scaled independently.

  • Each service focuses on a specific business capability and communicates with other services through APIs.

  • Spring Boot provides a convenient framework for building microservices by offering features like emb...read more

2d ago

Q. How many projects or processes have you implemented in the RE framework?

Ans.

I have implemented RE framework in 3 projects.

  • Implemented RE framework in 3 projects

  • Used RE framework for automating end-to-end processes

  • Leveraged RE framework's modular structure for easy maintenance

  • Examples: Invoice processing, Order management, HR onboarding

Senior Software Engineer Jobs

Red Hat India Pvt Ltd logo
Senior Software Engineer - Full Stack 6-11 years
Red Hat India Pvt Ltd
4.3
₹ 19 L/yr - ₹ 33 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru
Red Hat India Pvt Ltd logo
Senior Software Engineer For Fabric8 Kubernetes Client- Java/K8s 6-11 years
Red Hat India Pvt Ltd
4.3
₹ 19 L/yr - ₹ 33 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru
Red Hat India Pvt Ltd logo
Senior Software Engineer - Enterprise Linux Platform 5-10 years
Red Hat India Pvt Ltd
4.3
₹ 18 L/yr - ₹ 31 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru

Asked in HCLTech

4d ago

Q. Find the second highest number by using Java Stream, What are the new changes in Java 8 from Java 7. HashMap and HashSet internal implementation.

Ans.

Using Java Stream to find the second highest number, Java 8 changes, HashMap and HashSet internal implementation.

  • Use Java Stream to sort the numbers in descending order and skip the first element to get the second highest number.

  • Java 8 introduced lambda expressions, functional interfaces, Stream API, default methods in interfaces, and new Date and Time API.

  • HashMap uses buckets to store key-value pairs, while HashSet uses HashMap internally to store unique elements.

  • HashMap all...read more

3d ago

Q. Create a small machine coding assignment to solve in an online IDE that fetches data from an API and displays the results. Include a search input box at the top where users can search for items.

Ans.

Create a web app to fetch data from an API and implement a search feature for user interaction.

  • Use Fetch API to retrieve data from a public API, e.g., JSONPlaceholder.

  • Implement a search input box that filters results based on user input.

  • Display results in a user-friendly format, such as a list or table.

  • Handle loading states and errors gracefully to enhance user experience.

  • Consider using a framework like React or Vue.js for better state management.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in IQVIA

2d ago

Q. Design an Employee-Manager class. Write a method to display the employee organizational hierarchy like we see in Microsoft Teams Org tab.

Ans.

Design an employee-Manager class and write a method to display employee organizational hierarchy.

  • Create an Employee class with attributes like name, id, managerId, etc.

  • Create a Manager class that inherits from Employee class and has a list of employees under them.

  • Write a method to display the hierarchy using recursion.

  • Use a data structure like a dictionary to store the employees and their managers.

  • Consider edge cases like circular references and missing managers.

2d ago

Q. Write a JavaScript function that returns the letter with the maximum and minimum occurrences in a string.

Ans.

A javascript function to find the maximum and minimum occurrence of a letter in a string.

  • Create an object to store the count of each letter in the string

  • Loop through the string and update the count in the object

  • Find the maximum and minimum count in the object and return the corresponding letters

Asked in Arcesium

1d ago

Q. Given an unsorted array of integers, find the smallest missing positive integer.

Ans.

Find first missing positive integer from an array of non-negative integers.

  • Create a hash set to store all positive integers in the array

  • Loop through the array and add all positive integers to the hash set

  • Loop through positive integers starting from 1 and return the first missing integer not in the hash set

Asked in LTIMindtree

2d ago

Q. What is a Functional Interface and how do you implement it?

Ans.

Functional interface is an interface with only one abstract method, can be implemented using lambda expressions.

  • Functional interface has only one abstract method

  • Can be implemented using lambda expressions

  • Used in Java to achieve functional programming

Asked in Globant

2d ago

Q. Where would you use Flask, and where would you use Django?

Ans.

Flask is lightweight and good for small projects, while Django is more robust and suitable for larger projects.

  • Flask is good for small projects with simple requirements

  • Django is more suitable for larger projects with complex requirements

  • Flask is lightweight and flexible, allowing for more customization

  • Django has a lot of built-in features and is more opinionated

  • Flask is better for RESTful APIs and microservices

  • Django is better for full-stack web applications

  • Examples of Flask ...read more

Q. Q Reverse String Coding question Q find unique array value

Ans.

Reverse a given string and find unique values in an array of strings.

  • Use the reverse() method to reverse the given string.

  • Use a Set to store unique values in the array.

  • Loop through the array and add each element to the Set.

  • Convert the Set back to an array to get the unique values.

Asked in Advantmed

2d ago

Q. Keep SQL procedures short, use multiple small procedure with specific functionality being used, avoid use of temp tables and Joins, use select statements wisely. do not use sub queries, do not use dynamic sql

Ans.

To optimize SQL procedures, keep them short, use small procedures with specific functionality, avoid temp tables and joins, use select statements wisely, avoid subqueries and dynamic SQL.

  • Break down complex procedures into smaller ones with specific functionality

  • Avoid using temporary tables and joins whenever possible

  • Use select statements wisely to retrieve only the necessary data

  • Avoid subqueries and find alternative approaches

  • Do not use dynamic SQL to prevent potential securi...read more

Asked in ServiceNow

3d ago

Q. Given arrival and departure times of all trains that reach a railway station, find the minimum number of platforms required for the railway station so that no train waits.

Ans.

Minimum 2 platforms required for a railway station.

  • At least 2 platforms are required for trains to arrive and depart simultaneously.

  • Additional platforms may be required based on the frequency of trains and passenger traffic.

  • Platforms should be long enough to accommodate the longest trains that will use the station.

  • Platforms should also have appropriate facilities for passengers, such as seating, shelter, and signage.

Asked in Advantmed

3d ago

Q. Why use a button to submit a form when a link can also submit it?

Ans.

Buttons are used for actions within the form, while links are used for navigation.

  • Buttons can trigger JavaScript functions or perform form validation before submission

  • Buttons can have different styles and behaviors compared to links

  • Buttons are more accessible for users with disabilities

Asked in Arcesium

4d ago

Q. Given a list of strings, group them into distinct anagrams.

Ans.

Group list of strings into distinct anagrams.

  • Create a hash table with sorted string as key and list of anagrams as value.

  • Iterate through the list of strings and add each string to its corresponding anagram list in the hash table.

  • Return the values of the hash table as a list of lists.

6d ago

Q. For SSRS reports, why are temporary tables used instead of regular tables?

Ans.

Temp tables are used in SSRS reports for performance optimization and to reduce resource consumption.

  • Temp tables are used to store intermediate results during report generation, reducing the need to repeatedly query the database.

  • Regular tables can lead to locking and contention issues in multi-user environments, while temp tables are session-specific and do not cause conflicts.

  • Temp tables can be indexed and optimized for specific report queries, improving overall performance....read more

5d ago

Q. How microservice communicate with each other, how sprint planning done, how you breakdown stories, java version and it's features, programs.

Ans.

Microservices communicate via APIs, sprint planning involves breaking down stories, Java version features are utilized in programs.

  • Microservices communicate through APIs, allowing them to interact with each other independently.

  • Sprint planning involves breaking down user stories into smaller tasks to be completed within a sprint.

  • Java version features such as lambda expressions, streams, and modules are utilized in software development.

  • Examples: Using REST APIs for microservice...read more

Asked in ServiceNow

1d ago

Q. Given an array of numbers, find the set of numbers that sums closest to a given target number.

Ans.

Find set of numbers from an array that can form nearest sum to the given number.

  • Sort the array in ascending order

  • Use two pointers approach to find the nearest sum

  • Return the set of numbers

5d ago

Q. What do you do in case of bot execution failure?

Ans.

In case of bot execution failure, I would identify the root cause and fix it as soon as possible.

  • Check the logs to identify the error message and the point of failure

  • Analyze the code to identify the root cause of the failure

  • Fix the issue and test the bot again to ensure it is working as expected

  • Implement measures to prevent similar failures in the future

Asked in Mphasis

5d ago

Q. Using Stream API, add a 10% salary hike for employees with more than 5 years of experience.

Ans.

Use Java Stream API to apply a 10% salary hike for employees with over 5 years of experience.

  • Use a List<Employee> to store employee data.

  • Filter employees with experience > 5 years using stream().filter().

  • Map the filtered employees to update their salary by multiplying with 1.1.

  • Collect the results back into a List using collect(Collectors.toList()).

  • Example: employees.stream().filter(e -> e.getExperience() > 5).map(e -> e.setSalary(e.getSalary() * 1.1)).collect(Collectors.toLis...read more

3d ago

Q. How do you create a singleton, ensuring reflection does not compromise the implementation?

Ans.

To create a singleton ensuring reflection does not mess up the implementation, use an enum or a private constructor with a static field.

  • Use an enum to create a singleton as enums are inherently singletons and cannot be instantiated multiple times.

  • Alternatively, use a private constructor with a static field to create a singleton.

  • To prevent reflection from creating multiple instances, throw an exception in the constructor if an instance already exists.

2d ago

Q. Write a JavaScript function to sanitize a string. For example, convert "HoW arE yOu" into "How are you".

Ans.

This function converts a mixed-case string into a properly formatted lowercase string with the first letter capitalized.

  • Use the `toLowerCase()` method to convert the entire string to lowercase.

  • Split the string into words using the `split(' ')` method.

  • Capitalize the first letter of each word using `charAt(0).toUpperCase()`.

  • Join the words back together with a space using `join(' ')`.

  • Example: sanitizeString('HoW arE yOu') returns 'How Are You'.

Asked in Apisero

3d ago

Q. Explain how data structures like dictionaries and hash maps work.

Ans.

Dictionaries and hash maps are key-value data structures that provide fast data retrieval and storage using hashing techniques.

  • Dictionaries store data in key-value pairs, e.g., {'name': 'Alice', 'age': 30}.

  • Hash maps use a hash function to compute an index for storing values, ensuring O(1) average time complexity for lookups.

  • Collisions occur when multiple keys hash to the same index; they can be resolved using chaining or open addressing.

  • Python's built-in dictionary is impleme...read more

Asked in Advantmed

4d ago

Q. How do you optimize a SQL procedure with 5000 lines of code?

Ans.

Optimize a SQL procedure with 5000 lines of code by identifying bottlenecks and implementing performance improvements.

  • Identify and analyze the most time-consuming parts of the procedure

  • Optimize queries by adding appropriate indexes, rewriting queries, or using query hints

  • Break down the procedure into smaller, more manageable parts

  • Use temporary tables or table variables to reduce the amount of data processed at once

  • Consider using stored procedures or functions instead of inlin...read more

Asked in Mphasis

2d ago

Q. How do you handle customized exceptions in controller advice with example code?

Ans.

Handling customized exceptions in controller advice with example code

  • Create a custom exception class that extends RuntimeException

  • Create a controller advice class to handle exceptions globally

  • Use @ExceptionHandler annotation in the controller advice class to handle specific exceptions

  • Return a custom error response with appropriate status code and message

Asked in Nagarro

6d ago

Q. 4. React: What is Virtual DOM, useState and different types of Hooks in React

Ans.

Virtual DOM is a lightweight copy of the actual DOM, useState is a hook for managing state in functional components, and Hooks are functions that let you use state and other React features in functional components.

  • Virtual DOM is a lightweight copy of the actual DOM that React uses to improve performance by updating only the necessary parts of the actual DOM.

  • useState is a hook in React that allows functional components to have state. It returns an array with the current state ...read more

Asked in Morningstar

6d ago

Q. How can we handle fault tolerance in Microservices?

Ans.

Fault tolerance in Microservices can be achieved through redundancy, graceful degradation, and circuit breakers.

  • Implementing redundancy by having multiple instances of each microservice running to handle failures.

  • Using graceful degradation to ensure that the system can still function even if certain microservices are unavailable.

  • Utilizing circuit breakers to prevent cascading failures by temporarily stopping requests to a failing microservice.

1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.7
 • 8.7k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Wipro Logo
3.7
 • 6.1k Interviews
Capgemini Logo
3.7
 • 5.1k Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Senior Software Engineer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits