Senior Software Engineer
3500+ Senior Software Engineer Interview Questions and Answers
You are given an integer N. Your task is to return a 2-D ArrayList containing the pascal’s triangle till the row N.
A Pascal's triangle is a triangular array constructed by summing adjacent ele...read more
You are given a number 'N'. Your task is to find Nth prime number.
A prime number is a number greater than 1 that is not a product of two smaller natural numbers. Prime numbers have only two facto...read more
The task is to find the Nth prime number given a number N.
A prime number is a number greater than 1 that is not a product of two smaller natural numbers.
Prime numbers have only two factors - 1 and the number itself.
Start with a counter at 0 and a number at 2.
Increment the number by 1 and check if it is prime.
If it is prime, increment the counter.
Repeat until the counter reaches N.
Return the last prime number found.
Senior Software Engineer Interview Questions and Answers for Freshers
Given an unsorted array, find the K largest elements in non-decreasing order.
Sort the array in non-decreasing order.
Return the last K elements of the sorted array.
Create a simple shopping application. They have given the sample project which already has some code. They asked to add the below features. Clicking on each Add To Cart should add the item...read more
Create a shopping application with add to cart, increase/decrease quantity, and update functionality.
Implement add to cart functionality when clicking on each item
Update the product listing component to show increase/decrease quantity buttons and the quantity of the item in the cart
Implement functionality to increase the quantity of an item in the cart
Implement functionality to decrease the quantity of an item in the cart
Handle scenarios when the cart quantity is 1 or greater...read more
Q5. Tell me about yourself. What technology are you using? What is a Collection? What are the different types of collection there? What is the difference between ArrayList and LinkedList What are the basic building...
read moreThe interview questions cover a wide range of topics including software engineering, technology, design patterns, databases, web development, and more.
The questions cover topics such as technology used, collections, streams, design patterns, dependency injection, microservices, database communication, annotations in Spring, React and JavaScript, Redux, API development, SOAP-based web services, Jenkins, Docker, production support, and more.
Some specific questions include the d...read more
You are given an array ‘ARR’ of size ‘N’ containing each number between 1 and ‘N’ - 1 at least once. There is a single integer value that is present in the array twice. Your task is to find th...read more
Share interview questions and help millions of jobseekers 🌟
Ninja has to implement a data structure called ‘MapSum’. Ninja has to implement two functions and one constructor.
1) MapSum(): Ninja has to initialize the ‘MapSum’. 2) insert(‘KEY’, ‘VAL’...read more
The question asks to implement a data structure called 'MapSum' with functions to initialize, insert key-value pairs, and find the sum of values with a given prefix.
Implement a class called 'MapSum' with a constructor to initialize the data structure.
Implement the 'insert' function to insert key-value pairs into the 'MapSum'. If a key is already present, replace its value with the new one.
Implement the 'sum' function to find the sum of values whose key has a prefix equal to t...read more
You are Harshad Mehta’s friend. He told you the price of a particular stock for the next ‘N’ days. You can either buy or sell a stock. Also, you can only complete at most 2-transactions. Find ...read more
Senior Software Engineer Jobs
A few days back, Ninja encountered a string containing characters from ‘A’ to ‘Z’ which indicated a secret message. For security purposes he encoded each character of the string to its numeric v...read more
You are given a string 'STR'. The string contains [a-z] [A-Z] [0-9] [special characters]. You have to find the reverse of the string.
For example:
If the given string is: STR = "abcde". You h...read more
The task is to reverse a given string containing alphanumeric and special characters.
Iterate through the string from the last character to the first character
Append each character to a new string to get the reversed string
Return the reversed string as the output
A few days back, Ninja encountered a string containing characters from ‘A’ to ‘Z’ which indicated a secret message. For security purposes he encoded each character of the stri...read more
Given an integer N, print all the prime numbers that lie in the range 2 to N (both inclusive).
Print the prime numbers in different lines.
Input Format :
Integer N
Output Format :
Prime number...read more
You have been given a column title as appears in an Excel sheet, return its corresponding column number.
For example:
A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ...
Input Format
The ...read more
Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:
1. get(key) - Return the value of the key if the key exists in the cache, o...read more
Write a program to count and print the total number of characters (lowercase english alphabets only), digits (0 to 9) and white spaces (single space, tab i.e. '\t' and newline i.e. '\n') entered...read more
Ninja is learning the binary representation of the numbers. He wanted to practice the topic, so he picked a question. The problem statement says, two numbers, ‘A’ and ‘B’ are given. Find the numb...read more
Ninja is given an integer ‘N’. One day Ninja decides to do the sum of all digits and replace the ‘N’ with the sum of digits until it becomes less than 10. Ninja wants to find what will be the value...read more
Given a string, determine if it is a palindrome, considering only alphanumeric characters.
Palindrome
A palindrome is a word, number, phrase, or other sequences of characters which read the sam...read more
Aahad and Harshit always have fun by solving problems. Harshit took a sorted array consisting of distinct integers and rotated it clockwise by an unknown amount. For example, he to...read more
You have been given a string STR and a non-empty string PTR. Your task is to find all the starting indices of PTR’s anagram in STR.
An anagram of a string is another string which contains the s...read more
You have been given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in Anti-Clockwise direction starting from the root node.
NOTE:
The boundary nodes of...read more
Q22. How to apply SOLID principle and what is dependency injection and why to use it and scenarios on where to use
SOLID principles ensure maintainable and scalable code. Dependency Injection helps in achieving loose coupling and testability.
SOLID principles are Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion
Dependency Injection is a design pattern that allows objects to be loosely coupled and easily testable
Use Dependency Injection to reduce tight coupling between classes and make them more modular
Use SOLID principles to ensure mai...read more
Given two strings ‘STR’ and ‘PTR’. Find all the starting indices of ‘PTR’ anagram substring in ‘STR’. Two strings are anagram if and only if one string can be converted into another stri...read more
Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:
1. get(key) - Return the value of the key if the key exists in the cache, otherwise return...read more
The question is about designing and implementing a data structure for LRU cache to support get and put operations.
LRU cache is a cache replacement policy that removes the least recently used item when the cache reaches its capacity.
The cache is initialized with a capacity and supports get(key) and put(key, value) operations.
For each get operation, return the value of the key if it exists in the cache, otherwise return -1.
For each put operation, insert the value in the cache i...read more
Nth term of Fibonacci series F(n), where F(n) is a function, is calculated using the following formula -
F(n) = F(n-1) + F(n-2), Where, F(1) = F(2) = 1
Provided N you have to find out the ...read more
You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K.
An array is said to have a...read more
Pre-requisites: Anagrams are defined as words or names that can be formed by rearranging letters of another word. Such as "spar" can be formed by rearranging letters of "rasp". Hence, "spar" and "...read more
Q28. Given a grid containing 0s and 1s and source row and column, in how many ways, could we reach form source to target. ( 1's represents a blockade and 0's represent accessable points)
Count the number of ways to reach target from source in a grid with 0s and 1s.
Use dynamic programming to solve the problem efficiently.
Traverse the grid using DFS or BFS to count the number of ways.
Consider edge cases like when source and target are the same or when there is no path.
Example: Given grid = [[0,0,0],[0,1,0],[0,0,0]], source = (0,0), target = (2,2), answer is 2.
Example: Given grid = [[0,1],[0,0]], source = (0,0), target = (1,1), answer is 1.
You are given a binary search tree of integers with 'N' nodes. Your task is to return the K-th largest element of this BST.
If there is no K-th largest element in the BST, return -1.
A bi...read more
You are given a linked list of 'N' nodes and an integer 'K'. You have to reverse the given linked list in groups of size K i.e if the list contains x nodes numbered from 1 to x, then you...read more
You are given an integer N, you need to find the number of trailing zeroes in N! (N factorial).
Note:
1. Trailing zeros in a number can be defined as the number of continuous suffix z...read more
You are given a Singly Linked List of integers and a positive integer 'K'. Modify the linked list by reversing every alternate 'K' nodes of the linked list.
A singly linked list is a ty...read more
You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair. Each time you can either climb one step or two steps. You are...read more
You are given an array/list 'ARR' consisting of N integers, which contains elements only in the range 0 to N - 1. Some of the elements may be repeated in 'ARR'. Your task is to find all ...read more
You will be given a stream of numbers, and you need to find the kth largest number in the stream at any given time.
As the stream of numbers can not be given during compile time, so you need t...read more
Reverse the given string word wise. That is, the last word in given string should come at 1st place, last second word at 2nd place and so on. Individual words should remain as it is.
In...read more
You have been given a long type array/list 'ARR' of size 'N'. It represents an elevation map wherein 'ARR[i]' denotes the elevation of the 'ith' bar. Print the total amount of rainwater that...read more
Q38. Write a Program Nth term in a infinite series example: 2,4,8,2,4,8……..n…….infinite
Program to find the Nth term in an infinite series
The series has a repeating pattern
Use modulo operator to find the index of the repeating pattern
Calculate the value of Nth term based on the pattern
You are given the root node of a binary tree consisting of ‘N’ nodes. Your task is to return its preorder traversal. The preorder traversal of a binary tree is defined as a process of traversi...read more
For a given integer array/list 'ARR' of size 'N', find the total number of 'Inversions' that may exist.
An inversion is defined for a pair of integers in the array/list when the following two co...read more
You are given a 2-dimensional array/list having N rows and M columns, which is filled with ones(1) and zeroes(0). 1 signifies land, and 0 signifies water.
A cell is said to be connected to...read more
You are given an array ‘ARR’ of size ‘N,’ and you have to tell the minimum number of elements that need to be removed such that the array contains all distinct elements. More formally, there sh...read more
You are given an array/list of ‘N’ integers. You are supposed to return the maximum sum of the subsequence with the constraint that no two elements are adjacent in the given ...read more
Given an unsorted array of integers, you have to move the array elements in a way such that all the zeroes are transferred to the end, and all the non-zero elements are moved to the front. The...read more
There is a directed graph consisting of ‘N’ nodes numbered from 0 to ‘N’-1. You are given a list ‘EDGES’ of size ‘M’, consisting of all the edges of this directed graph,...read more
You are given an array/list “ASTEROIDS” representing asteroids in a row. For each element of the given array, its absolute value denotes the size of that asteroid and its sign denotes the dire...read more
Given a string (STR) of length N, you have to create a new string by performing the following operation:
Take the smallest character from the first 'K' characters of STR, remove it from STR...read more
You are given a string ‘S’. You are also given ‘M’ integers in an array ‘A’. You perform ‘M’ operations on this string. The operations are given in an array ‘A’ of size ‘M’.
You perform the operat...read more
Q49. In azure data factory how would you implement the functionality of tumbling window without actually using that feature already available?
Implementing tumbling window in Azure Data Factory without using the feature
Create a pipeline with a trigger that runs at the desired interval
Use a lookup activity to retrieve the data for the current window
Use a foreach activity to iterate over the retrieved data
Perform the required operations on the data within the foreach activity
Write the output to the desired destination
Q50. String is immutable but what happens if we assign another value to that string reference
Assigning another value to a string reference creates a new string object in memory.
Assigning a new value to a string reference creates a new string object in memory
The original string object remains unchanged
The new value is stored in a different memory location
The old value may be garbage collected if there are no other references to it
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