Senior Software Engineer

200+ Senior Software Engineer Interview Questions and Answers for Freshers

Updated 27 Nov 2024

Popular Companies

search-icon

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

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

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

Q3. Explain microservice architecture and how do we implement that 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

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

Are these interview questions helpful?

Q5. How many projects or process you implemented in 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

Q6. Design a employee-Manager class. Write method to display 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.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

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

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

Q8. Write a javascript function which returns maximum and minimum occurrence of letter from 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

Senior Software Engineer Jobs

Senior Software Engineer - VueJs 3-7 years
Maersk Global Service Centres India Pvt. Ltd.
4.3
Bangalore / Bengaluru
Sr Software Engineer - C# 3-7 years
Siemens Healthcare
4.4
Bangalore / Bengaluru
Sr Software Engineer- Java/ SailPoint/ Azure 6-11 years
Optum Global Solutions (India) Private Limited
4.0
Hyderabad / Secunderabad

Q9. What is Functional interface and way of implementing 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

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

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

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

Q13. Minimum number of platforms required for a railway station.

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.

Q14. What is the use of button when link can submit the form?

Ans.

Buttons are used when an action needs to be performed, while links are used for navigation.

  • Buttons are more suitable for actions like submitting a form, saving data, or triggering a function.

  • Links are used to navigate to different pages or sections within a website.

  • Buttons provide visual feedback when clicked, while links do not.

  • Buttons can be styled and customized more easily than links.

  • Buttons can have different states like disabled or active, while links do not.

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

Q16. SSRS reports - Why temp tables are used and not 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

Q17. Set of numbers from an array that can form nearest sum to the given 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

Q18. What do you do incase 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

Q19. How do you optimize a SQL procedure with 5000 lines in 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

Q20. How to 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

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

Q22. What is the different between the docker file and the docker compose file?

Ans.

Dockerfile is used to build a Docker image, while Docker Compose is used to define and run multi-container Docker applications.

  • Dockerfile is a script that contains instructions to build a Docker image.

  • Docker Compose is a YAML file that defines a multi-container Docker application.

  • Dockerfile is used to create a single container, while Docker Compose is used to create and manage multiple containers.

  • Dockerfile is used to specify the base image, add dependencies, and configure th...read more

Q23. How to create singleton ensuring reflection does not mess up 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.

Q24. Find least common ancestor of a binary tree.

Ans.

Find the lowest common ancestor of a binary tree.

  • Traverse the tree recursively from the root node.

  • If the current node is null or matches either of the given nodes, return the current node.

  • Recursively search for the nodes in the left and right subtrees.

  • If both nodes are found in different subtrees, return the current node.

  • If both nodes are found in the same subtree, continue the search in that subtree.

Q25. How we can 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.

Q26. What is difference between @primary and @Qualifier?

Ans.

Primary is used to define a primary bean when multiple beans of the same type are present, while Qualifier is used to specify which bean to autowire when multiple beans of the same type are present.

  • Primary annotation is used to give a higher preference to a bean when multiple beans of the same type are present in the Spring application context.

  • Qualifier annotation is used to specify which bean to autowire when multiple beans of the same type are present. It helps in resolving...read more

Q27. Least cost to travel from source to destination(DP problem)

Ans.

The problem is to find the least cost to travel from source to destination using dynamic programming.

  • Use dynamic programming to solve the problem

  • Create a 2D array to store the minimum cost to reach each cell

  • Fill the array using the recurrence relation: minCost[i][j] = cost[i][j] + min(minCost[i-1][j], minCost[i][j-1], minCost[i-1][j-1])

  • The final answer will be stored in minCost[m][n], where m and n are the coordinates of the destination

  • Example: Given a grid with costs to trav...read more

Q28. What is OOP? Write pseudo code to design library management system. What is RDBMS. Write a program to reverse a string.

Ans.

OOP stands for Object-Oriented Programming, a programming paradigm based on the concept of objects.

  • OOP focuses on creating objects that contain both data and methods to manipulate that data.

  • Encapsulation, inheritance, and polymorphism are key principles of OOP.

  • Example: In a library management system, you could have objects like Book, Patron, and Library.

  • Example: Inheritance allows a FictionBook class to inherit properties from a Book class.

Q29. How to handle the exceptions globally in rest api Springboot

Ans.

Handle exceptions globally in Springboot REST API

  • Use @ControllerAdvice annotation to define global exception handling for all controllers

  • Create a class annotated with @ControllerAdvice and define methods to handle specific exceptions

  • Use @ExceptionHandler annotation to specify which exceptions the method should handle

  • Return appropriate HTTP status codes and error messages in the exception handling methods

Q30. What annotations are included in @SpringbootApplication annotation

Ans.

The @SpringBootApplication annotation includes @Configuration, @EnableAutoConfiguration, and @ComponentScan annotations.

  • Includes @Configuration annotation to specify that the class can be used by the Spring IoC container as a source of bean definitions.

  • Includes @EnableAutoConfiguration annotation to enable Spring Boot's auto-configuration feature.

  • Includes @ComponentScan annotation to specify the base packages to scan for components.

Q31. Swap character from uppercase to lowercase and lowercase to uppercase Zscalar ->zSCALAR without using 1.util function 2.arithimatic operator 3.map 4.array function

Ans.

Swap characters from uppercase to lowercase and lowercase to uppercase in a given string.

  • Iterate through each character in the string

  • Check if the character is uppercase or lowercase

  • Swap the case of the character using bitwise XOR operation

  • Build the resulting string with the swapped characters

Q32. Architecture of Openshift, What services you have used

Ans.

OpenShift is a container application platform that provides a secure and scalable environment for deploying and managing applications.

  • OpenShift architecture is based on Kubernetes and Docker

  • It provides a platform for building, deploying, and managing containerized applications

  • Services used in OpenShift include Kubernetes, Docker, etcd, and others

Q33. What is the difference between roll-up and scan component?

Ans.

Roll-up and scan components are both used in data processing, but they have different functions and purposes.

  • Roll-up is a data aggregation technique that summarizes data at a higher level of granularity.

  • Scan component, on the other hand, is used to read and process data sequentially.

  • Roll-up is commonly used in data warehousing to generate summary reports or perform calculations on aggregated data.

  • Scan component is often used in data processing pipelines to iterate through lar...read more

Q34. What do you consider while choosing between a SQL and nosql database.

Ans.

Consider data structure, scalability, consistency, and query requirements when choosing between SQL and NoSQL databases.

  • Consider data structure - SQL for structured data, NoSQL for unstructured or semi-structured data

  • Scalability - NoSQL databases are more scalable horizontally

  • Consistency - SQL databases offer strong consistency, while NoSQL databases may offer eventual consistency

  • Query requirements - SQL for complex queries, NoSQL for simple queries or real-time data processi...read more

Q35. React Router & Authentication using jwt

Ans.

React Router is used for client-side routing in React applications. JWT is used for authentication by generating tokens for secure communication.

  • React Router is a library that allows for declarative routing in React applications

  • Authentication using JWT involves generating a token on the server and sending it to the client for subsequent requests

  • JWT tokens typically contain information about the user and are signed to ensure their authenticity

Q36. Explain the features of java 8 and java 11

Ans.

Java 8 introduced features like lambda expressions, streams, and default methods. Java 11 introduced features like local-variable syntax for lambda parameters and HTTP client API.

  • Java 8: Lambda expressions allow functional programming in Java. Streams provide a way to work with collections. Default methods allow adding new methods to interfaces without breaking existing implementations.

  • Java 11: Local-variable syntax for lambda parameters simplifies code readability. HTTP clie...read more

Q37. DB Query to find duplicates in a table, keeping first duplicate in answer.

Ans.

DB query to find duplicates in a table, keeping first duplicate in answer.

  • Use GROUP BY clause to group the records by the column(s) that may have duplicates

  • Use HAVING clause to filter out groups with only one record

  • Use MIN or MAX function to select the first record in each group

  • Example: SELECT MIN(id), name, COUNT(*) FROM table GROUP BY name HAVING COUNT(*) > 1

Q38. How to manage memory management in Python?

Ans.

Memory management in Python involves automatic memory allocation and deallocation through garbage collection.

  • Python uses automatic memory management through garbage collection, so manual memory management is not required.

  • Use tools like memory_profiler to identify memory leaks and optimize memory usage.

  • Avoid creating unnecessary objects and use data structures efficiently to minimize memory usage.

Q39. Write a code in c c++ or any other language to validate all use cases for an ip address given as input string. Output will be yes or no.

Ans.

Code to validate all use cases for an IP address input string and output yes or no.

  • Use regular expressions to match the input string against the valid IP address pattern.

  • Check for valid ranges of each octet (0-255) and proper formatting (4 octets separated by periods).

  • Handle edge cases like leading zeros, extra spaces, and invalid characters.

  • Return 'yes' if the input string is a valid IP address, otherwise return 'no'.

Q40. coding question to remove duplicate , count frequencies of occurrence of characters

Ans.

Remove duplicates and count frequencies of characters in an array of strings.

  • Iterate through each string in the array

  • Use a hashmap to store characters and their frequencies

  • Remove duplicates by checking if character already exists in hashmap

Q41. 5. SQL: Different Types of triggers, define index and its types

Ans.

Triggers in SQL are special stored procedures that are automatically executed when certain events occur in a database. Indexes in SQL are used to speed up the retrieval of data from tables.

  • Types of triggers: DML triggers (insert, update, delete), DDL triggers (create, alter, drop), and Logon triggers.

  • Indexes in SQL are used to quickly retrieve data from tables. Types of indexes include clustered, non-clustered, unique, and composite indexes.

  • Example: CREATE TRIGGER trgAfterIns...read more

Q42. Code to map Employee Object from List to Hashmap using Stream API functions.

Ans.

Code to map Employee Object from List to Hashmap using Stream API functions.

  • Create a List of Employee objects

  • Use stream() method to convert List to Stream

  • Use collect() method to convert Stream to HashMap

  • Use Collectors.toMap() method to create HashMap

  • Pass key and value mapping functions to toMap() method

Q43. What is your current CTC What is your ECTC

Ans.

I prefer not to disclose my current CTC. My expected CTC is based on industry standards and my experience.

  • Politely decline to disclose current CTC

  • Provide expected CTC based on industry standards and experience

  • Research industry standards and salary ranges for similar positions

  • Consider other benefits and perks besides salary

Q44. Get 7th highest salary without CTE

Ans.

Get 7th highest salary without CTE

  • Use subquery to get distinct salaries

  • Order the salaries in descending order

  • Use LIMIT and OFFSET to get the 7th highest salary

Q45. Explain the recent functionality that I have worked on with a flow diagram.

Ans.

I recently worked on implementing a new search functionality for our e-commerce platform.

  • Designed a search algorithm to improve search accuracy and speed

  • Implemented filters for users to refine search results

  • Created a user-friendly interface for displaying search results

  • Integrated the search functionality with the backend database

  • Tested the functionality to ensure it met performance requirements

Q46. Difference between select_related vs prefetch_related with example?

Ans.

select_related follows foreign key relationships and retrieves related objects in a single query, while prefetch_related retrieves related objects separately to avoid performance issues.

  • select_related is used for accessing related objects in a single query, reducing database hits

  • prefetch_related is used for accessing related objects separately to avoid performance issues

  • select_related is more efficient for one-to-one or many-to-one relationships, while prefetch_related is bet...read more

Q47. Reverse String without reversing integer in String What is iOS What is URLSession What is CoreData.

Ans.

Reverse a string without reversing integer in it

  • Iterate through the string and swap characters from start and end until the middle is reached

  • Use two pointers, one at the start and one at the end of the string

  • Check if the character at the start pointer is a digit, if yes, move the pointer to the next character

  • Check if the character at the end pointer is a digit, if yes, move the pointer to the previous character

Q48. What is the difference between map object and map

Ans.

Map object is an instance of Map class while map is a data structure that stores key-value pairs.

  • Map object is mutable while map is immutable

  • Map object can have any type of key while map keys are restricted to hashable types

  • Map object has methods like set(), get(), delete() while map has no such methods

  • Map object is used in object-oriented programming while map is used in functional programming

Q49. What are databases are present in Azure DB

Ans.

Azure DB offers various databases including SQL Database, Cosmos DB, MySQL, PostgreSQL, and MariaDB.

  • SQL Database

  • Cosmos DB

  • MySQL

  • PostgreSQL

  • MariaDB

Q50. What is diff between ActiveMQ and RabbitMQ

Ans.

ActiveMQ is Java-based messaging broker while RabbitMQ is a message broker that implements the Advanced Message Queuing Protocol (AMQP).

  • ActiveMQ is written in Java and supports multiple messaging protocols like OpenWire, STOMP, MQTT, and AMQP.

  • RabbitMQ is written in Erlang and specifically implements the AMQP protocol.

  • ActiveMQ is more feature-rich and has a larger user base, while RabbitMQ is known for its reliability and performance.

  • ActiveMQ has a more complex setup and confi...read more

1
2
3
4
5
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10k Interviews
3.9
 • 7.8k Interviews
3.7
 • 7.3k Interviews
3.7
 • 5.2k Interviews
3.8
 • 4.7k Interviews
3.6
 • 3.7k Interviews
3.6
 • 3.6k Interviews
3.6
 • 2.3k Interviews
3.4
 • 771 Interviews
3.7
 • 508 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Senior Software Engineer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter