Senior Software Engineer

3500+ Senior Software Engineer Interview Questions and Answers

Updated 10 Feb 2025

Q551. What is Dependency Injection ? How is dependency Injection achieved ?

Ans.

Dependency Injection is a design pattern in which a class receives its dependencies from external sources rather than creating them itself.

  • Dependency Injection helps in achieving loose coupling between classes.

  • It allows for easier testing and maintenance of code.

  • There are three common ways to achieve Dependency Injection: Constructor Injection, Setter Injection, and Interface Injection.

Q552. Can we create more than a foreign key in single table?

Ans.

Yes, it is possible to create multiple foreign keys in a single table.

  • Multiple foreign keys can be created in a single table by referencing different columns in the same or different tables.

  • Each foreign key constraint must be defined separately with appropriate references.

  • Foreign keys help maintain referential integrity between tables in a database.

  • Example: Creating foreign keys in a 'Orders' table to reference 'Customers' and 'Products' tables.

Q553. How to remove duplicate rows in a table without using distinct?

Ans.

Use a self join to remove duplicate rows in a table without using distinct.

  • Join the table with itself on the columns that define duplicates

  • Filter out rows where the primary key is the same but other columns are different

  • Select only distinct rows based on the primary key

Q554. What are custom middleware? Have you implemented in previous project how

Ans.

Custom middleware are functions that have access to the request and response objects in an Express application's request-response cycle.

  • Custom middleware can be used to perform tasks such as logging, authentication, error handling, etc.

  • Middleware functions can be added to the request handling chain using the 'use' method in Express.

  • An example of custom middleware implementation is adding a function to log request details before passing it to the route handler.

Are these interview questions helpful?

Q555. In which scenario you use documents based database over SQL based database and why ??

Ans.

Document-based databases are preferred for unstructured data and flexible schemas, while SQL databases are better for structured data and complex queries.

  • Use document-based databases for unstructured data like JSON, XML, etc.

  • Document-based databases have flexible schemas, allowing for easy changes and additions to data structure.

  • SQL databases are better for structured data with complex relationships and queries.

  • Examples of document-based databases include MongoDB, Couchbase, ...read more

Q556. What are architectural, structural, behavioural design patterns? Why we need them?

Ans.

Architectural, structural, and behavioral design patterns are reusable solutions to common software design problems.

  • Architectural patterns define the overall structure of a software system

  • Structural patterns describe how objects and classes can be combined to form larger structures

  • Behavioral patterns focus on communication between objects and how they operate together

  • Design patterns help to improve software quality, maintainability, and scalability

  • Examples include MVC, Single...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q557. What design tool can be implemented to determine if A and B are friends, and if B and C are friends, subsequently making A and C friends automatically?

Ans.

A graph traversal algorithm like Depth First Search (DFS) can be implemented to determine if A and B are friends, and if B and C are friends, subsequently making A and C friends automatically.

  • Implement a graph where each person is a node and friendships are edges between nodes

  • Use Depth First Search (DFS) to traverse the graph and check for connections between A and B, and B and C

  • If both connections exist, then A and C are friends as well

Q558. How instagram application works. If someone tagged you how you will get notification and how those reels are showing in your profile page...etc.

Ans.

Instagram uses a notification system to alert users when they are tagged and displays reels on the profile page based on user preferences and algorithms.

  • Instagram uses a push notification system to alert users when they are tagged in a post or story.

  • Reels are displayed on the profile page based on user engagement, preferences, and algorithms.

  • The Explore page also suggests reels to users based on their interests and interactions on the platform.

Senior Software Engineer Jobs

Senior Software Engineer 6-14 years
Maersk Global Service Centres India Pvt. Ltd.
4.2
Pune
Senior software Engineer 6-14 years
Maersk Global Service Centres India Pvt. Ltd.
4.2
Pune
Sr Software Engineer 5-9 years
GE India Industrial Private Limited
4.2
Bangalore / Bengaluru

Q559. What is the difference between AngularJS & angular 10

Ans.

AngularJS is the first version of Angular, while Angular 10 is the latest version with significant improvements and updates.

  • AngularJS is based on JavaScript, while Angular 10 is based on TypeScript.

  • AngularJS uses controllers and $scope for data binding, while Angular 10 uses components and directives.

  • AngularJS has two-way data binding, while Angular 10 has one-way data binding by default.

  • AngularJS uses $http for AJAX requests, while Angular 10 uses HttpClient module for the s...read more

Q560. Which list you will prefer using if you want to create an application that needs constant modification, ArrayList or LinkedList

Ans.

LinkedList is preferred for constant modification due to faster insertion and deletion times.

  • LinkedList is preferred for constant modification because it has faster insertion and deletion times compared to ArrayList.

  • LinkedList allows for easy insertion and deletion of elements without the need to shift other elements, making it more efficient for constant modifications.

  • ArrayList is better for random access and iterating through elements, while LinkedList is better for frequen...read more

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

Q562. Write a code to find if two words are anagrams

Ans.

Code to check if two words are anagrams

  • Convert both words to lowercase

  • Remove all spaces and punctuation

  • Sort the characters in both words

  • Compare the sorted words

Q563. 1. Count the number of flips require to convert a binary string of 0 and 1 such that resultant string has alternate 0 and 1

Ans.

Count the number of flips required to convert a binary string to alternate 0 and 1.

  • Iterate through the string and count the number of flips required to make it alternate.

  • Keep track of the current character and the expected character.

  • Example: 001101 -> 010101 requires 2 flips.

  • Example: 101010 -> 010101 requires 3 flips.

Q564. 1. How to use unions inside structure? When is a union used.

Ans.

Unions inside structures allow multiple variables to share the same memory location. They are used when only one variable needs to be active at a time.

  • Unions are used when you want to save memory by sharing the same memory location for different variables in a structure.

  • Only one variable inside the union can be active at a time, as they all share the same memory space.

  • Unions are useful when you have a structure with multiple variables, but only one variable needs to be active...read more

Q565. Accumulators in spark python sum of odd places in list Partition and bucketing

Ans.

Spark accumulators are used to accumulate values across multiple tasks in a distributed manner.

  • Accumulators are used to accumulate values across multiple tasks in a distributed manner

  • They are used to implement counters and sums in Spark

  • Accumulators are read-only variables that can only be updated by an associative and commutative operation

  • Partitioning is the process of dividing a large dataset into smaller, more manageable pieces

  • Bucketing is a technique used to group data int...read more

Q566. difference between == and equals

Ans.

The '==' operator compares the reference of objects, while the 'equals' method compares the content of objects.

  • The '==' operator checks if two objects refer to the same memory location.

  • The 'equals' method compares the content of objects based on their implementation.

  • The 'equals' method can be overridden to provide custom comparison logic.

  • Example: String str1 = new String('hello'); String str2 = new String('hello'); str1 == str2 will be false, but str1.equals(str2) will be tru...read more

Q567. Explain depencey injection .how to use?

Ans.

Dependency injection is a design pattern where the dependencies of a class are provided externally rather than created internally.

  • Dependency injection helps in achieving loose coupling and improves testability and maintainability.

  • There are three types of dependency injection: constructor injection, setter injection, and interface injection.

  • In constructor injection, dependencies are provided through the class constructor.

  • In setter injection, dependencies are provided through s...read more

Q568. Explain the difference between intension and extension in a database.

Q569. Find the type of data structure based on the operation performed. Given the order of insertion and deletion. Find whether this operation corresponds to stack/queue /priority queue

Ans.

Identify data structure based on insertion and deletion order

  • If insertion and deletion follow LIFO order, it is a stack

  • If insertion follows FIFO order and deletion follows LIFO order, it is a queue

  • If insertion and deletion follow priority order, it is a priority queue

Q570. How to configure itsm and charm in solution manager.

Ans.

ITSM and Charm can be configured in Solution Manager by following these steps:

  • Ensure that the ITSM and Charm components are installed in Solution Manager

  • Configure the ITSM system connection in Solution Manager

  • Configure the Charm system connection in Solution Manager

  • Activate the ITSM and Charm functionalities in Solution Manager

  • Configure the ITSM and Charm workflows in Solution Manager

  • Test the ITSM and Charm functionalities in Solution Manager

Q571. Version of Java and Spring boot you are using in your current project?

Ans.

We are using Java 11 and Spring Boot 2.4.3 in our current project.

  • Java 11 provides better performance and security features compared to previous versions.

  • Spring Boot 2.4.3 offers improved support for Kotlin and GraalVM.

  • We are also using Spring Data JPA for database access and Spring Security for authentication and authorization.

Q572. What is higher order functions. And it's usage.

Ans.

Higher order functions are functions that take other functions as arguments or return functions as their result.

  • Higher order functions allow for more flexible and reusable code.

  • They can be used for tasks such as filtering, mapping, and reducing arrays.

  • Examples include Array.prototype.map(), Array.prototype.filter(), and Array.prototype.reduce().

Q573. what is passport.js why it is used

Ans.

Passport.js is an authentication middleware for Node.js.

  • Passport.js provides a simple way to authenticate users with various authentication strategies such as local, OAuth, OpenID, etc.

  • It is highly customizable and can be integrated with any Node.js web application framework.

  • Passport.js maintains user sessions and provides a consistent API for authentication across different strategies.

  • Example: Using Passport.js with Express.js to authenticate users with Google OAuth2.

  • Example...read more

Q574. What is the page life cycle of ASP.Net?

Ans.

The page life cycle of ASP.Net is a series of events that occur when a web page is requested and processed by the server.

  • The page life cycle consists of several stages such as initialization, loading, postback handling, rendering, and unloading.

  • During the initialization stage, the page and its controls are created and their properties are set.

  • In the loading stage, the page retrieves and processes the user input and updates the control state.

  • If there is a postback, the postbac...read more

Q575. Write a Linked list program with Add,delete,count & modify API features.

Ans.

Program to implement a linked list with Add, delete, count and modify API features.

  • Create a Node class with data and next pointer

  • Create a LinkedList class with methods to add, delete, count and modify nodes

  • Use a head pointer to keep track of the first node

  • For add and modify, traverse the list to find the node to add/modify

  • For delete, traverse the list to find the node to delete and update the next pointers

  • For count, traverse the list and increment a counter variable

Q576. Write code to insert a node to the middle of linked list

Ans.

Insert a node to the middle of a linked list

  • Find the middle node using slow and fast pointers

  • Create a new node with the data to be inserted

  • Adjust the pointers to insert the new node in the middle

Q577. What are joins? Explain difference in Truncate and delete? Explain index in SQL? Explain string builder? Explain rank and dense rank? What is performamce tuning? Explain about SSIS package developement? Explain...

read more
Ans.

Joins are used to combine rows from two or more tables based on a related column between them. Truncate removes all records from a table, while delete removes specific records. Indexes in SQL are used to quickly retrieve data. String builder is a class that helps in creating strings efficiently. Rank and dense rank are functions used to assign a rank to each row in a result set. Performance tuning involves optimizing the performance of a system. SSIS package development invol...read more

Q578. What is Exception Handling? How many types are there ?

Ans.

Exception Handling is a mechanism to handle runtime errors and prevent program crashes.

  • It is used to catch and handle errors that occur during program execution.

  • There are two types of exceptions: checked and unchecked.

  • Checked exceptions are checked at compile-time and must be handled or declared.

  • Unchecked exceptions are not checked at compile-time and do not need to be handled or declared.

  • Examples of exceptions include NullPointerException, ArrayIndexOutOfBoundsException, and...read more

Q579. What you do when your wifi is not connected with other device and you didn't get password

Ans.

Try to troubleshoot the wifi connection issue by checking settings, restarting devices, and seeking help from IT support.

  • Check if the wifi is turned on and the correct network is selected

  • Restart the wifi router and the device

  • Contact IT support for assistance in retrieving the password

Q580. Explain design patterns you know

Ans.

Design patterns are reusable solutions to common software problems.

  • Creational patterns: Singleton, Factory, Abstract Factory

  • Structural patterns: Adapter, Decorator, Facade

  • Behavioral patterns: Observer, Strategy, Command

  • Architectural patterns: Model-View-Controller, Model-View-ViewModel

  • Concurrency patterns: Thread Pool, Producer-Consumer

  • Examples: Singleton ensures only one instance of a class exists, Factory creates objects without exposing the instantiation logic, Observer al...read more

Q581. list data structure, how Map works, what is advantage of Java, Sorting algorithm, how will reverse string using Java

Ans.

Questions on data structures, Java advantages, sorting algorithms, and string reversal using Java.

  • Data structures: list, map

  • Map works by storing key-value pairs and allows fast retrieval of values using keys

  • Java advantages: platform independence, object-oriented programming, automatic memory management

  • Sorting algorithms: bubble sort, quick sort, merge sort

  • Reverse string using Java: use StringBuilder class and its reverse() method

Q582. sending multiple request to backend at a time, how can you achieve

Ans.

To send multiple requests to the backend at a time, you can use asynchronous programming or multithreading.

  • Use asynchronous programming techniques like callbacks, promises, or async/await to send multiple requests concurrently.

  • Implement multithreading to achieve parallel processing of requests.

  • Consider using libraries or frameworks that provide built-in support for concurrent requests, such as Node.js with Express or Java with Spring.

  • Ensure proper error handling and synchroni...read more

Q583. What is the difference between Map and flatMap

Ans.

Map transforms each element of a collection, while flatMap transforms each element into a new collection.

  • Map applies a function to each element of a collection and returns a new collection with the transformed elements.

  • FlatMap applies a function to each element of a collection and returns a new collection by concatenating the resulting collections.

  • Map returns a collection with the same number of elements as the original collection, while flatMap can return a collection with a...read more

Q584. Find the triplets in an array whose sum is 0 , complexity - O(n2)

Ans.

Use nested loops to iterate through array and find triplets with sum 0.

  • Iterate through array with two nested loops to find all possible pairs.

  • For each pair, check if there is a third element that completes the triplet with sum 0.

  • Store the triplets found in a separate array.

Q585. What is difference between left join and left outer join?

Ans.

Left join and left outer join are the same thing.

  • Both return all records from the left table and matching records from the right table.

  • The only difference is in the case of no matching records in the right table.

  • Left join returns null values for the right table columns while left outer join returns all columns with null values for non-matching records.

Q586. What is the design of the microservices implemented in your current project?

Ans.

The microservices in our current project are designed using a combination of RESTful APIs and event-driven architecture.

  • Microservices are designed to be loosely coupled and independently deployable.

  • Each microservice focuses on a specific business domain or functionality.

  • Communication between microservices is done through RESTful APIs and message queues.

  • We use event-driven architecture for handling asynchronous communication and data flow.

  • Each microservice is responsible for i...read more

Q587. What is the Java Collection Framework?

Ans.

Java Collection Framework is a set of classes and interfaces that provide various data structures and algorithms to store and manipulate collections of objects.

  • Includes interfaces like List, Set, Queue, and classes like ArrayList, LinkedList, HashSet, PriorityQueue

  • Provides implementations for common data structures like lists, sets, maps, queues, stacks

  • Offers algorithms for searching, sorting, and manipulating collections

  • Allows easy iteration and manipulation of collections u...read more

Q588. Can you explain the Singleton pattern?

Q589. Explain how would you automate a web service when client sends you the requirement.

Ans.

Automating a web service when client sends requirement

  • Analyze the requirement and identify the necessary APIs

  • Create test cases and scripts for the APIs

  • Use a tool like Postman or SoapUI to automate the testing

  • Integrate the automation with a CI/CD pipeline for continuous testing

  • Monitor the service for any issues and update the automation as needed

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

Q591. Q. How to improve SQL performance

Ans.

Improving SQL performance involves optimizing queries, indexes, and server resources.

  • Optimize queries by reducing complexity and avoiding unnecessary joins

  • Use indexes to speed up data retrieval

  • Ensure server resources are adequate for the workload

  • Consider partitioning large tables to improve query performance

  • Use stored procedures to reduce network traffic and improve security

Q592. Storage classes explain all the storage classes in c.

Ans.

Storage classes in C define the scope and lifetime of variables.

  • auto: default storage class for local variables

  • register: stores variables in CPU registers for faster access

  • static: retains value between function calls

  • extern: used to access global variables across multiple files

Q593. There is one black king and N number of white knights. You need to find is king under attack and is checkmate?

Ans.

Check if the black king is under attack and if it is checkmate.

  • Check if any white knight can capture the black king

  • Check if the black king has any legal moves to escape capture

  • If the black king is under attack and has no legal moves, it is checkmate

Q594. What are the various navigation commands supported by Selenium?
Q595. What is the difference between INNER JOIN and OUTER JOIN in SQL?

Q596. What you have used for styling, Material UI or bootstrap.

Ans.

I have used both Material UI and Bootstrap for styling.

  • I have used Material UI for a project that required a more modern and sleek design.

  • I have used Bootstrap for a project that required a more traditional and familiar design.

  • Both frameworks have their strengths and weaknesses, and I choose the one that best fits the project's needs.

  • I am also familiar with other styling frameworks such as Semantic UI and Foundation.

Q597. Tell the order of output, among process, promise, setTimeout, fs, setInterval.

Ans.

The order of output is fs, process, setTimeout, setInterval, promise.

  • fs module is synchronous and will output first

  • process is next in line

  • setTimeout will be executed after process

  • setInterval will be executed after setTimeout

  • promise will be executed last

Q598. Tell the output among various for loops using var, let and bind.

Ans.

Output comparison of for loops using var, let, and bind in JavaScript.

  • Using var: variable is function-scoped, may lead to unexpected behavior in loops.

  • Using let: variable is block-scoped, recommended for loop iterations.

  • Using bind: creates a new function with a specified 'this' value and initial arguments.

Q599. What do you do on daily basis, and how to decide a tech-stack on high level.

Ans.

I work on coding, debugging, testing, and collaborating with team members. Tech stack decisions are based on project requirements, scalability, performance, and team expertise.

  • Daily tasks include coding, debugging, testing, and collaborating with team members

  • Tech stack decisions are based on project requirements, scalability, performance, and team expertise

  • Consider factors like language compatibility, libraries/frameworks availability, community support, and future scalabilit...read more

Q600. 1. How to get last property of an object in js? 2. Count the number of properties in object? 3. How do you trigger lambda with s3 ?

Ans.

1. To get the last property of an object in JavaScript, you can use Object.keys() method. 2. To count the number of properties in an object, you can use Object.keys() method. 3. To trigger a lambda function with S3, you can use S3 event notifications.

  • To get the last property of an object in JavaScript, you can use Object.keys() method and access the last key in the array.

  • To count the number of properties in an object, you can use Object.keys() method and get the length of the...read more

Previous
9
10
11
12
13
14
15
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10.4k Interviews
3.8
 • 8.2k Interviews
3.6
 • 7.6k Interviews
3.7
 • 5.6k Interviews
3.7
 • 4.8k Interviews
3.5
 • 3.8k Interviews
3.5
 • 3.8k Interviews
3.8
 • 3k Interviews
3.4
 • 805 Interviews
3.7
 • 535 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

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