Software Developer
7000+ Software Developer Interview Questions and Answers
Given an array of numbers, find the maximum sum of any contiguous subarray of the array.
For example, given the array [34, -50, 42, 14, -5, 86], the maximum sum would be 137, since we would ...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
Software Developer Interview Questions and Answers for Freshers
Ayush is given a number ‘X’. He has been told that he has to find the first ‘X’ terms of the series 3 * ‘N’ + 2, which are not multiples of 4. Help Ayush to find it as he has not been able to answer....read more
You are given the arrival and departure times of N trains at a railway station in a day. You need to find the minimum of platforms required for the railway station such that no ...read more
Ninja has been given two sorted integer arrays/lists ‘ARR1’ and ‘ARR2’ of size ‘M’ and ‘N’. Ninja has to merge these sorted arrays/lists into ‘ARR1’ as one sorted array. You may have to a...read more
Ninja loves playing with numbers. So one day, he wants to arrange a few numbers in the ‘N’ number of rows. The first row contains 1 number, the second row has two numbers, the third row has 3 digit...read more
Share interview questions and help millions of jobseekers 🌟
You are given an integer of array/list 'ARR' of length ‘N. You are supposed to return true if it is possible to construct at least one non-degenerate triangle using values of array/list as sides ...read more
You are given an array of integers 'ARR' containing N elements. Each integer is in the range [1, N-1], with exactly one element repeated in the array.
Your task is to find the duplicate e...read more
The task is to find the duplicate element in an array of integers.
Iterate through the array and keep track of the frequency of each element using a hash map.
Return the element with a frequency greater than 1.
Alternatively, sort the array and check for adjacent elements with the same value.
Software Developer Jobs
You are given two numbers, ‘X’ and ‘Y’. Your task is to find the greatest common divisor of the given two numbers.
The Greatest Common Divisor of any two integers is the largest number th...read more
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 both the ar...read more
The task is to find the intersection of two integer arrays/lists.
Read the number of test cases
For each test case, read the size and elements of the first array/list
Read the size and elements of the second array/list
Find the intersection of the two arrays/lists
Print the intersection elements in the order they appear in the first array/list
You are given an integer ‘N’. Your task is to find all palindromic numbers from 1 to ‘N’.
Palindromic integers are those integers that read the same backward or forwards.
Note:
Order of numbers ...read more
Given a number of ropes say ‘N’ and an array of integers of size ‘N’ containing the length of ropes. Your task is to connect the ropes into one. The cost to connect two ropes is equal to the sum of...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 are given ‘N’ binary tree nodes numbered from 0 to N - 1 where node ‘i’ has two children LEFT_CHILD[i] and RIGHT_CODE[i]. Return ‘True’ if and only if all the given nodes form exac...read more
The task is to determine if the given binary tree nodes form exactly one valid binary tree.
Check if there is only one root node (a node with no parent)
Check if each node has at most one parent
Check if there are no cycles in the tree
Check if all nodes are connected and form a single tree
Given a text and a wildcard pattern of size N and M respectively, implement a wildcard pattern matching algorithm that finds if the wildcard pattern is matched with the text. The matchi...read more
You are given an array/list ‘BINARYNUMS’ that consists of ‘N’ distinct strings which represent all integers from 0 to N in binary representation except one integer. This integer between 0 to ‘N’ w...read more
Ninja is given a pattern. Now he is asked to print the same pattern for any given ‘N’ number of rows.
For example, Pattern for ‘N’ = 4 will be. 1 232 34545 4567654
Input Format:
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
Q1. How do we measure forty-five minutes using two identical wires, each of which takes an hour to burn? We have matchsticks with us. The wires burn non-uniformly.
Q2.You have 5 jars of pills. Each pill we...read more
Ninja has been given a program to do basic string compression. For a character that is consecutively repeated more than once, he needs to replace the consecutive duplicate occurrences with th...read more
You are given a two-dimensional matrix of integers of dimensions N*M, where each cell represents the number of coins in that cell. Alice and Bob have to collect the maximum number of coins. The fo...read more
Given a matrix of coins, Alice and Bob have to collect maximum coins with certain conditions.
Alice starts from top left corner and Bob starts from top right corner
They can move to (i+1, j+1) or (i+1, j-1) or (i+1, j)
They have to collect all the coins that are present at a cell
If Alice has already collected coins of a cell, then Bob gets no coins if goes through that cell again
Ninja has organized the new year party and invited all the programmers for it, as being the programmer also has been invited by Ninja.
To detect whether the guest is a programmer or...read more
You are given an array/list 'ARR' of ‘N’ integers, and ‘Q’ queries. Each query can be of two types:
Given 2 integers ‘L’,’R’ ( L>=0 and R Given an index ‘i’ update the value of ARR[i] to a given int...read more
Given an index ‘i’ update the value of ARR[i] to a given int...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
You have been given two strings ‘str1’ and ‘str2’ of length N and M respectively. Your task is to check whether string ‘str2’ contains one of the permutations of string ‘str1’ as its substr...read more
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 d...read more
Given a number N, find its square root. You need to find and print only the integral part of square root of N.
For eg. if number given is 18, answer is 4.
Input format :
Integer N
Output ...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 lis...read more
You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.
Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' ...read more
Goku has ‘N’ Dragon Balls. Each Dragon Ball is unique with the ith Dragon Ball having ‘i’ stars on it. For example, the first Dragon Ball has 1 star, the second Dragon Ball has 2 stars, and...read more
You are given an array (ARR) of length N, consisting of integers. You have to find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.
A subarray is a ...read more
For a given two strings, 'str1' and 'str2', check whether they are a permutation of each other or not.
Permutations of each other
Two strings are said to be a permutation of each other when ei...read more
You have been given two strings A and B consisting of lower case English letters. The task is to count the minimum number of pre-processing moves on the string A require...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
You are given an infinite supply of coins of each of denominations D = {D0, D1, D2, D3, ...... Dn-1}. You need to figure out the total number of ways W, in which you can make a change fo...read more
Q36. 1. what is the difference between exception and error. How did u solve the errors in the code deployment?
Exception is a runtime error that can be handled, while error is a severe issue that cannot be handled.
Exceptions are caused by the program logic, while errors are caused by external factors like hardware failure or network issues.
Exceptions can be caught and handled using try-catch blocks, while errors require fixing the underlying issue.
Example of exception: NullPointerException. Example of error: Out of Memory Error.
To solve errors in code deployment, identify the root cau...read more
You are given an array ‘A’ of length ‘N’, you have to tell the number of arithmetic subarrays that exist in the array ‘A’.
An Arithmetic subarray is a subarray that has 3 or more elements an...read more
Count the number of arithmetic subarrays in an array.
An arithmetic subarray has 3 or more elements with the same difference between consecutive elements.
Loop through the array and check for all possible subarrays with 3 or more elements.
If the difference between consecutive elements is the same, increment the count.
Return the count for each test case.
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
The question asks to find the total amount of rainwater that can be trapped in the given elevation map.
Iterate through the array and find the maximum height on the left and right side of each bar.
Calculate the amount of water that can be trapped on each bar by subtracting its height from the minimum of the maximum heights on both sides.
Sum up the amount of water trapped on each bar to get the total amount of rainwater trapped.
You are given an array ‘ARR’ of size ‘N’ consisting of distinct elements. Your task is to find the total number of good subsets. A subset is called a good subset when you can rearrange the ele...read more
You have been given an Encrypted String where repetitions of substrings are represented as substring followed by the count of substrings.
Example: String "aabbbcdcdcd" wil...read more
Ninjas has been given an array. He wants to find a subarray such that the sum of all elements in the subarray is maximum.
Subarray 'A' is greater than sub-array 'B' if sum(A) > sum(B). If two su...read more
Mary is a party-loving girl of the 21st Generation. She loves to attend parties and events with her family and friends. But she is terrible at remembering the dates of these events.
Mary has ...read more
A board can be divided in two halves which are to be given to two players and then you need to add ships for each players. Every player will get a chance to hit at any random point by missile and if ...read more
You have given a Singly Linked List of integers, determine if it forms a cycle or not.
A cycle occurs when a node's next points back to a previous node in the list. The li...read more
The task is to determine if a given singly linked list forms a cycle or not.
A cycle occurs when a node's next points back to a previous node in the list.
To solve this problem, we can use the Floyd's Cycle-Finding Algorithm.
The algorithm uses two pointers, one moving at a normal pace and the other moving twice as fast.
If there is a cycle, the fast pointer will eventually catch up to the slow pointer.
If the fast pointer reaches the end of the list (i.e., it encounters a null no...read more
You are given an array of integers ARR[] of size N consisting of zeros and ones. You have to select a subset and flip bits of that subset. You have to return the count of maximum one’s that you can obt...read more
Given an array “A” of positive integers. Your task is to make the largest number possible formed by concatenating each of the array elements exactly once.
Example:
Let's say the given arr...read more
You have been given a random integer array/list(ARR) of size N, and an integer X. You need to search for the integer X in the given array/list using 'Linear Search'.
You have been required to retu...read more
You are given an arbitrary array/list of integers 'ARR' of size ‘N’ and an integer ‘K’. You need to find the maximum number of elements which can be made equal to each o...read more
Given an array of numbers, find the maximum sum of any contiguous subarray of the array.
For example, given the array [34, -50, 42, 14, -5, 86], the maximum sum would be 137, since we would ...read more
Given an array/list of length ‘N’, where the array/list represents the boards and each element of the given array/list represents the length of each board. Some ‘K’ numbers of painter...read more
Interview Questions of Similar Designations
Top Interview Questions for Software Developer 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