Associate Software Engineer

filter-iconFilter interviews by

1500+ Associate Software Engineer Interview Questions and Answers

Updated 4 Mar 2025

Popular Companies

search-icon

Q101. K - Sum Path In A Binary Tree

Given a binary tree where each node contains an integer value, and a value 'K', your task is to find all the paths in the binary tree such that the sum of the node values in each p...read more

Ans.

Find all paths in a binary tree where the sum of node values equals a given value 'K'.

  • Traverse the binary tree using depth-first search (DFS) and keep track of the current path and its sum.

  • When reaching a leaf node, check if the sum equals 'K' and add the path to the result.

  • Continue DFS traversal for both left and right children, passing updated path and sum.

  • Return the list of paths that sum up to 'K'.

Q102. Middle Node of a Linked List Problem Statement

Given the head node of a singly linked list, return a pointer to the middle node of the linked list. If there are an odd number of nodes, return the middle one. If...read more

Ans.

Return the middle node of a singly linked list, considering odd and even number of nodes.

  • Traverse the linked list with two pointers, one moving at twice the speed of the other

  • When the faster pointer reaches the end, the slower pointer will be at the middle node

  • Handle cases for odd and even number of nodes separately

  • Return null if the list is empty

Q103. Print All Permutations of a String

Given an input string STR, generate and print all possible permutations of the string.

Input:

str

Output:

All permutations of the input string, each on a new line.

Example:

In...read more
Ans.

Generate and print all possible permutations of a given input string.

  • Use recursion to generate all permutations by swapping characters in the string.

  • Maintain a visited array to keep track of characters already used in a particular permutation.

  • Print each permutation as it is generated.

  • Handle duplicate characters by skipping swapping if the character is already in the current position.

Q104. Search in a 2D Matrix

Given a 2D matrix MAT of size M x N, where M and N represent the number of rows and columns respectively. Each row is sorted in non-decreasing order, and the first element of each row is g...read more

Ans.

Implement a function to search for a given integer in a 2D matrix with specific properties.

  • Iterate through each row of the matrix and perform a binary search on each row to find the target integer.

  • Since the rows are sorted, binary search can be applied efficiently to determine if the target exists in the matrix.

  • Handle edge cases such as empty matrix or invalid input values.

  • Return 'TRUE' if the target is found in the matrix, otherwise return 'FALSE'.

Are these interview questions helpful?

Q105. Swap Kth Elements in an Array

Given an array ARR of size N, perform the operation to swap the Kth element from the beginning with the Kth element from the end of the array.

Example:

Input:
N = 5, K = 2
ARR = [1,...read more
Ans.

Swap Kth elements in an array with given constraints.

  • Create a temporary variable to store the Kth element from the start

  • Swap the Kth element from the start with the Kth element from the end

  • Return the modified array

Q106. Preorder Traversal of a BST Problem Statement

Given an array PREORDER representing the preorder traversal of a Binary Search Tree (BST) with N nodes, construct the original BST.

Each element in the given array ...read more

Ans.

Given a preorder traversal of a BST, construct the BST and return its inorder traversal.

  • Create a binary search tree from the preorder traversal array

  • Return the inorder traversal of the constructed BST

  • Ensure each element in the array is distinct

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q107. What are interrupts? Explain in detail what happens in 8051 when there is interrupt, What happens when there is an interrupt within an interrupt?

Ans.

Interrupts are signals that temporarily halt the execution of a program to handle a specific event.

  • When an interrupt occurs in 8051, the program counter is saved on the stack and the interrupt service routine (ISR) is executed.

  • The ISR handles the interrupt and then returns control to the main program by restoring the program counter from the stack.

  • If an interrupt occurs while another interrupt is being serviced, the second interrupt is queued and handled after the first one i...read more

Q108. Reverse the String Problem Statement

You are given a string STR which contains alphabets, numbers, and special characters. Your task is to reverse the string.

Example:

Input:
STR = "abcde"
Output:
"edcba"

Input...read more

Associate Software Engineer Jobs

Associate Software Engineer 5-10 years
IBM India Pvt. Limited
4.0
Bangalore / Bengaluru
Associate Software Engineer - IT 1-4 years
Flextronics Technologies(I) Pvt Ltd
4.0
Coimbatore
Associate Software Engineer 2-7 years
Cargill India Pvt. Ltd.
4.0
Bangalore / Bengaluru

Q109. 5) What are access specifiers and what is their significance?

Ans.

Access specifiers define the level of access to class members. They ensure encapsulation and data hiding in object-oriented programming.

  • Access specifiers are keywords used in class definitions to specify the access level of class members.

  • There are three access specifiers in C++: public, private, and protected.

  • Public members can be accessed from anywhere in the program, while private members can only be accessed within the class.

  • Protected members can be accessed within the cla...read more

Q110. Concatenate the Largest Digit Problem

You are given three non-zero numbers 'A', 'B', and 'C'. Your task is to determine the number created by concatenating the largest digit found in each number, in the sequenc...read more

Ans.

Concatenate the largest digit from three numbers in sequence to form a new number.

  • Find the largest digit in each number 'A', 'B', and 'C'.

  • Concatenate the largest digits in the sequence 'A', 'B', and 'C' to form a new number.

  • Return the concatenated number as the output.

Q111. Spiral Matrix Path Problem Statement

Given a N x M matrix of integers, print the spiral order of the matrix.

Input:

The input starts with an integer 'T' representing the number of test cases. Each test case con...read more

Ans.

The problem involves printing the spiral order of a given N x M matrix of integers.

  • Iterate through the matrix in a spiral order by keeping track of the boundaries.

  • Print the elements in the order of top row, right column, bottom row, and left column.

  • Continue this process until all elements are printed in the spiral order.

Q112. Tell me about yourself? Tell difference Between pointer and reference. Tell difference between truncate and delete. Project-related questions. Internship-related question if you have done any. General questions...

read more
Ans.

Answering interview questions for Associate Software Engineer position.

  • Pointer is a variable that stores the memory address of another variable.

  • Reference is an alias for an existing variable and cannot be null.

  • Truncate is used to remove all data from a table in a database.

  • Delete is used to remove specific rows from a table in a database.

Q113. Character Counting Challenge

Create a program that counts and prints the total number of specific character types from user input. Specifically, you need to count lowercase English alphabets, numeric digits (0-...read more

Ans.

Create a program to count lowercase alphabets, digits, and white spaces in user input until '$' is encountered.

  • Read characters from input stream until '$' is encountered

  • Count lowercase alphabets, digits, and white spaces separately

  • Print the counts of each character type as three integers separated by spaces

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

Find the length of the longest strictly increasing subsequence in an array of integers.

  • Use dynamic programming to keep track of the length of the longest increasing subsequence ending at each element.

  • Iterate through the array and update the length of the longest increasing subsequence for each element.

  • Return the maximum length found in the dynamic programming array as the result.

Q115. Ninja and Alien Language Order Problem

An alien dropped its dictionary while visiting Earth. The Ninja wants to determine the order of characters used in the alien language, based on the given list of words fro...read more

Ans.

Determine the order of characters in an alien language based on a list of words from the alien's dictionary.

  • Create a graph data structure to represent the relationships between characters in the words.

  • Perform a topological sort on the graph to find the order of characters.

  • Handle cases where there is no valid order by returning an empty string.

Q116. Write a function to swap. What exceptions it may throw?

Ans.

Function to swap two variables and possible exceptions

  • Function should take two variables as input

  • Use a temporary variable to swap the values

  • Possible exceptions include null pointer exception or out of bounds exception

Q117. Find Duplicates in an Array Problem Statement

You are provided with an array/list ARR of size 'N', containing integers ranging from 0 to N - 1. Some elements in this array might be repeating. Your task is to id...read more

Ans.

Identify duplicate elements in an array of integers ranging from 0 to N-1.

  • Iterate through the array and keep track of seen elements using a hash set.

  • If an element is already in the set, it is a duplicate and can be added to the result.

  • Return the list of duplicate elements found in the array.

Q118. Find the Second Largest Element

Given an array or list of integers 'ARR', identify the second largest element in 'ARR'.

If a second largest element does not exist, return -1.

Example:

Input:
ARR = [2, 4, 5, 6, ...read more
Ans.

Find the second largest element in an array of integers.

  • Iterate through the array to find the largest and second largest elements.

  • Handle cases where all elements are identical.

  • Return -1 if a second largest element does not exist.

Q119. Priority Queue Implementation

Ninja is tasked with implementing a priority queue using the Heap data structure. Since Ninja is busy with tournament preparations, your help is requested to complete this task.

Pr...read more

Ans.

Implement a priority queue using Heap data structure with functions like push, pop, getMaxElement, and isEmpty.

  • Implement push() function to insert element into the priority queue.

  • Implement pop() function to delete the largest element from the queue.

  • Implement getMaxElement() function to return the largest element.

  • Implement isEmpty() function to check if the queue is empty.

Q120. Stack using Two Queues Problem Statement

Develop a Stack Data Structure to store integer values using two Queues internally.

Your stack implementation should provide these public functions:

Explanation:

1. Cons...read more
Ans.

Implement a stack using two queues to store integer values with specified functions.

  • Use two queues to simulate stack operations efficiently.

  • Maintain the top element in one of the queues for easy access.

  • Handle push, pop, top, size, and isEmpty functions as specified.

  • Ensure proper error handling for empty stack scenarios.

  • Optimize the implementation to achieve desired time complexity.

  • Example: Push 42, pop top element (42), push 17, top element is 17.

Frequently asked in,

Q121. Find 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 in the string. If there are no unique ch...read more

Ans.

Find the index of the first unique character in a given string, return -1 if no unique characters are found.

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

  • Iterate through the string again to find the first character with frequency 1

  • Return the index of the first unique character or -1 if none found

Q122. How login page working (as in one of my project) and what is function of java script in your login page describe the process. There was cross question also whatever I was speaking. Also suggested me to attend c...

read more
Ans.

The login page uses JavaScript to validate user input and authenticate credentials.

  • JavaScript is used to validate user input before submitting to the server

  • The server then checks the credentials against a database

  • If the credentials are valid, the user is redirected to the home page

  • If the credentials are invalid, an error message is displayed

  • Coding challenges can help improve problem-solving skills

Q123. If your pega certified? Who java is used in pega,define oops,what are different types of Inheritance, what are activities gives examples,some questions on ruleset

Ans.

The interviewer asked about Pega certification, Java in Pega, OOPs, Inheritance, Activities, and Ruleset.

  • Pega is a BPM tool that uses Java for coding.

  • OOPs stands for Object-Oriented Programming and is a programming paradigm.

  • There are four types of inheritance: Single, Multiple, Multilevel, and Hierarchical.

  • Activities are used in Pega to perform a specific task or set of tasks.

  • Ruleset is a collection of rules that define the behavior of an application.

Q124. What are the three levels of data abstraction in a Database Management System?
Ans.

The three levels of data abstraction in a Database Management System are Physical Level, Logical Level, and View Level.

  • Physical Level: Deals with how data is stored on the storage medium. It includes details like data structures, file organization, and indexing.

  • Logical Level: Focuses on how data is viewed by users. It hides the physical storage details and presents a logical view of the database.

  • View Level: Represents a subset of the database to specific users. It provides a ...read more

Q125. With the coordinates of the four points p1, p2, p3, and p4, where p1, p2, and p3 lie on a circle, find whether p4 lies inside or outside of the circle.

Ans.

To determine if p4 lies inside or outside the circle with p1, p2, and p3 coordinates.

  • Calculate the equation of the circle using p1, p2, and p3 coordinates.

  • Check the distance between p4 and the center of the circle.

  • If the distance is less than the radius of the circle, p4 lies inside the circle, otherwise outside.

Q126. How can you print numbers from 1 to 100 using more than two threads in an optimized approach?
Ans.

Use multiple threads to print numbers from 1 to 100 in an optimized approach.

  • Divide the range of numbers (1-100) among the threads for parallel processing.

  • Use synchronization mechanisms like mutex or semaphore to ensure proper order of printing.

  • Consider using a thread pool to manage and reuse threads efficiently.

Q127. Write a code for the length of string without using strlen() function.

Ans.

Code to find length of string without using strlen() function.

  • Use a loop to iterate through each character of the string

  • Increment a counter variable for each character in the string

  • Stop the loop when the null character '\0' is encountered

  • Return the counter variable as the length of the string

Q128. What are Von Neumann and Harvard classifications, which does 8051 belong to?

Ans.

Von Neumann and Harvard are computer architecture classifications. 8051 belongs to Harvard architecture.

  • Von Neumann architecture has a single memory space for data and instructions, while Harvard architecture has separate memory spaces for data and instructions.

  • 8051 microcontroller uses Harvard architecture as it has separate memory spaces for program instructions and data.

  • Harvard architecture allows simultaneous access to both program memory and data memory, which increases ...read more

Q129. What is oops concept in java

Ans.

Object-oriented programming (OOP) is a programming paradigm that uses objects to represent and manipulate data.

  • OOP is based on the concept of classes and objects.

  • It focuses on encapsulation, inheritance, and polymorphism.

  • Encapsulation hides the internal details of an object and provides a public interface.

  • Inheritance allows classes to inherit properties and behaviors from other classes.

  • Polymorphism allows objects of different classes to be treated as objects of a common super...read more

Frequently asked in, ,

Q130. Prime Numbers Identification

Given a positive integer N, your task is to identify all prime numbers less than or equal to N.

Explanation:

A prime number is a natural number greater than 1 that has no positive d...read more

Ans.

Identify all prime numbers less than or equal to a given positive integer N.

  • Iterate from 2 to N and check if each number is prime

  • Use the Sieve of Eratosthenes algorithm for efficient prime number identification

  • Optimize by only checking up to the square root of N for divisors

Frequently asked in,

Q131. All Prime Numbers Problem Statement

Given an integer 'N', your task is to print all the prime numbers that lie within the range from 2 to 'N' (inclusive).

Input:

Integer N

Output:

Prime numbers printed on separ...read more
Ans.

Print all prime numbers within the range from 2 to N.

  • Iterate from 2 to N and check if each number is prime

  • A prime number is a number greater than 1 that has no positive divisors other than 1 and itself

  • Use a nested loop to check divisibility by numbers less than the current number

Q132. Nth Fibonacci Number Problem

Calculate the Nth term in the Fibonacci sequence using the formula: F(n) = F(n-1) + F(n-2) where F(1) = F(2) = 1.

Given a number N, determine the Nth Fibonacci number.

Input:

N

Outp...read more

Ans.

Calculate the Nth Fibonacci number using the given formula and constraints.

  • Implement a function to calculate the Nth Fibonacci number using the formula F(n) = F(n-1) + F(n-2) with base cases F(1) = F(2) = 1.

  • Use dynamic programming or recursion to efficiently compute the Fibonacci number for large N values.

  • Ensure the input N is within the constraints 1 <= N <= 10000.

  • Example: For N = 5, the output should be 5 as the 5th Fibonacci number is 5.

Q133. What are the advantages of python over other programming languages?

Ans.

Python is a versatile language with easy syntax, vast libraries, and cross-platform compatibility.

  • Python has a simple and readable syntax, making it easy to learn and write code quickly.

  • Python has a vast collection of libraries and frameworks for various purposes, such as web development, data analysis, and machine learning.

  • Python is cross-platform compatible, meaning that code written on one platform can run on another without modification.

  • Python has a large and active commu...read more

Q134. Which is the most important gadget in your life without which life will be difficult for you

Ans.

My smartphone is the most important gadget in my life.

  • My smartphone helps me stay connected with family and friends

  • I use it for work-related communication and tasks

  • It serves as a source of entertainment during leisure time

  • I can access important information and services through it

  • It also serves as a camera for capturing memories

  • Examples: iPhone, Samsung Galaxy, Google Pixel

Q135. 1. Difference between abstract class and interface. 2. Internal Working of HashMap 3. Difference Between ArrayList vs Linked List. 4. WAP to reverse a String 5. dependency Injections 6. IOC Container 7. Singlet...

read more
Ans.

This interview question covers various topics including abstract class, interface, HashMap, ArrayList, Linked List, String reversal, dependency injection, IOC container, and singleton class.

  • Abstract class is a class that cannot be instantiated and can have both abstract and non-abstract methods.

  • Interface is a blueprint of a class that can only have abstract methods and cannot be instantiated.

  • HashMap is a data structure that stores key-value pairs and uses hashing to provide c...read more

Q136. 1. Give your introduction. 2. What is OOP, what are pillars of OOP. 3. Define inheritance. Types of inheritance. 4. What is operator overloading. Overloading of ! operator. 5. What is Linked List. 6. WAP to det...

read more
Ans.

Interview questions for Associate Software Engineer position

  • Introduce yourself briefly and highlight your skills and experience

  • OOP stands for Object-Oriented Programming and its pillars are encapsulation, inheritance, and polymorphism

  • Inheritance is a mechanism in OOP where a new class is created by inheriting properties and methods of an existing class. Types of inheritance are single, multiple, multilevel, and hierarchical

  • Operator overloading is a feature in OOP where an ope...read more

Q137. Given three tables and their attributes, how would you find the names of employees whose balance is less than 200?
Ans.

Join tables on employee ID, filter by balance less than 200, select employee names.

  • Join tables on employee ID attribute

  • Filter rows where balance is less than 200

  • Select employee names from the result

Q138. What basic questions do you think will help determine if I fit into your company culture?
Ans.

Questions related to teamwork, problem-solving, adaptability, and communication skills can help determine if you fit into our company culture.

  • How do you handle working in a team environment?

  • Can you provide an example of a time when you had to solve a complex problem?

  • How do you adapt to changes in a fast-paced work environment?

  • Describe a situation where effective communication was crucial in a project.

Q139. Why java is known as platform independent language?

Ans.

Java is platform independent because it uses the concept of bytecode and virtual machine.

  • Java code is compiled into bytecode, which is a platform-independent representation of the code.

  • The bytecode is then executed by the Java Virtual Machine (JVM), which is specific to each platform.

  • This allows Java programs to run on any platform that has a compatible JVM.

  • The JVM acts as an interpreter, translating the bytecode into machine code that can be executed by the underlying hardwa...read more

Q140. Where is the location of current line of execution stored when there is an interrupt?

Ans.

The location of current line of execution is stored in the stack when there is an interrupt.

  • When an interrupt occurs, the processor saves the current state of execution on the stack.

  • The location of the current line of execution is stored in the program counter (PC) register.

  • The PC register is pushed onto the stack along with other registers.

  • After the interrupt is serviced, the processor pops the saved state from the stack and resumes execution from the PC value.

Q141. Can you design a system similar to Splitwise and identify three features that you would change or improve?
Ans.

Design a system similar to Splitwise and suggest three features for improvement.

  • Implement a real-time notification system for updates on shared expenses

  • Integrate a feature for automatic currency conversion for international transactions

  • Enhance the user interface with data visualization tools for better expense tracking

Q142. Can you write a SQL query that joins two tables A and B on the common attribute ID and selects records (ID_NAME) that have matching ID values in both tables?
Ans.

Write a SQL query to join two tables on a common attribute and select matching records.

  • Use the JOIN keyword to combine tables A and B on the common attribute ID

  • Specify the common attribute in the ON clause of the JOIN

  • Select the desired columns (ID_NAME) from the joined tables

Q143. How do you combine two tables in SQL?
Ans.

To combine two tables in SQL, you can use the JOIN clause to merge rows based on a related column.

  • Use the JOIN clause to specify the columns from each table that are used to match up rows.

  • Types of JOINs include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.

  • Example: SELECT * FROM table1 JOIN table2 ON table1.column = table2.column;

Q144. 3) What is call by value and call hy refarance?

Ans.

Call by value and call by reference are two ways of passing arguments to a function.

  • Call by value passes a copy of the argument value to the function.

  • Call by reference passes a reference to the memory location of the argument.

  • Call by value is used for simple data types like int, float, etc.

  • Call by reference is used for complex data types like arrays, structures, etc.

Q145. 4. Difference Between a stack and a queue , what is a linked list.

Ans.

A stack is a data structure that follows Last-In-First-Out (LIFO) principle, while a queue follows First-In-First-Out (FIFO) principle. A linked list is a linear data structure where each element is a separate object with a pointer to the next element.

  • Stack is like a stack of plates, where the last plate added is the first one to be removed. Example: undo-redo functionality in a text editor.

  • Queue is like a queue of people waiting in line, where the first person added is the f...read more

Q146. What are fundamental pillars of OOPS programming. Explain each of them in detail.

Ans.

The fundamental pillars of OOPS programming are encapsulation, inheritance, and polymorphism.

  • Encapsulation: It is the process of hiding the internal details of an object and providing a public interface for interacting with it.

  • Inheritance: It allows creating new classes by inheriting properties and behaviors from existing classes, promoting code reuse.

  • Polymorphism: It enables objects of different classes to be treated as objects of a common superclass, providing flexibility a...read more

Q147. What is the difference between an abstract class and an interface in Java?
Ans.

Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.

  • Abstract class can have constructors, member variables, and methods with implementation.

  • Interface can only have abstract methods and constants.

  • A class can implement multiple interfaces but can only extend one abstract class.

  • Example: Abstract class - Animal with abstract method 'eat', Interface - Flyable with method 'fly'.

Q148. What is the difference between the list &amp; array in python?

Ans.

Lists and arrays in Python are both used to store multiple values, but they have some key differences.

  • Lists can store elements of different data types, while arrays can only store elements of the same data type.

  • Lists are dynamic in size, meaning they can grow or shrink as needed, while arrays have a fixed size.

  • Lists have built-in methods for manipulation and iteration, while arrays require the use of external libraries like NumPy for similar functionality.

Q149. What is the use of a router and how does it differ from a gateway?
Ans.

A router is a networking device that forwards data packets between computer networks. It differs from a gateway in that a gateway is a device that connects two different networks.

  • A router operates at the network layer of the OSI model, while a gateway operates at the application layer.

  • Routers use routing tables to determine the best path for forwarding packets, while gateways translate between different network protocols.

  • An example of a router is a home Wi-Fi router that conn...read more

Q150. How do you do dynamic memory allocation in C,C++? what is the difference?

Ans.

Dynamic memory allocation in C/C++ is done using malloc(), calloc(), realloc() functions. C++ also has new and delete operators.

  • malloc() allocates memory block of specified size

  • calloc() allocates memory block and initializes it to zero

  • realloc() changes the size of previously allocated memory block

  • new operator in C++ allocates memory and calls constructor

  • delete operator in C++ deallocates memory and calls destructor

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
 • 10.4k Interviews
3.8
 • 8.2k Interviews
3.7
 • 4.8k Interviews
3.5
 • 3.8k Interviews
3.7
 • 795 Interviews
3.4
 • 791 Interviews
3.7
 • 514 Interviews
4.0
 • 482 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

Recently Viewed
SALARIES
Genpact
REVIEWS
Cognizant
No Reviews
SALARIES
KPMG India
COMPANY BENEFITS
LTIMindtree
No Benefits
COMPANY BENEFITS
Capgemini
No Benefits
COMPANY BENEFITS
Capgemini
No Benefits
COMPANY BENEFITS
Capgemini
No Benefits
COMPANY BENEFITS
Cognizant
No Benefits
COMPANY BENEFITS
Capgemini
No Benefits
COMPANY BENEFITS
Cognizant
No Benefits
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

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