Software Developer Intern

1000+ Software Developer Intern Interview Questions and Answers for Freshers

Updated 6 Jul 2025
search-icon
1w ago

Q. Find the Minimum Cost to Reach Destination via Train

Given 'N' stations on a train route, where the train travels from station 0 to 'N'-1, determine the minimum cost to reach the final station using given ticke...read more

Ans.

Find the minimum cost to reach the destination via train using given ticket costs for each pair of stations.

  • Create a 2D array to store the costs from each station to the final destination.

  • Use dynamic programming to calculate the minimum cost to reach each station.

  • Iterate through the stations and update the minimum cost based on the previous stations.

  • Return the minimum cost to reach the final station.

Asked in HyperVerge

2w ago

Q. K-th Permutation Sequence of First N Natural Numbers

Determine the K-th permutation from a sequence of the first N natural numbers.

Input:

Integer T indicating the number of test cases followed by 'T' test case...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

Asked in Amazon

1d ago

Q. Kth Smallest and Largest Element Problem Statement

You are provided with an array 'Arr' containing 'N' distinct integers and a positive integer 'K'. Your task is to find the Kth smallest and Kth largest element...read more

Ans.

Find the Kth smallest and largest elements in an array.

  • Sort the array and return the Kth element for smallest and (N-K+1)th element for largest.

  • Use a priority queue to efficiently find the Kth smallest and largest elements.

  • Handle edge cases where K is equal to 1 or N.

2w ago

Q. Unique Frequency Problem Statement

Given a string 'STR' with lowercase letters, determine the minimum number of deletions required to ensure that every letter in the string appears a unique number of times.

Exa...read more

Ans.

The task is to find the minimum number of deletions needed in a string to ensure each character appears a unique number of times.

  • Iterate through the string and count the frequency of each character

  • Track the frequencies in a hashmap

  • Identify the characters with duplicate frequencies and calculate the minimum deletions needed

  • Return the minimum number of deletions for each test case

Are these interview questions helpful?

Asked in JUSPAY

2w ago

Q. Largest Cycle in Maze Problem Statement

Given a maze represented by 'N' cells numbered from 0 to N-1, and an array arr of 'N' integers where arr[i] denotes the cell number that can be reached from the 'i'-th ce...read more

Ans.

Identify the length of the largest cycle in a maze represented by cells and an array of integers.

  • Iterate through each cell and find cycles using DFS or Floyd's Tortoise and Hare algorithm.

  • Keep track of visited cells and cycle lengths to identify the largest cycle.

  • If a cell has no exit (-1), mark it as visited to avoid infinite loops.

Asked in SimplifyVMS

1d ago

Q. Lazy Santa Problem Statement

It's Christmas and Santa has 'K' gifts to distribute. There are 'N' children standing in a straight line in the park due to COVID restrictions. You are given an array distance conta...read more

Ans.

Find the minimum distance Santa must travel to distribute 'K' gifts to 'K' different children standing in a straight line.

  • Sort the array 'distance' in ascending order to simplify the problem.

  • Calculate the distance between each adjacent child and find the minimum sum of distances for 'K' gifts.

  • Keep track of the minimum sum of distances as you iterate through the array.

Software Developer Intern Jobs

Probo logo
Software Development (Internship) 0-1 years
Probo
4.6
Gurgaon / Gurugram
Skillmine Technology & Consulting logo
Software Developer Internship 3-6 years
Skillmine Technology & Consulting
3.7
Mumbai
Signzy logo
SDE - Intern 0-1 years
Signzy
3.0
Bangalore / Bengaluru

Asked in Amazon

2w ago

Q. Longest Increasing Subsequence Problem Statement

Given an array of integers with 'N' elements, determine the length of the longest subsequence where each element is greater than the previous element. This subse...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 longest increasing subsequence length at each index.

  • Use dynamic programming to store the lengths of increasing subsequences ending at each index.

  • Return the maximum length from the dynamic programming array.

Asked in Amazon

4d ago

Q. Container with Most Water Problem Statement

Given a sequence of 'N' space-separated non-negative integers A[1], A[2], ..., A[i], ..., A[n], where each number in the sequence represents the height of a line draw...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

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Amazon

2d ago

Q. Josephus Problem Statement

Consider 'N' individuals standing in a circle, numbered consecutively from 1 to N, in a clockwise direction. Initially, the person at position 1 starts counting and will skip K-1 pers...read more

Ans.

This question is about finding the position of the last person surviving in a circle of N people, where each person kills the Kth person in a clockwise direction.

  • Implement a function that takes the number of test cases, N, and K as input

  • For each test case, simulate the killing process by iterating through the circle and skipping K-1 people

  • Keep track of the position of the last person surviving and return it as the output

1w ago

Q. Ninja And The Fence Problem Statement

Ninja is given a task of painting a fence with ‘N’ posts using ‘K’ different colors. The task requires that not more than two adjacent posts have the same color. Your goal ...read more

Ans.

The task is to determine the number of ways to paint a fence with 'N' posts using 'K' different colors, with the constraint that not more than two adjacent posts have the same color.

  • Use dynamic programming to solve the problem efficiently.

  • Consider the cases where the last two posts have the same color and different colors separately.

  • Keep track of the number of ways to paint the fence at each post using a 2D array.

  • Apply modulo 10^9 + 7 to avoid overflow issues.

  • Return the final...read more

1w ago

Q. Problem: Deletion in Circular Linked List

You are provided with a Circular Linked List of integers and a specific integer, referred to as 'key'.

Your task is to implement a function that locates the specified k...read more

Ans.

Implement a function to delete a specific key from a Circular Linked List of integers.

  • Traverse the Circular Linked List to find the key to be deleted.

  • Update the pointers of the previous and next nodes to skip the node with the key.

  • Handle the case where the Circular Linked List becomes empty after deletion.

  • Return -1 if the Circular Linked List is empty after deletion.

Asked in Amazon

1w ago

Q. Valid Sudoku Problem Statement

You are given a 9 X 9 2D matrix named MATRIX which contains some cells filled with digits (1 to 9) and some cells left empty (denoted by 0).

Your task is to determine if there is ...read more

Ans.

The task is to determine if a given 9x9 matrix can be filled with digits 1-9 to form a valid Sudoku solution.

  • Iterate through each cell in the matrix.

  • For each empty cell, try filling it with a digit from 1-9 and check if it satisfies the Sudoku conditions.

  • Use helper functions to check if the digit is valid in the current row, column, and sub-matrix.

  • If a valid digit is found, recursively fill the next empty cell.

  • If all cells are filled and the Sudoku conditions are satisfied, r...read more

3d ago

Q. XOR Query Problem Statement

Assume you initially have an empty array called ARR. You are required to return the updated array after executing Q number of queries on this array.

There are two types of queries to...read more

Ans.

Implement a function to update an array based on XOR queries.

  • Create an empty array to store the elements.

  • Iterate through each query and update the array accordingly.

  • Use bitwise XOR operation to update the elements.

  • Ensure to handle both types of queries - insert and XOR.

  • Return the updated array after all queries are processed.

Asked in Dunzo

2w ago

Q. Asteroid Collision Problem Description

Given an array/list ASTEROIDS representing asteroids aligned in a row, each element's absolute value identifies the asteroid's size, while its sign indicates the direction...read more

Ans.

Determine the state of asteroids after collisions occur.

  • Iterate through the array of asteroids and simulate collisions between adjacent asteroids.

  • Use a stack to keep track of remaining asteroids after collisions.

  • Handle cases where asteroids moving in opposite directions collide and destroy each other.

  • Handle cases where asteroids moving in the same direction do not collide.

Asked in Amazon

4d ago

Q. Flip Bits Problem Explanation

Given an array of integers ARR of size N, consisting of 0s and 1s, you need to select a sub-array and flip its bits. Your task is to return the maximum count of 1s that can be obta...read more

Ans.

Given an array of 0s and 1s, find the maximum count of 1s by flipping a sub-array at most once.

  • Iterate through the array and keep track of the maximum count of 1s obtained by flipping a sub-array.

  • Consider flipping a sub-array only when it results in increasing the count of 1s.

  • Update the maximum count of 1s as you iterate through the array.

  • Return the maximum count of 1s obtained after considering all possible sub-arrays.

Asked in DE Shaw

1w ago

Q. K Max Sum Combinations Problem Statement

Given two arrays/lists A and B, each of size N, and an integer K, you need to determine the K maximum and valid sum combinations from all possible combinations of sums g...read more

Ans.

The problem involves finding the K maximum sum combinations from two arrays by adding one element from each array.

  • Iterate through all possible sum combinations of elements from arrays A and B.

  • Store the sums in a max heap to keep track of the K maximum sums.

  • Pop the top K elements from the max heap to get the K maximum sum combinations.

Asked in Google

1d ago

Q. Remove K Corner Elements - Problem Statement

Given an array "arr" consisting of "N" integer elements, your task is to remove "K" elements from the beginning or the end of the array. You must return the maximum ...read more

Ans.

Given an array, remove K elements from beginning or end to maximize sum of remaining elements.

  • Iterate through all possible combinations of removing K elements from beginning and end

  • Calculate sum of remaining elements for each combination

  • Return the maximum sum obtained

Asked in Amazon

1w ago

Q. Count Inversions Problem Statement

Given an integer array ARR of size N, your task is to find the total number of inversions that exist in the array.

An inversion is defined for a pair of integers in the array ...read more

Ans.

The task is to count the number of inversions in an array.

  • Iterate through the array and for each element, compare it with all the elements that come after it.

  • If the current element is greater than any of the elements that come after it, increment the inversion count.

  • Return the inversion count as the result.

1w ago

Q. LFU Cache Design Problem

Design and implement a Least Frequently Used (LFU) Cache with the following functionalities:

1. put(U__ID, value): Insert the value in the cache if the key ('U__ID') is not already pres...read more
Ans.

Design and implement a Least Frequently Used (LFU) Cache with put and get functionalities, handling capacity and frequency of use.

  • Implement a LFU cache with put and get functions

  • Handle capacity and frequency of use for eviction

  • Return the value of key if present, -1 otherwise

  • Consider multiple elements with least frequency, remove least recently used

  • Example: Insert, update, and retrieve values based on operations

5d ago

Q. Minimum Time To Solve The Problems

Given 'N' subjects, each containing a certain number of problems, and 'K' friends, assign subjects to friends such that each subject goes to exactly one friend, maintaining co...read more

Ans.

Assign subjects to friends to minimize maximum workload, find minimum time for most loaded friend.

  • Sort subjects in descending order

  • Assign subjects to friends one by one until all subjects are assigned

  • The maximum workload will be the sum of problems assigned to the friend with the most problems

  • Return the maximum workload as the minimum time required

1w ago

Q. Minimum Umbrellas Problem

You are provided with ‘N’ types of umbrellas, where each umbrella type can shelter a certain number of people. Given an array UMBRELLA that indicates the number of people each umbrella...read more

Ans.

Given 'N' types of umbrellas with different capacities, find the minimum number of umbrellas required to shelter exactly 'M' people.

  • Iterate through the umbrella capacities and try to cover 'M' people using the minimum number of umbrellas.

  • Keep track of the total number of people covered and the number of umbrellas used.

  • If it is not possible to cover 'M' people exactly, return -1.

  • Return the minimum number of umbrellas required to shelter exactly 'M' people.

Asked in ShareChat

3d ago

Q. Network Delay Time Problem Statement

Given a network of nodes numbered from 1 to 'N', and 'M' edges. Each edge is represented by three values (u, v, w) where 'u' and 'v' are nodes, and 'w' is an integer represe...read more

Ans.

Find the time it takes for a signal to travel from a given source node to all other nodes in a network.

  • Use Dijkstra's algorithm to find the shortest path from the source node to all other nodes.

  • Keep track of the minimum time taken to reach each node.

  • If it is impossible for the signal to reach all nodes, return -1.

6d ago

Q. Ninja and the Maze Problem Statement

Ninja is stuck in a maze represented as a 2D grid. He can move in four directions (Up, Down, Left, Right) until he hits a wall ('1'). Once stopped, he can choose a new direc...read more

Ans.

The problem involves determining if a ninja can reach the destination in a maze by moving in four directions until hitting a wall.

  • Create a function that takes in the maze, starting point, and destination coordinates as input.

  • Implement a recursive algorithm to explore all possible paths in the maze.

  • Check if the destination can be reached from the starting point by moving in four directions.

  • Return 'True' if a path exists, otherwise return 'False'.

Asked in BNY

1w ago

Q. Palindromic Substrings Problem Statement

You are given a string 'STR'. Your task is to determine the total number of palindromic substrings present in 'STR'.

Example:

Input:
"abbc"
Output:
5
Explanation:

The pa...read more

Ans.

The task is to find the total number of palindromic substrings in a given string.

  • Iterate through each character in the string and consider it as the center of a potential palindrome

  • Expand outwards from the center to check if the substring is a palindrome

  • Count the number of palindromic substrings found

Asked in PayPal

2w ago

Q. Design a Constant Time Data Structure

Create a data structure that maintains mappings between keys and values, supporting the following operations in constant time:

1. INSERT(key, value): Add or update the inte...read more
Ans.

Design a constant time data structure for key-value mappings with operations like INSERT, DELETE, SEARCH, GET, GET_SIZE, and IS_EMPTY.

  • Use a hash table to store key-value pairs for constant time operations.

  • Implement INSERT by hashing the key and storing the value at the corresponding index.

  • For DELETE, simply remove the key-value pair from the hash table.

  • SEARCH can be done by checking if the key exists in the hash table.

  • GET retrieves the value associated with the key, returning...read more

Asked in Amazon

2w ago

Q. First Missing Positive Problem Statement

You are provided with an integer array ARR of length 'N'. Your objective is to determine the first missing positive integer using linear time and constant space. This me...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.

Asked in Springworks

5d ago

Q. Implementing Queue with Two Stacks

Your task is to implement a queue using two stacks. You are provided with ‘Q’ queries and need to handle them, where each query falls under one of these two operations:

  1. Enque...read more
Ans.

Implement a queue using two stacks with enqueue and dequeue operations.

  • Use two stacks to simulate a queue - one for enqueue and one for dequeue.

  • For enqueue operation, push elements onto the enqueue stack.

  • For dequeue operation, if dequeue stack is empty, pop all elements from enqueue stack and push onto dequeue stack.

  • Return true for successful enqueue and -1 for empty dequeue.

  • Example: Enqueue 10, enqueue 20, dequeue (returns 10), enqueue 30, dequeue (returns 20).

Asked in TCS

1w ago

Q. Jar of Candies Problem Statement

You are given a jar containing candies with a maximum capacity of 'N'. The jar cannot have less than 1 candy at any point. Given 'K', the number of candies a customer wants, det...read more

Ans.

Given a jar with 'N' candies, determine the number of candies left after providing 'K' candies to a customer.

  • Check if 'K' is greater than 'N', return -1 if invalid

  • Subtract 'K' from 'N' to get the remaining candies

  • Output the remaining candies for each test case

Asked in Amazon

1w ago

Q. Missing Number in Concatenated Sequence

You were given a sequence of consecutive nonnegative integers but missed one while appending them to create a string S. Your task is to identify the missing integer from ...read more

Ans.

The task is to find the missing number in a string of consecutive nonnegative integers.

  • Iterate through the string and check if each substring can form a valid number

  • If a substring forms a valid number, check if it is consecutive with the previous number

  • If a substring does not form a valid number or is not consecutive, it is the missing number

  • Handle edge cases such as multiple missing numbers or all numbers already present

Asked in Procol

1w ago

Q. Power of a Number Problem

You are given two integers, X and N. Your task is to compute the value of X raised to the power of N (i.e., X^N).

Input:

The first line contains an integer T, the number of test cases....read more
Ans.

Compute the value of X raised to the power of N for given integers X and N.

  • Read the number of test cases T

  • For each test case, read the values of X and N

  • Calculate X^N for each test case

  • Print the result of X^N for each test case

Previous
1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

Amazon Logo
4.0
 • 5.4k Interviews
Google Logo
4.4
 • 897 Interviews
Samsung Logo
3.9
 • 575 Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits