Associate Software Engineer
1500+ Associate Software Engineer Interview Questions and Answers
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
You have been given stock values/prices for N number of days. Every i-th day signifies the price of a stock on that day. Your task is to find the maximum profit which you can m...read more
Associate Software Engineer Interview Questions and Answers for Freshers
You have been given two integer arrays/list(ARR1 and ARR2) of size N and M, respectively. You need to print their intersection; An intersection for this problem can be defined when...read more
There is a frog on the 1st step of an N stairs long staircase. The frog wants to reach the Nth stair. HEIGHT[i] is the height of the (i+1)th stair.If Frog jumps from ith to jth stair, the energy lost i...read more
You have been given 'N' ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. We need to conn...read more
The problem is to connect N ropes of different lengths into one rope with minimum cost.
Sort the array of rope lengths in ascending order.
Initialize a variable to keep track of the total cost.
While there are more than one rope remaining, take the two shortest ropes and connect them.
Add the cost of connecting the two ropes to the total cost.
Replace the two shortest ropes with the connected rope.
Repeat the above steps until only one rope remains.
Return the total cost as the mini...read more
You have been given an array 'ARR' of 'N' distinct elements.
Your task is to find the minimum no. of swaps required to sort the array.
For example:
For the given...read more
Share interview questions and help millions of jobseekers 🌟
Ninja is given a few numbers, and he is being asked to rearrange the numbers so that every second element is greater than its left and right element.
Suppose the given array is [1, ...read more
The task is to rearrange the given array such that every second element is greater than its left and right element.
Read the number of test cases
For each test case, read the number of elements in the array and the array elements
Iterate through the array and swap elements at odd indices with their adjacent elements if necessary
Check if the rearranged array satisfies the conditions and print 1 if it does, else print 0
You are given a positive integer N. Your task is to find the smallest number whose factorial contains at least N trailing zeroes.
Example :
Let N = 1. ...read more
Associate Software Engineer Jobs
You are given an integer ‘NUM’ . Your task is to find out whether this number is an Armstrong number or not.
A k-digit number ‘NUM’ is an Armstrong number if and only if the k-th power of each d...read more
You are given two Singly Linked List of integers, which are merging at some node of a third linked list.
Your task is to find the data of the node at which merging starts. If there is...read more
You are given an array ‘Arr’ consisting of ‘N’ distinct integers and a positive integer ‘K’. Find out Kth smallest and Kth largest element of the array. It is guaranteed...read more
You are given an array “NUMS” consisting of N integers and an integer, K. Your task is to determine the maximum sum of an increasing subsequence of length K.
Note:
1. The array may contain...read more
Given a singly linked list of integers. Your task is to return the head of the reversed linked list.
For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked li...read more
You are given a string 'S'. Your task is to check whether the string is palindrome or not. For checking palindrome, consider alphabets and numbers only and ignore the symbols ...read more
You are given a Singly Linked List of integers and an integer 'K'.
Your task is to modify the linked list by inserting a new node after every 'K' node in the linked list with the node value being equ...read more
You are given two strings 'A' and 'B' where string 'A' is fixed. But you can perform left shift operations on string B any number of times.
Your task is to find out the minim...read more
The question asks to find the minimum number of left shift operations required to obtain the longest common prefix of two given strings.
Perform left shift operations on string B to find the longest common prefix with string A
Count the number of left shift operations required to obtain the longest common prefix
Return the minimum number of left shift operations for each test case
You have been given a board where there are '2' rows and 'N' columns. You have an infinite supply of 2x1 tiles, and you can place a tile in the following ways:
1. Horizontally as 1x2 tile 2. Verti...read more
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.
Note:
Each pair shou...read more
You have been given three numbers ‘X’, ’Y’ and ‘Z’. You have to find the sum of all the numbers formed by the combination of the digits 3, 4 and 5. You can use 3 at most ‘X’ times, 4 at most ‘Y’ ...read more
You are given an array Arr consisting of N integers. You need to find the equilibrium index of the array.
An index is considered as an equilibrium index if the sum of elements of the array to t...read more
You are given a string 'STR' of lowercase English alphabets. You need to find the repeated character present first in the string.
Example:
If the string is: “abccba”, then the first repe...read more
Which number would replace the underline marked in the series 20, 40,100, ...., 820?
Reverse a given stack of integers using recursion.
Note:
You are not allowed to use any extra space other than the internal stack space used due to recursion. You are not allowed to...read more
Ninjaland is a country consisting of ‘N’ states and ‘M’ paths. There are two types of paths that connect any two states. One is the normal path, and the other is a special path. Both paths have...read more
You are given an array/list ‘ARR’ of ‘N’ positive integers and an integer ‘K’. Your task is to group all the array elements with ‘K-th’ bit (rightmost bit is ‘1st’ bit) equal to 0 followed by all...read more
Given an integer ‘N’ representing the number of pairs of parentheses, Find all the possible combinations of balanced parentheses with the given number of pairs of parentheses.
Note :
Conditi...read more
Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the t...read more
You have been given a string STR. Your task is to find the total number of palindromic substrings of STR.
Example :
If the input string is "abbc", then all the possible palindromic substri...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 are given a string S of words. Your task is to count the occurrence of each word present in the string S. A word is a sequence of one or more non-space characters, and there can be mu...read more
Q31. You are a team leader and one of your employee is unable to complete his/her work on time and due to him you are unable to submit the work before the deadline to your senior. How will you make that employee wor...
read moreAs a team leader, I would identify the reason for the delay and work with the employee to find a solution to complete the work on time.
Have a one-on-one meeting with the employee to understand the reason for the delay
Identify any roadblocks or challenges the employee is facing and work together to find a solution
Set clear expectations and deadlines for the employee to complete the work
Provide support and resources to help the employee complete the work on time
Regularly check ...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 "r...read more
Given the head node of the singly linked list, return a pointer pointing to the middle of the linked list.
If there are an odd number of elements, return the middle element if there are ev...read more
Q34. One of the questions for Critical Reasoning was:- Two cars A and B cross a flyover in 10 minutes and 30 minutes respectively. Find the speed of Car A. Statements: Car B travels at the 50kmph Train A and B are t...
read moreCar A's speed is 90kmph
Use the formula: Speed = Distance/Time
Assume the distance to be the same for both cars
Calculate Car A's time using the given information
Substitute the values in the formula to get Car A's speed
You are given an integer array ‘ARR’. You have to find the length of the shortest contiguous subarray such that, if you sort this subarray in ascending order, then the whole array will be sorted in asce...read more
The question asks to find the length of the shortest contiguous subarray that needs to be sorted in order to sort the whole array.
Iterate through the array and find the first element that is out of order from the left side.
Iterate through the array and find the first element that is out of order from the right side.
Find the minimum and maximum element within the subarray from the above steps.
Expand the subarray from both sides until all elements within the subarray are in the...read more
You are given a Weighted Directed Acyclic Graph (DAG) consisting of ‘N’ nodes and ‘E’ directed edges. Nodes are numbered from 0 to ’N’-1. You are also given a source node ‘Src’ in ...read more
You are given a N x 2 2-D array 'Jobs' of 'N' jobs where Jobs[i][0] denote the deadline of i-th job and Jobs[i][1] denotes the profit associated with i-th job.
You will make a certain prof...read more
You are given a binary tree with 'N' nodes. Your task is to return the size of the largest subtree of the binary tree which is also a BST.
A binary search tree (BST) is a binary tree data str...read more
You are given a sorted array of 'N' integers. You have to generate the power set for this array where each subset of this power set is individually sorted.
A set is a well-defined collection of distinc...read more
You have been given two integers ‘DAY_HOURS’ and ‘PARTS’. Where ‘DAY_HOURS’ is the number of hours in a day and a day can be divided into ‘PARTS’ equal parts. Your task is to find total instance...read more
Given a string ‘STR’ consisting of lower case English letters, the task is to find the first non-repeating character in the string and return it. If it doesn’t exist, return ‘#...read more
Given a string ‘STR’ of length 'N'. Implement the atoi function. If there are no numbers in the string, return 0.
In other words, given a string ‘STR’ convert the string to an integer.
Ex...read more
You are given an array of n integers (a1, a2,....,an), you need to find if the array contains a pythagorean triplet or not.
An array is said to have a pythagorean triplet if there exists thr...read more
You are given an array 'ARR' consisting of 'N' integers. You need to rearrange the array elements such that all negative numbers appear before all posit...read more
Given a string ’S’ consisting of lower case English letters, you are supposed to return the longest palindromic substring of ‘S’.
Note that in case of more than one longest palindro...read more
Given a sequence of numbers ‘ARR’. Your task is to return a sorted sequence of ‘ARR’ in non-descending order with help of the merge sort algorithm.
Example :
Merge Sort Algorithm - Merge sort is a Div...read more
You are given the first term (A), the common ratio (R) and an integer N. Your task is to find the Nth term of the GP series.
The general form of a GP(Geometric Progression) series is A, A(R), A(R...read more
You are given a positive number ‘N.’ You need to find all the numbers such that the sum of digits of those numbers to the number itself is equal to ‘N.’
For example:
You are given ‘N’ as 21, th...read more
You have been given a binary tree of 'N' nodes. Print the Spiral Order traversal of this binary tree.
For example
For the given binary tree [1, 2, 3, -1, -1, 4, 5, -1, -1,...read more
Given a 2D grid having N Rows and M Columns. Each cell of the grid has a character among [ 'U', 'L', 'D', 'R' ] written on it, denoting Up, Left, Down, and Right respectively and indic...read more
Interview Questions of Similar Designations
Top Interview Questions for Associate 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