Software Developer Intern

1000+ Software Developer Intern Interview Questions and Answers

Updated 13 Dec 2024

Popular Companies

search-icon
Q1. Sum Of Max And Min

You are given an array β€œARR” of size N. Your task is to find out the sum of maximum and minimum elements in the array.

Follow Up:
Can you do the above task in a minimum number of comparisons? ...read more
Q2. Sliding Maximum

You are given an array 'ARR' of integers of length 'N' and a positive integer 'K'. You need to find the maximum elements for each and every contiguous subarray of size K of the array.

For exampl...read more

Software Developer Intern Interview Questions and Answers for Freshers

illustration image
Q3. Fish Eater

There is a river which flows in one direction. One day, the river has 'N' number of fishes. You are given an array 'FISHES' of integers representing the size of 'N' fishes. The fishes are present in t...read more

Q4. Program to check the validity of a Password

Ninjas are trying to hack a system of a terrorist organization so that they can know where they will be going to attack next. But to hack the system and to get access ...read more

Are these interview questions helpful?
Q5. Find K Closest Elements

You are given a sorted array 'A' of length 'N', two integers 'K' and 'X'. Your task is to print 'K' integers closest to 'X', if two integers are at the same distance return the smaller on...read more

Q6. Minimum and Maximum Cost to buy N Candies

Ram went to a specialty candy store in Ninjaland which has 'N' candies with different costs.

The Candy shop gives a special offer to its customers. A customer can buy a ...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
Q7. Nth Element Of Modified Fibonacci Series

You have been given two integers β€˜X’ and β€˜Y’ which are the first two integers of a series and an integer β€˜N’. You have to find the Nth number of the series using the Fibo...read more

Q8. Fibonacci Member

Given a number N, figure out if it is a member of fibonacci series or not. Return true if the number is member of fibonacci series else false.

Fibonacci Series is defined by the recurrence

 F(n)...read more

Software Developer Intern Jobs

Software Developer Internship β€’ 3-6 years
Skillmine Technology Consulting
β€’
3.7
Mumbai
Software Developer Intern β€’ 0-1 years
Qollabb Edutech Pvt Ltd
β€’
4.8
β‚Ή 2 L/yr - β‚Ή 3 L/yr
Noida
Software Developer Internship β€’ 0-1 years
Novatech Software Pvt. Ltd
β€’
3.0
Nagpur
Q9. Hotel Rooms

You are the manager of a hotel having 10 floors numbered 0-9. Each floor has 26 rooms [A-Z]. You will be given a sequence of strings of the room where β€˜+’ suggests the room is booked and β€˜-’ suggests...read more

Q10. Kevin and his Fruits

Kevin has β€˜N’ buckets each consisting of some fruits. Kevin wants to eat at least β€˜M’ fruits and so, he decided to set a marker (integer) as maximum as possible such that if he eats β€œnumber ...read more

Q11. Recycling pens

You have 'N' empty pens whose refills have been used up. You have 'R' rupees in your pocket. You have two choices of operations that you can perform each time.

1) Recycle 1 empty pen and get 'K' r...read more

Q12. Longest Palindromic Substring

You are given a string (STR) of length N.

Your task is to find the longest palindromic substring. If there is more than one palindromic substring with the maximum length, return the...read more

Frequently asked in,
Q13. Longest Increasing Subsequence

For a given array with N elements, you need to find the length of the longest subsequence from the array such that all the elements of the subsequence are sorted in strictly increa...read more

Ans.

The task is to find the length of the longest increasing subsequence in a given array.

  • Iterate through the array and keep track of the length of the longest increasing subsequence seen so far.

  • Use dynamic programming to solve the problem efficiently.

  • The time complexity of the solution should be O(N^2) or better.

  • Consider edge cases such as an empty array or an array with only one element.

Q14. Reverse Words in a String

You are given a string of length N. You need to reverse the string word by word. There can be multiple spaces between two words and there can be leading or trailing spaces but in the ou...read more

Q15. Longest Consecutive Sequence

You are given an unsorted array/list 'ARR' of 'N' integers. Your task is to return the length of the longest consecutive sequence.

The consecutive sequence is in the form ['NUM', 'NU...read more

Q16. Sum of minimum and maximum elements of all subarrays of size β€œK”

You are given an array consisting of N integers, and an integer, K. Your task is to determine the total sum of the minimum element and the maximum...read more

Q17.

You are blindfolded and 10 coins are placed in front of you on the table. You are allowed to touch the coins, but can’t tell which way up they are by feel. You are told that there are 5 coins head up, and 5 coi...read more

Q18. Replace Node With Depth

For a given Binary Tree of integers, replace each of its data with the depth of the tree.

Root is at depth 0, hence the root data is updated with 0. Replicate the same further going down ...read more

Q19. Valid String

You have been given a string 'S' containing only three types of characters, i.e. '(', ')' and '*'.

A Valid String is defined as follows:

1. Any left parenthesis '(' must have a corresponding right p...read more
Q20. XOR Query

Assume you initially have an empty array say β€˜ARR’.

You need to return the updated array provided that some β€˜Q’ number of queries were performed on this array.

The queries are of two types:

1. 1 β€˜VAL’,...read more
Ans.

The problem requires updating an array based on a series of queries, where each query can either insert a value or perform a bitwise XOR operation on all elements.

  • Use a loop to iterate through each query and update the array accordingly

  • For type 1 query, append the value to the end of the array

  • For type 2 query, perform a bitwise XOR operation on each element of the array with the given value

  • Return the updated array after processing all the queries

Q21. Jump Game

You have been given an array 'ARR' of β€˜N’ integers. You have to find the minimum number of jumps needed to reach the last index of the array i.e β€˜N - 1’ if at any index β€˜i’ we can jump to an index β€˜i +...read more

Q22. Ninja and his meetings

Ninja has recently started a startup. In his startup, there is only one conference room for a meeting. Ninja receives an array/list β€˜MEETINGS’ of back-to-back appointment requests and is d...read more

Q23. K-th Permutation Sequence of first N natural numbers

You’re given two integers N and K, your task is to find the Kth permutation of the sequence of first N natural numbers.

For Example :

If N = 3 and K = 3. The ...read more
Ans.

The task is to find the Kth permutation of the sequence of first N natural numbers.

  • Generate all possible permutations of the sequence of first N natural numbers

  • Sort the permutations in lexicographical order

  • Return the Kth permutation from the sorted list

Q24. Kth Smallest and Largest Element of Array

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

Q25. First Missing Positive

You are given an array 'ARR' of integers of length N. Your task is to find the first missing positive integer in linear time and constant space. In other words, find the lowest positive in...read more

Ans.

The task is to find the lowest positive integer that does not exist in the given array of integers.

  • Iterate through the array and mark the positive integers as visited using the array indices.

  • Iterate through the marked array and return the index of the first unmarked element.

  • If all positive integers are marked, return the length of the array + 1 as the missing positive integer.

Q26. Longest Substring Without Repeating Characters

Given a string 'S' of length 'L', return the length of the longest substring without repeating characters.

Example:

Suppose given input is "abacb", then the length ...read more
Frequently asked in,
Q27. Count distinct Bitwise OR of all subarrays

You are given an array consisting of N positive integers, your task is to count the number of distinct possible values that can be obtained by taking the bitwise OR of ...read more

Q28. Find Number Of Islands

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

Q29. Ninja And The Fence

Ninja has given a fence, and he gave a task to paint this fence. The fence has 'N' posts, and Ninja has 'K' colors. Ninja wants to paint the fence so that not more than two adjacent posts hav...read more

Q30. Remove Consecutive Duplicates

For a given string(str), remove all the consecutive duplicate characters.

Example:
Input String: "aaaa" Expected Output: "a" Input String: "aabbbcc" Expected Output: "abc" 
Input F...read more
Q31. Sum of LCM

You are given an integer β€˜N’ , calculate and print the sum of :

LCM(1,N) + LCM(2,N) + .. + LCM(N,N) 

where LCM(i,n) denotes the Least Common Multiple of the integers β€˜i’ and β€˜N’.

Input Format:
The fir...read more
Q32. Given a string S consisting of N lowercase letters, return the minimum number of letters that must be deleted to obtain a word in which every letter occurs a unique number of times.For Ex - "aaaabbbb" should re...read more
Q33. LFU Cache

Design and implement a Least Frequently Used(LFU) Cache, to implement the following functions:

1. put(U__ID, value): Insert the value in the cache if the key(β€˜U__ID’) is not already present or update ...read more
Q34. Find the minimum cost to reach destination using a train

There are β€˜N’ stations on the route of a train. The train goes from station 0 to β€˜N’ - 1. The ticket cost for all pairs of stations (i, j) is given where ...read more

Q35. Minimum Time To Solve The Problems

There are 'N' number of subjects and the ith subject contains subject[i] number of problems. Each problem takes 1 unit of time to be solved. Also, you have 'K' friends, and you...read more

Q36. Number of operations to make Graph connected

You have been given a graph consisting of β€˜N’ vertices numbered from 1 to β€˜N’. The graph has β€˜M’ edges. In an operation, you can shift an edge between two directly co...read more

Q37. 0-1 Knapsack Problem

A thief is robbing a store and can carry a maximal weight of W into his knapsack. There are N items and the ith item weighs wi and is of value vi. Considering the constraints of the maximum ...read more

Q38. Container With Most Water

Given a sequence of β€˜N’ space-separated non-negative integers A[1],A[2],A[3],......A[i]…...A[n]. Where each number of the sequence represents the height of the line drawn at point 'i'. ...read more

Ans.

Given a sequence of non-negative integers representing the height of lines on a cartesian plane, find two lines that form a container with the maximum area of water.

  • Use two pointers approach to find the maximum area

  • Start with the widest container and gradually move the pointers towards each other

  • Calculate the area at each step and update the maximum area

  • The area is calculated as the minimum height of the two lines multiplied by the distance between them

Q39. Count ways to reach the nth stairs

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

Q40. Find duplicates in array

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

Frequently asked in,
Q41. Rahul And Minimum Subarray

Rahul is a programming enthusiast. He is currently learning about arrays/lists. One day his teacher asked him to solve a very difficult problem. The problem was to find the length of t...read more

Ans.

The problem is to find the length of the smallest subarray in a given array with its sum greater than a given value.

  • Iterate through the array and keep track of the current subarray sum

  • If the current sum becomes greater than the given value, update the minimum subarray length

  • If the current sum becomes negative, reset the sum and start a new subarray

  • Return the minimum subarray length

Q42. Minimum Cost To Make String Valid

Ninja has been given a string β€˜STR’ containing either β€˜{’ or β€˜}’. 'STR’ is called valid if all the brackets are balanced. Formally for each opening bracket, there must be a clos...read more

Q43. Minimum Fountains

There is a one-dimensional garden of length 'N'. On each of the positions from 0 to 'N', there is a fountain, and this fountain’s water can reach up to a certain range as explained further. In ...read more

Q44. Stocks are profitable

You are given an array/list 'prices' where the elements of the array represent the prices of the stock as they were yesterday and indices of the array represent minutes. Your task is to fin...read more

Q45. Minimum Removals

You have been given an array/list "ARR" consisting of 'N' integers. You have also given an integer 'K'.

Your task is to find the minimum number of elements that should be removed from "ARR" (pos...read more

Q46. Ways To Make Coin Change

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

Frequently asked in,
Q47. Largest Cycle

You are given a maze consisting of N cells numbered from 0 to N - 1 and an array β€˜arr’ of N integers in which arr[i] contains the cell number that can be reached from β€˜i’th cell in one step. You ar...read more

Q48. Nth term of gp series

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...read more

Q49. Frequency In A Sorted Array

You are given a sorted array 'ARR' and a number 'X'. Your task is to count the number of occurrences of 'X' in 'ARR'.

Note :
1. If 'X' is not found in the array, return 0. 2. The give...read more
Ans.

The task is to count the number of occurrences of a given number in a sorted array.

  • Use binary search to find the first and last occurrence of the given number in the array.

  • Subtract the indices of the first and last occurrence to get the count.

  • Handle the case when the number is not found in the array.

Q50. Pair Sum

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

Given an array and a target sum, find all pairs of elements in the array that add up to the target sum.

  • Create an empty list to store the pairs

  • Iterate through the array and for each element, check if there is a complement (target sum minus the current element) in the array

  • If a complement is found, add the pair (current element, complement) to the list

  • Sort the list of pairs in non-decreasing order of their first value

  • If two pairs have the same first value, sort them based on th...read more

1
2
3
4
5
6
7
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

4.1
Β β€’Β 4.9k Interviews
4.4
Β β€’Β 811 Interviews
4.1
Β β€’Β 721 Interviews
4.1
Β β€’Β 561 Interviews
4.0
Β β€’Β 536 Interviews
3.6
Β β€’Β 399 Interviews
3.9
Β β€’Β 348 Interviews
3.8
Β β€’Β 115 Interviews
3.9
Β β€’Β 78 Interviews
3.0
Β β€’Β 63 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

Software Developer Intern 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
Get AmbitionBox app

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