Senior Software Engineer
3500+ Senior Software Engineer Interview Questions and Answers
Popular Companies
Q51. Find All Pairs Adding Up to Target
Given an array of integers ARR
of length N
and an integer Target
, your task is to return all pairs of elements such that they add up to the Target
.
Input:
The first line conta...read more
The task is to find all pairs of elements in an array that add up to a given target.
Iterate through the array and for each element, check if the target minus the element exists in a hashmap.
If it exists, print the pair (current element, target - current element).
If no pair is found, print (-1, -1).
Q52. Kth Largest Element Problem Statement
Ninja enjoys working with numbers, and Alice challenges him to find the Kth largest value from a given list of numbers.
Input:
The first line contains an integer 'T', repre...read more
The task is to find the Kth largest element in a given list of numbers for each test case.
Read the number of test cases 'T'
For each test case, read the number of elements 'N' and the value of 'K'
Sort the array in descending order and output the Kth element
Q53. Next Greater Element Problem Statement
Given a list of integers of size N
, your task is to determine the Next Greater Element (NGE) for every element. The Next Greater Element for an element X
is the first elem...read more
The task is to find the Next Greater Element for each element in a list of integers.
Iterate through the list of integers from right to left
Use a stack to keep track of elements for which the Next Greater Element is not yet found
Pop elements from the stack until a greater element is found or the stack is empty
Q54. Find Terms of Series Problem
Ayush is tasked with determining the first 'X' terms of the series defined by 3 * N + 2, ensuring that no term is a multiple of 4.
Input:
The first line contains a single integer 'T...read more
Generate the first 'X' terms of a series 3 * N + 2, excluding multiples of 4.
Iterate through numbers starting from 1 and check if 3 * N + 2 is not a multiple of 4.
Keep track of the count of terms generated and stop when 'X' terms are found.
Return the list of terms that meet the criteria for each test case.
Q55. Find Duplicates in an Array
Given an array ARR
of size 'N', where each integer is in the range from 0 to N - 1, identify all elements that appear more than once.
Return the duplicate elements in any order. If n...read more
Find duplicates in an array of integers within a specified range.
Iterate through the array and keep track of the count of each element using a hashmap.
Return elements with count greater than 1 as duplicates.
Handle edge cases like empty array or no duplicates found.
Example: For input [0, 3, 1, 2, 3], output should be [3].
Q56. 1) What is volatile? 2) What is constant? 3) Can we use volatile and const at a time?4) What is ISR how it works?
Answers to questions related to software engineering concepts.
Volatile is a keyword used to indicate that a variable's value can be changed unexpectedly.
Constant is a keyword used to indicate that a variable's value cannot be changed once it is assigned.
Volatile and const can be used together to indicate that a variable's value cannot be changed and that it may change unexpectedly.
ISR stands for Interrupt Service Routine and is a function that is called when an interrupt occu...read more
Share interview questions and help millions of jobseekers 🌟
Q57. Make Unique Array Challenge
Your task is to determine the minimum number of elements that need to be removed from an array 'ARR' of size 'N' such that all the remaining elements are distinct. In simpler terms, ...read more
Find the minimum number of elements to remove from an array to make all elements distinct.
Iterate through the array and keep track of the frequency of each element using a hashmap.
Count the number of elements that have a frequency greater than 1, as those need to be removed.
Return the count of elements to be removed.
Lambda expression in Java is a concise way to represent a method implementation. It is related to functional interfaces by providing a single abstract method implementation.
Lambda expressions allow you to write concise code by providing a way to represent a method implementation in a more compact form.
Functional interfaces are interfaces with a single abstract method. Lambda expressions can be used to provide the implementation for this single method.
For example, a functional...read more
Senior Software Engineer Jobs
Q59. What is difference between Microflow and Nanoflow in Mendix?
Microflows and nanoflows are both used in Mendix for defining business logic, but they differ in their scope and complexity.
Microflows are used for larger and more complex processes, while nanoflows are used for smaller and simpler processes.
Microflows can have multiple activities and can be triggered by events, while nanoflows have a single activity and are typically called from microflows.
Microflows can have input and output parameters, while nanoflows do not support parame...read more
Thread class is a class in Java that extends the Thread class, while Runnable interface is an interface that implements the run() method.
Thread class extends the Thread class, while Runnable interface implements the run() method.
A class can only extend one class, so using Runnable interface allows for more flexibility in the class hierarchy.
Using Runnable interface separates the task from the thread, promoting better design practices.
Example: Thread t = new Thread(new MyRunna...read more
Q61. 1. High Level System Design -> Design Uber like Service. Follow up -> What would be your tech stack for designing such a service to make sure it could scale when needed.
Tech stack for designing a scalable Uber-like service.
Use microservices architecture for scalability and fault tolerance.
Choose a cloud provider with auto-scaling capabilities.
Use a load balancer to distribute traffic across multiple instances.
Use a NoSQL database for high availability and scalability.
Use message queues for asynchronous communication between services.
Use containerization for easy deployment and management.
Use caching to improve performance.
Use monitoring and ...read more
Q62. Solved it by looping through each element first. Split the string into an array to get access to each character. Using the .every() method checks whether each character of the string is present inside the user...
read moreThe question asks about using .every() and .includes() methods to check if each character of a string is present in another string.
Loop through each element of the string
Split the string into an array to access each character
Use .every() method to check if each character is present in the user string
Use .includes() method to check if the character is present
Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.
Abstract class can have constructor, fields, and methods, while interface cannot have any of these.
A class can implement multiple interfaces but can only inherit from one abstract class.
Abstract classes are used to provide a common base for related classes, while interfaces define a contract for classes to implement.
Example: Abstract class 'Shape' with abstract metho...read more
Autowiring in Spring Boot is a feature that allows Spring to automatically inject dependencies into a Spring bean.
Autowiring eliminates the need for explicit bean wiring in the Spring configuration file.
There are different modes of autowiring in Spring Boot: 'byName', 'byType', 'constructor', 'autodetect', and 'no'.
For example, in 'byName' mode, Spring looks for a bean with the same name as the property that needs to be autowired.
Q65. Write a Program identify Max length of a substring from a given string and also the substring should be palindrome
Program to find the longest palindrome substring in a given string.
Iterate through the string and check for palindromes of different lengths
Store the longest palindrome found
Return the length and substring
The CTC offered for this position is competitive and includes salary, benefits, and bonuses.
CTC includes salary, benefits, bonuses, and other perks
Negotiation may be possible based on experience and skills
CTC details are typically discussed during the final stages of the interview process
Q67. How have you handled security in your Angular and .NET Core applications, such as implementing JWT or OAuth authentication?
Implemented JWT and OAuth authentication in Angular and .NET Core apps.
Used Angular's HttpInterceptor to add JWT token to requests
Implemented OAuth2 authentication using IdentityServer4 in .NET Core
Stored user credentials securely using ASP.NET Core Identity
Used HTTPS to encrypt data in transit
Implemented role-based authorization using ASP.NET Core Identity
Q68. What are custom hooks in React, and what are their use cases? Additionally, can you provide an example of a custom hook that performs an API call and utilizes the retrieved data?
Custom hooks in React are reusable functions that allow you to extract component logic into separate functions for better code organization and reusability.
Custom hooks are created using the 'use' prefix and can be used to share logic between components.
Use cases for custom hooks include fetching data from an API, handling form state, managing local storage, and more.
Example of a custom hook for API call: const useFetchData = (url) => { // logic to fetch data from API }
Clustered Index physically reorders the data in the table, while Non-Clustered Index creates a separate structure.
Clustered Index determines the physical order of data rows in a table.
Non-Clustered Index creates a separate structure that points back to the original table.
Clustered Index is faster for retrieval of data, while Non-Clustered Index is faster for retrieval of specific rows.
Example: Primary key in a table is usually implemented as a Clustered Index, while secondary...read more
Designing the Low-Level Design (LLD) and High-Level Design (HLD) for a system like BookMyShow.
For HLD, identify main components like user interface, booking system, payment gateway, and database.
For LLD, break down each component into detailed modules and their interactions.
Consider scalability, security, and performance in both designs.
Example: HLD - User selects movie -> Booking system checks availability -> Payment gateway processes transaction.
Example: LLD - Booking syste...read more
Q71. What is nodejs and difference between nodejs and javascript
Node.js is a server-side JavaScript runtime environment.
Node.js is built on top of the V8 JavaScript engine from Google Chrome.
It allows developers to write server-side code in JavaScript.
Node.js has a non-blocking I/O model, making it efficient for handling large amounts of data.
Node.js has a vast library of modules available through npm (Node Package Manager).
Q72. 1)Val a = Array(1,2,1,3,4) Need output as (1,2) (2,1) (1,3) (3,4)
Print pairs of adjacent elements in an array
Loop through the array and print each pair of adjacent elements
Use a for loop and access the elements using their indices
Example: for i in 0 until a.length-1 print (a[i], a[i+1])
The start() method is used to start a new thread, while the run() method contains the code that will be executed by the thread.
start() method is used to start a new thread and calls the run() method internally
run() method contains the code that will be executed by the thread
It is recommended to override the run() method with the desired functionality
Q74. What do you mean by Integration, middleware, EAI systems
Integration, middleware, and EAI systems are technologies that enable communication and data exchange between different software applications.
Integration involves connecting different software applications to enable data exchange and communication.
Middleware is software that sits between different applications and facilitates communication and data exchange.
EAI (Enterprise Application Integration) systems are a type of middleware that enable communication between different en...read more
Q75. What is the difference between a hard link and a symbolic link in Unix? How do you find out the system's IP address in Unix? What is the function of the chmod command in Unix? Explain the difference between gre...
read moreUnix related questions for Senior Software Engineer interview
A hard link is a direct link to the physical file on disk, while a symbolic link is a reference to the file by name.
To find out the system's IP address in Unix, you can use commands like ifconfig or ip addr show.
The chmod command in Unix is used to change the permissions of a file or directory.
grep is used for searching text using regular expressions, while egrep is an extended version of grep with more powerful pat...read more
Designing a database schema for a support ticketing system like Freshdesk.
Create a 'Tickets' table with fields like ticket ID, subject, description, status, priority, etc.
Include a 'Users' table for customer and agent information.
Establish a 'Categories' table for ticket categorization.
Implement a 'Comments' table to track communication history.
Utilize foreign keys to establish relationships between tables.
Q77. What is the biggest challenge you faced in developing azure solution?
The biggest challenge in developing Azure solution was managing the complexity of the cloud environment.
Managing the complexity of the cloud environment
Ensuring scalability and reliability
Integrating with existing systems
Securing the solution
Optimizing cost
Example: Migrating a legacy application to Azure
DELETE removes specific rows from a table, while TRUNCATE removes all rows and resets auto-increment values.
DELETE is a DML command, while TRUNCATE is a DDL command.
DELETE can be rolled back, while TRUNCATE cannot be rolled back.
DELETE triggers ON DELETE triggers, while TRUNCATE does not trigger any triggers.
DELETE is slower as it logs individual row deletions, while TRUNCATE is faster as it logs the deallocation of data pages.
Example: DELETE FROM table_name WHERE condition; ...read more
Java is platform independent because it compiles code into bytecode that can run on any system with a JVM, which is platform dependent.
Java code is compiled into bytecode, which is platform independent
The JVM interprets the bytecode and translates it into machine code specific to the underlying platform
This allows Java programs to run on any system with a JVM installed, making Java platform independent
Common testing questions related to Linux and operating systems
What are the different types of testing that can be performed on a Linux operating system?
How do you test the compatibility of software with different Linux distributions?
Can you explain the process of testing kernel modules in a Linux environment?
What tools and techniques do you use for performance testing on Linux systems?
How do you ensure the security and stability of a Linux server through testing?
Q81. What if, i need to make some changes into the POCO class to extend the entity to add some extra properties?
Modifying the POCO class allows extending the entity with additional properties.
To add extra properties, simply modify the POCO class by adding new properties.
Ensure that the changes are reflected in the database schema if necessary.
Update any existing code that interacts with the POCO class to handle the new properties.
Consider the impact on serialization, validation, and any other relevant aspects.
Q82. If I have assigned different colors to an ID and a class and applied both to the same element, which color will be applied based on CSS specificity precedence?
The color applied will be based on the specificity of the selector, with ID having higher specificity than class.
ID has higher specificity than class in CSS
Color applied will be based on the selector with higher specificity
Example: If ID selector has color red and class selector has color blue, the color applied will be red
Q83. What will be the output of the following JavaScript code fragment: `const a; function test() { console.log(a); }; test();`?
The code will throw an error because 'a' is declared but not initialized.
The code will result in a ReferenceError because 'a' is declared but not assigned a value.
Variables declared with 'const' must be initialized at the time of declaration.
Initializing 'a' with a value before calling test() will prevent the error.
Q84. How many types of variables there in Java?
There are three types of variables in Java: local, instance, and static.
Local variables are declared within a method or block and have limited scope.
Instance variables are declared within a class but outside of any method and are accessible to all methods of the class.
Static variables are declared with the static keyword and are shared among all instances of the class.
Examples: int x; //instance variable, static int y; //static variable, void method() { int z; //local variabl...read more
SOLID principles are a set of five design principles in object-oriented programming to make software designs more understandable, flexible, and maintainable.
S - Single Responsibility Principle: A class should have only one reason to change.
O - Open/Closed Principle: Software entities should be open for extension but closed for modification.
L - Liskov Substitution Principle: Objects of a superclass should be replaceable with objects of its subclasses without affecting the func...read more
Q86. Is parallel stream always beneficial in java stream API? Java Singleton vs Spring Singleton write a program to find the nth largest number in an array of integers. Spring bean scopes. how will you handle a larg...
read moreParallel stream is not always beneficial in Java Stream API.
Parallel stream can be slower than sequential stream for small data sets or when the overhead of parallelism is greater than the benefit.
Parallel stream can be beneficial for large data sets or when the operations are independent and can be executed in parallel.
It is important to measure the performance of both sequential and parallel streams for a specific use case to determine which is more efficient.
Q87. Write a program to find last non repeating character in a given string using Java 8 functions only like Streams and Lambda's.
Program to find last non-repeating character in a given string using Java 8 functions only.
Use Java 8 Streams and Lambda's to filter the string and find the last non-repeating character.
Create a Map to store the frequency of each character in the string.
Use the filter() method to get the non-repeating characters and find the last one using reduce().
Autowiring in Spring Boot is a way to automatically inject dependencies into Spring beans.
Autowiring is a feature in Spring that allows the container to automatically inject the dependencies of a bean.
There are different modes of autowiring in Spring: 'byName', 'byType', 'constructor', 'autodetect', and 'no'.
For example, in 'byName' autowiring, Spring looks for a bean with the same name as the property being autowired.
The starter dependency of the Spring Boot module is spring-boot-starter-parent.
The starter dependency of Spring Boot provides a set of default configurations and dependencies to kickstart a Spring Boot project.
It includes commonly used dependencies like spring-boot-starter-web, spring-boot-starter-data-jpa, etc.
The spring-boot-starter-parent also manages the versions of all dependencies to ensure compatibility.
Q90. What is your comfort level on HTML, CSS and JavaScript
I am highly proficient in HTML, CSS, and JavaScript.
Extensive experience in building responsive web applications using HTML, CSS, and JavaScript
Strong understanding of front-end frameworks like React, Angular, or Vue.js
Familiarity with CSS preprocessors like SASS or LESS
Knowledge of modern JavaScript ES6+ features and best practices
Experience in optimizing web performance and cross-browser compatibility
Q91. 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 moreAnswering 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
Q92. What are delegates and why we need it. Which are built in delegates in c#
Delegates are reference types that hold a reference to a method. They are used to achieve loose coupling and event handling.
Delegates allow methods to be passed as parameters to other methods.
They can be used to define callback methods.
Built-in delegates in C# include Action, Func, Predicate, EventHandler, and Comparison.
Action and Func are used for methods that return void and non-void values respectively.
Predicate is used for methods that return a Boolean value.
EventHandler...read more
Q93. What is Difference between let var const,
let, var, and const are all used to declare variables in JavaScript, but they have different scoping rules and behaviors.
let and const were introduced in ES6, while var has been around since the beginning of JavaScript.
let and const are block-scoped, while var is function-scoped.
Variables declared with const cannot be reassigned, while let and var can be.
const variables must be initialized when they are declared, while let and var can be declared without initialization.
Exampl...read more
Q94. What is the difference between List and Tuple?
List is mutable and Tuple is immutable in Python.
List can be modified after creation while Tuple cannot be modified.
List uses square brackets [] while Tuple uses parentheses ().
List is used for homogenous data while Tuple is used for heterogenous data.
List is slower than Tuple in terms of performance.
Example of List: [1, 2, 3] and Example of Tuple: (1, 'hello', 3.14)
The program prints a star pattern using asterisks and spaces.
Use nested loops to iterate through rows and columns.
Determine the number of asterisks and spaces to print in each row.
Use conditional statements to decide when to print an asterisk or a space.
Q96. 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 moreImplement 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
Q97. How to switch between Tabs in a browser using selenium
To switch between tabs in a browser using Selenium, we can use the getWindowHandles() method and switchTo() method.
Use getWindowHandles() method to get the handles of all open tabs
Store the handles in a Set
Use switchTo() method to switch to a specific tab by passing the handle as an argument
Spring Boot offers basic annotations like @SpringBootApplication, @RestController, @Autowired, @RequestMapping, @Component, @Service, @Repository.
@SpringBootApplication - Used to mark the main class of a Spring Boot application.
@RestController - Used to define a RESTful controller.
@Autowired - Used for automatic dependency injection.
@RequestMapping - Used to map web requests to specific handler methods.
@Component - Used to indicate a class is a Spring component.
@Service - Use...read more
The @SpringBootApplication annotation is used to mark the main class of a Spring Boot application.
It is a combination of @Configuration, @EnableAutoConfiguration, and @ComponentScan annotations.
It tells Spring Boot to start adding beans based on classpath settings, other beans, and various property settings.
It is often placed on the main class that contains the main method to bootstrap the Spring Boot application.
Q100. How do you find the code performance issue in the code deployed in production?
To find code performance issues in production, use monitoring tools and profiling techniques.
Use monitoring tools like New Relic, AppDynamics, or Datadog to track performance metrics and identify bottlenecks.
Use profiling techniques like CPU profiling, memory profiling, and network profiling to pinpoint specific areas of the code that are causing performance issues.
Analyze logs and error messages to identify patterns and potential performance issues.
Perform load testing and s...read more
Interview Questions of Similar Designations
Top Interview Questions for Senior Software Engineer Related Skills
Interview experiences of popular companies
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
Reviews
Interviews
Salaries
Users/Month