Associate Software Engineer

1500+ Associate Software Engineer Interview Questions and Answers

Updated 15 Dec 2024

Popular Companies

search-icon
Q51. Detect and Remove Loop

Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. You have to make changes in the given linked list itself and return the update...read more

Q52. Infix To Postfix

You are given a string EXP which is a valid infix expression. Convert the given infix expression to postfix expression.

Infix expression is of the form a op b. Where operator is is between the o...read more

Q53. Nth Fibonacci Number

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

Frequently asked in, ,
Q54. Buy and Sell Stock

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

Frequently asked in,
Are these interview questions helpful?
Q55. Decode String

You have been given an encoded string. Your task is to decode it back to the original string.

- An encoded string will be of the form [encoded_string], where the 'encoded_string' inside the square ...read more
Q56. Minimum Number of Platform Needed

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

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
Q57. 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

Q58. Ninja and substrings

Ninja has been given a string 'STR' containing only lowercase alphabetic characters. Ninja has to find the number of all the different possible substrings of size two that appear in 'STR' as...read more

Ans.

The task is to find all the different possible substrings of size two that appear in a given string as contiguous substrings.

  • Iterate through the string and extract substrings of size two

  • Store the substrings in an array

  • Return the array of substrings

Associate Software Engineer Jobs

Sr. Associate Software Engineer-Claims β€’ 5-9 years
Duck Creek Technologies
β€’
4.5
Mumbai
Associate Software Engineer (.Net) β€’ 3-8 years
Maersk Global Service Centres India Pvt. Ltd.
β€’
4.3
Bangalore / Bengaluru
Associate Software Engineer - Embedded Testing β€’ 1-4 years
Maxim India Integrated Circuit Design Pvt Ltd.
β€’
4.4
Bangalore / Bengaluru

Q59. Question 2 was, Find the sum of all numbers in range from 1 to m(both inclusive) that are not divisible by n. Return difference between sum of integers not divisible by n with sum of numbers divisible by n.

Ans.

Find sum of numbers in range 1 to m (both inclusive) not divisible by n. Return difference between sum of non-divisible and divisible numbers.

  • Iterate through range 1 to m and check if number is divisible by n.

  • If not divisible, add to sum of non-divisible numbers.

  • If divisible, add to sum of divisible numbers.

  • Return difference between sum of non-divisible and divisible numbers.

Q60. Queue Using Stack

Implement a queue data structure which follows FIFO(First In First Out) property, using only the instances of the stack data structure.

Note:
1. To implement means you need to complete some pre...read more
Q61. Subarray with equal occurrences

You have been given an array/list ARR of length N consisting of 0s and 1s only. Your task is to find the number of subarrays(non-empty) in which the number of 0s and 1s are equal....read more

Q62. Swap Kth Elements

Given an array β€˜ARR’ of size β€˜N,’ swap the Kth element from beginning with the Kth element from the end.

For example:
If β€˜N’ = 5 and K = 2 [1, 2, 3, 4, 5] Then the output will be [1, 4, 3, 2, 5...read more
Q63. Implement a priority queue

Ninja is given a task to implement a priority queue using Heap data structure. The Ninja is busying preparing for the tournament., So he asked for your help.

Your task is to use the cl...read more

Q64. Preorder traversal of a BST

You have been given an array/list 'PREORDER' representing the preorder traversal of a BST with 'N' nodes. All the elements in the given array have distinct values.

Your task is to con...read more

Q65. Bipartite Graph

Given a graph, check whether the graph is bipartite or not. Your function should return true if the given graph's vertices can be divided into two independent sets, β€˜U’ and β€˜V’ such that every ed...read more

Ans.

The function checks whether a given graph is bipartite or not.

  • A bipartite graph can be divided into two independent sets such that every edge connects a vertex from one set to the other.

  • We can use graph coloring algorithm to check if the graph is bipartite.

  • Start by coloring the first vertex with one color and all its neighbors with the other color.

  • Continue coloring the remaining vertices, making sure that no adjacent vertices have the same color.

  • If at any point, we find that ...read more

Q66. Constellation

Given a matrix β€˜UNIVERSE’ with 3 rows and β€˜N’ columns, with the characters { # , * , . } and these characters represent a cluster of stars and galaxies in space. Stars are represented by β€˜*’ symbol...read more

Q67. First unique character in a string

You are given a string S of length N. Your task is to find the index(considering 1-based indexing) of the first unique character present in the string. If there are no unique c...read more

Q68. Merge Two Sorted Arrays

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

Ans.

The task is to merge two sorted arrays into one sorted array.

  • Create a new array with size M + N to store the merged array

  • Use two pointers to iterate through the elements of ARR1 and ARR2

  • Compare the elements at the current pointers and add the smaller element to the new array

  • Move the pointer of the array from which the element was added

  • Repeat the process until all elements are merged

  • If there are remaining elements in ARR2, add them to the new array

  • Return the merged array

Q69. N Queens

You are given an integer 'N'. For a given 'N' x 'N' chessboard, find a way to place 'N' queens such that no queen can attack any other queen on the chessboard.

A queen can be killed when it lies in the ...read more

Q70. Remove Vowels

You are given a string STR of length N. Your task is to remove all the vowels present in that string and print the modified string.

English alphabets β€˜a’, β€˜e’, β€˜i’, β€˜o’, β€˜u’ are termed as vowels. A...read more

Q71. String Transformation

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

Q72. Trapping Rain Water

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

Ans.

The question asks to calculate 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 trapped water for all bars and return the total amount.

Frequently asked in,
Q73. Two Sum

Given an array β€˜A’ of size β€˜N’, sorted in non-decreasing order. Return the pair of two distinct indices whose value adds up to the given β€˜target’. The given array is 0 indexed. So returned indices are in...read more

Q74. Two Sum

You are given an array of integers 'ARR' of length 'N' and an integer Target. Your task is to return all pairs of elements such that they add up to Target.

Note:

We cannot use the element at a given inde...read more
Frequently asked in,
Q75. 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,
Q76. Delete Node In A Linked List

You are given a Singly Linked List of integers and a reference to the node to be deleted. Every node of the Linked List has a unique value written on it. Your task is to delete that ...read more

Q77. Remove Vowels from a given string

You are given a string STR of length N. Your task is to remove all the vowels present in that string and print the modified string.

English alphabets β€˜a’, β€˜e’, β€˜i’, β€˜o’, β€˜u’ are...read more

Q78. Replace Spaces

You have been given a string 'STR' of words. You need to replace all the spaces between words with β€œ@40”.

Input Format:
The first line contains a single integer β€˜T’ representing the number of test...read more
Q79. Swap Two Numbers

Take two numbers as input and swap them and print the swapped values.

Input Format:
The first line of input contains a single integer 't', representing the total number of test cases. The second...read more
Q80. Search an Element in an Array

You have given a sorted array 'A' of 'N' integers.

Now, you are given 'Q' queries, and each query consists of a single integer 'X'. Your task is to check whether 'X' is present in a...read more

Q81. Stack using queue

Implement a Stack Data Structure specifically to store integer data using two Queues.

There should be two data members, both being Queues to store the data internally. You may use the inbuilt Q...read more

Q82. All Prime Numbers less than or equal to N

You are given a positive integer 'N'. Your task is to return all the prime numbers less than or equal to the 'N'.

Note:

1) A prime number is a number that has only two f...read more
Q83. Colorful Knapsack

You are given 'N' stones labeled from 1 to 'N'. The 'i-th' stone has the weight W[i]. There are 'M' colors labeled by integers from 1 to 'M'. The 'i-th' stone has the color C[i] which is an int...read more

Q84. DFS Traversal

Given an undirected and disconnected graph G(V, E), containing 'V' vertices and 'E' edges, the information about edges is given using 'GRAPH' matrix, where i-th edge is between GRAPH[i][0] and GRAP...read more

Ans.

The question asks to print the DFS traversal of an undirected and disconnected graph.

  • Implement a Depth First Search (DFS) algorithm to traverse the graph.

  • Use a visited array to keep track of visited vertices.

  • For each unvisited vertex, start a DFS traversal and print the connected component.

  • Sort the vertices of each connected component in ascending order before printing.

Q85. Search in a Linked List

You are given a Singly Linked List of integers with a head pointer. Every node of the Linked List has a value written on it.

A sample Linked List

Sample Linked List

Now you have been given an integer value...read more

Q86. Second largest element in the array

You have been given an array/list 'ARR' of integers. Your task is to find the second largest element present in the 'ARR'.

Note:
a) Duplicate elements may be present. b) If no...read more
Q87. SQL Question

The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id as shown below:

+----+-------+--------+-----------+
| Id | Name...read more

Q88. Total area of overlapping rectangles

You are given two arbitrary rectangles on a 2-D coordinate plane, which may have an intersecting area. You have to find the net area covered by both the rectangles on the car...read more

Q89. Check if two trees are Mirror

You are given two arbitrary binary trees consisting of N and M number of nodes respectively, your task is to check whether the two trees are mirror of each other or not.

Two trees a...read more

Q90. Valid Parentheses

You're given string β€˜STR’ consisting solely of β€œ{β€œ, β€œ}”, β€œ(β€œ, β€œ)”, β€œ[β€œ and β€œ]” . Determine whether the parentheses are balanced.

Input Format:
The first line contains an Integer 'T' which denot...read more
Ans.

The task is to determine whether the given string of parentheses is balanced or not.

  • Use a stack data structure to check for balanced parentheses.

  • Iterate through the string and push opening parentheses onto the stack.

  • If a closing parenthesis is encountered, check if it matches the top of the stack.

  • If it matches, pop the top element from the stack.

  • If the stack is empty at the end, the parentheses are balanced.

  • If the stack is not empty or a closing parenthesis doesn't match, the...read more

Q91. DBMS Questions

1. He asked me what databases have you worked on?
2. What type of database is MySQL? I answered RDBMS.
He asked me to show the database design of a few of my projects. I did. Later he asked what is ...read more

Q92. Find prime numbers

You are given a positive integer β€˜N’. Your task is to print all prime numbers less than or equal to N.

Note: A prime number is a natural number that is divisible only by 1 and itself. Example ...read more

Q93. Height of Binary Tree

You are given an arbitrary binary tree consisting of 'N' nodes where each node is associated with a certain value. You need to find out the height of the tree.

Height of a binary tree is th...read more

Ans.

The height of a binary tree is the maximum number of edges from the root to a leaf node.

  • Traverse the tree recursively and keep track of the maximum height

  • If the current node is null, return 0

  • Otherwise, calculate the height of the left and right subtrees and return the maximum height plus 1

Q94. Remove String

You have been given a linked list where each node has a single character. You have also been given a string 'STR'.

You have to remove all the occurrences of string STR from the linked list.

Note:
1...read more
Q95. Search in a 2D matrix

You have been given a 2-D array 'MAT' of size M x N where 'M' and 'N' denote the number of rows and columns, respectively. The elements of each row are sorted in non-decreasing order.

Moreo...read more

Q96. Spiral Matrix

You are given a N x M matrix of integers, print the spiral path of the matrix.

For example:

Spiral Path

Input Format:
The first line contains an integer 'T' which denotes the number of test cases or queries t...read more

Q97. 1) What is NullPointerExceprion and give me a example?

Ans.

NullPointerException is a runtime exception that occurs when a program tries to access or use an object reference that is null.

  • It is a common exception in Java programming.

  • It is thrown when a program attempts to use an object reference that has not been initialized.

  • It indicates that there is an attempt to access or invoke a method on an object that is null.

  • Example: String str = null; str.length();

Q98. Fibonacci Number

You are given an integer, all you have to do is to find whether this number is a Fibonacci number or not.

Fn is said to be a Fibonacci sequence such that each number in Fn is the sum of its two ...read more

Q99. Find middle node of a Linked List

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

Q100. Rotting Oranges

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • ...read more
  • Previous
    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

    3.7
    Β β€’Β 10k Interviews
    3.9
    Β β€’Β 7.8k Interviews
    3.8
    Β β€’Β 4.6k Interviews
    3.6
    Β β€’Β 3.7k Interviews
    3.7
    Β β€’Β 791 Interviews
    3.4
    Β β€’Β 771 Interviews
    3.8
    Β β€’Β 513 Interviews
    4.0
    Β β€’Β 468 Interviews
    4.0
    Β β€’Β 344 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

    Associate Software Engineer 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