Application Developer
500+ Application Developer Interview Questions and Answers
Popular Companies
Q1. Minimum Cost to Connect All Points Problem Statement
Given an array COORDINATES
representing the integer coordinates of some points on a 2D plane, determine the minimum cost required to connect all points. The ...read more
The problem involves finding the minimum cost to connect all points on a 2D plane using Manhattan distance.
Create a function that calculates the Manhattan distance between two points.
Implement a function to find the minimum spanning tree to connect all points.
Consider using Prim's or Kruskal's algorithm for finding the minimum spanning tree.
Ensure that all points are connected with one simple path only.
Q2. Reverse Linked List Problem Statement
Given a singly linked list of integers, return the head of the reversed linked list.
Example:
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Reverse a singly linked list of integers and return the head of the reversed linked list.
Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.
Use three pointers to keep track of the current, previous, and next nodes while reversing the linked list.
Update the head of the reversed linked list as the last node encountered during the reversal process.
Application Developer Interview Questions and Answers for Freshers
Q3. Puzzle: – Two persons X and Y are sitting side by side with a coin in each’s hand. The game is to simultaneously flip the coin till anyone wins. Player X will win if he gets a consecutive HEAD, TAIL however Y w...
read moreThe game is not fair.
Player X has a higher chance of winning as they only need to get a consecutive HEAD, TAIL.
Player Y needs to get a consecutive HEAD, HEAD which is less likely to occur.
The probability of Player X winning is higher than Player Y winning.
Q4. Count Subsequences Problem Statement
Given an integer array ARR
of size N
, your task is to find the total number of subsequences in which all elements are equal.
Explanation:
A subsequence of an array is derive...read more
Count the total number of subsequences in which all elements are equal in an integer array.
Iterate through the array and count the frequency of each element.
Calculate the total number of subsequences for each element using the formula (frequency * (frequency + 1)) / 2.
Sum up the total number of subsequences for all elements and return the result modulo 10^9 + 7.
Q5. Remove the Kth Node from the End of a Linked List
You are given a singly Linked List with 'N' nodes containing integer data and an integer 'K'. Your task is to delete the Kth node from the end of this Linked Li...read more
Remove the Kth node from the end of a singly linked list given the position 'K'.
Traverse the list to find the length 'N' of the linked list.
Calculate the position from the beginning as 'N - K + 1'.
Delete the node at the calculated position from the beginning.
Q6. In a bag you have 20 black balls and 16 red balls.When you take out 2 black balls you take another white ball.If you take 2 white balls then you take out 1 black ball and if balls are of different color you tak...
read moreThe last ball that will be left is black.
When you take out 2 black balls, you take another white ball.
If you take 2 white balls, you take out 1 black ball.
If balls are of different color, you take out another black ball.
Since there are more black balls initially, the last ball will be black.
Share interview questions and help millions of jobseekers 🌟
Q7. 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
Count the total number of inversions in an integer array.
Iterate through the array and for each pair of elements, check if the conditions for inversion are met.
Use a nested loop to compare each pair of elements efficiently.
Keep a count of the inversions found and return the total count at the end.
Q8. Difference between tmap & tjoin Types of connection Difference between truncate delete What is ETL What are triggers Type of join
tmap is used to transform data in Talend, tjoin is used to join data. There are different types of connections, truncate and delete are different ways to remove data from a table. ETL stands for Extract, Transform, Load. Triggers are database objects that are automatically executed in response to certain events. There are different types of joins.
tmap is used for data transformation in Talend
tjoin is used for joining data in Talend
Types of connections include database connect...read more
Application Developer Jobs
Q9. Palindromic Substrings Problem Statement
Given a string S
, your task is to return all distinct palindromic substrings of the given string in alphabetical order.
Explanation:
A string is considered a palindrome ...read more
Return all distinct palindromic substrings of a given string in alphabetical order.
Iterate through all possible substrings of the given string
Check if each substring is a palindrome
Store distinct palindromic substrings in alphabetical order
Q10. Find All Occurrences in Matrix
You are provided with a matrix of characters, CHARACTER_MATRIX
of size M x N
, and a string WORD
. Your goal is to locate and display all occurrences of the string within the matrix...read more
The goal is to find all occurrences of a given string in a matrix in all eight possible directions.
Iterate through each cell in the matrix and check for the starting character of the word.
For each starting character found, check in all eight directions for the complete word.
Keep track of the coordinates of each character in the word for each occurrence.
Print the coordinates of each character for each occurrence found.
If no occurrences are found, output 'No match found'.
Q11. LCA of Binary Tree Problem Statement
You are given a binary tree consisting of distinct integers and two nodes, X
and Y
. Your task is to find and return the Lowest Common Ancestor (LCA) of these two nodes.
The ...read more
Find the Lowest Common Ancestor (LCA) of two nodes in a binary tree.
Traverse the binary tree to find the paths from the root to nodes X and Y.
Compare the paths to find the last common node, which is the LCA.
Handle cases where one node is an ancestor of the other.
Consider edge cases like when X or Y is the root node.
Implement a recursive or iterative solution to find the LCA efficiently.
Q12. Partition Equal Subset Sum Problem
Given an array ARR
consisting of 'N' positive integers, determine if it is possible to partition the array into two subsets such that the sum of the elements in both subsets i...read more
The task is to determine if it is possible to partition an array into two subsets with equal sum.
Iterate through all possible subsets of the array using recursion.
Keep track of the sum of elements in each subset.
Check if the sum of elements in both subsets is equal.
Q13. Middle of a Linked List
You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.
If there is an odd number of elements, return the middle ...read more
Return the middle element of a singly linked list, or the one farther from the head if there are even elements.
Traverse the linked list with two pointers, one moving twice as fast as the other
When the fast pointer reaches the end, the slow pointer will be at the middle
If there are even elements, return the one that is farther from the head node
Handle edge cases like linked list of size 1 or no midpoint existing
Q14. Valid Parentheses Problem Statement
Given a string 'STR' consisting solely of the characters “{”, “}”, “(”, “)”, “[” and “]”, determine if the parentheses are balanced.
Input:
The first line contains an integer...read more
The task is to determine if a given string consisting of parentheses is balanced or not.
Iterate through each character in the string and use a stack to keep track of opening parentheses
If an opening parenthesis is encountered, push it onto the stack
If a closing parenthesis is encountered, check if it matches the top of the stack. If not, the string is not balanced
If all parentheses are matched correctly and the stack is empty at the end, the string is balanced
Q15. Construct Tree from Preorder Traversal
Given a list of integers pre[]
of size n
, representing the preorder traversal of a special binary tree where each node has 0 or 2 children, and a boolean array isLeaf[]
in...read more
Construct a binary tree from preorder traversal and leaf node information.
Create a binary tree using preorder traversal and leaf node information
Use recursion to build the tree
Identify leaf nodes based on the isLeaf array
Handle multiple test cases separately
Q16. Heap Sort Problem Statement
Your task is to sort an array of integers in non-decreasing order using the Heap Sort algorithm.
Input:
The first line contains an integer 'T' denoting the number of test cases.
Each...read more
Heap Sort algorithm is used to sort an array of integers in non-decreasing order.
Implement Heap Sort algorithm to sort the array in non-decreasing order.
Use a max heap to sort the array in ascending order.
Time complexity of Heap Sort is O(n log n).
Q17. Merge K Sorted Arrays Problem Statement
Given 'K' different arrays that are individually sorted in ascending order, merge all these arrays into a single array that is also sorted in ascending order.
Input
The f...read more
Merge K sorted arrays into a single sorted array.
Create a min heap to store the first element of each array along with the array index.
Pop the root of the heap (smallest element) and add it to the result array.
If the array from which the element was taken has more elements, add the next element to the heap.
Repeat until all elements are processed.
Time complexity: O(N log K) where N is the total number of elements and K is the number of arrays.
Q18. Design a website similar to bookmyshow.com for booking cinema tickets but it must be for a single location only which can have multiple theatres in it. In this he wanted me to design a basic rough GUI, relevant...
read moreDesign a website similar to bookmyshow.com for booking cinema tickets for a single location with multiple theatres.
Design a user-friendly GUI with options for advance booking, user login, user registration, movie rating, and saving card details.
Create relevant database tables to store information about movies, theatres, bookings, user details, and card details.
Link the GUI to the database to enable data flow and retrieval.
Implement features like advance booking, where users c...read more
Q19. 2. How will you design a database to manage the songs playlist on Spotify?
A database for managing songs on Spotify playlists.
Create a table for playlists with columns for name, description, and user ID
Create a table for songs with columns for title, artist, album, and duration
Create a table for playlist-songs with columns for playlist ID and song ID
Use foreign keys to link tables together
Allow for CRUD operations on playlists and songs
Q20. Anagram Pairs Verification Problem
Your task is to determine if two given strings are anagrams of each other. Two strings are considered anagrams if you can rearrange the letters of one string to form the other...read more
Determine if two strings are anagrams of each other by checking if they have the same characters in different order.
Create character frequency maps for both strings and compare them.
Sort both strings and compare them.
Use a hash table to store character counts and check if they are equal for both strings.
Q21. Matrix Transpose Problem Statement
Given a matrix MAT
, your task is to return the transpose of the matrix. The transpose of a matrix is obtained by converting rows into columns and vice versa. Specifically, the...read more
Transpose a given matrix by switching rows and columns.
Iterate through the matrix and swap elements at [i][j] with [j][i].
Create a new matrix to store the transposed values.
Ensure the dimensions of the transposed matrix are switched from the original matrix.
Q22. How do you update Dashboard/Homepage when there is some update in DB?
Update Dashboard/Homepage when there is a DB update
Use a backend service to monitor the DB for updates
When an update is detected, fetch the updated data from the DB
Update the Dashboard/Homepage with the new data using a frontend framework like React or Angular
Q23. Infix to Postfix Conversion
You are provided with a string EXP
which represents a valid infix expression. Your task is to convert this given infix expression into a postfix expression.
Explanation:
An infix exp...read more
Convert a given infix expression to a postfix expression.
Use a stack to keep track of operators and operands
Follow the rules of precedence for operators
Convert the infix expression to postfix using the stack
Handle parentheses by pushing them onto the stack and popping when necessary
Q24. Merge Two Sorted Linked Lists Problem Statement
You are provided with two sorted linked lists. Your task is to merge them into a single sorted linked list and return the head of the combined linked list.
Input:...read more
Merge two sorted linked lists into a single sorted linked list with linear time complexity and constant space usage.
Iterate through both linked lists simultaneously, comparing elements and merging them into a new linked list
Update the pointers of the new linked list as you merge elements from the two input linked lists
Ensure to handle cases where one linked list is empty or both linked lists are empty
Maintain the sorted order while merging the elements from the two linked lis...read more
Q25. Search in a Row-wise and Column-wise Sorted Matrix Problem Statement
You are given an N * N matrix of integers where each row and each column is sorted in increasing order. Your task is to find the position of ...read more
Given a sorted N * N matrix, find the position of a target integer X.
Iterate through each row and column to search for the target integer
Utilize the sorted nature of the matrix to optimize the search process
Return the position of the target integer if found, else return -1 -1
Q26. Subarray Challenge: Largest Equal 0s and 1s
Determine the length of the largest subarray within a given array of 0s and 1s, such that the subarray contains an equal number of 0s and 1s.
Input:
Input begins with...read more
Find the length of the largest subarray with equal number of 0s and 1s in a given array.
Iterate through the array and maintain a count of 0s and 1s encountered so far.
Store the count difference in a hashmap with the index as the key.
If the same count difference is encountered again, the subarray between the two indices has equal 0s and 1s.
Q27. Provided a string a character and a count, you have to print the string after the specified character has occurred count number of times. Ex: String: “This is demo string” Character: ‘i’ Count: 3 Output: “ng” H...
read moreThe program prints the substring after a specified character has occurred a certain number of times in a given string.
Iterate through the string to find the specified character.
Keep track of the count of occurrences of the character.
Once the count reaches the specified count, extract the substring after that position.
Handle corner cases such as when the character is not in the string or when it doesn't occur the specified number of times.
Q28. There N rooms in a hotel so customers will check-in and check-out a rooms simultaneously so which type of data structure you implement and it should be efficient and extension of this prebooking will also happe...
read moreTo efficiently manage room bookings and prebookings in a hotel, a priority queue data structure can be implemented.
A priority queue can be used to prioritize room bookings based on check-in dates.
When a customer checks out, the room becomes available and can be assigned to the next customer in the priority queue.
Prebookings can be stored separately and checked against the availability of rooms before assigning them to customers.
The priority queue can be implemented using a bi...read more
Q29. Greatest Common Divisor Problem Statement
You are tasked with finding the greatest common divisor (GCD) of two given numbers 'X' and 'Y'. The GCD is defined as the largest integer that divides both of the given...read more
Finding the greatest common divisor (GCD) of two given numbers 'X' and 'Y'.
Iterate through each test case
Use Euclidean algorithm to find GCD
Output the GCD for each test case
Q30. Tell me how to write ansible playbooks and how would you define a CI/CD pipeline. What tools can you use for pipeline creation and how it works.
Ansible playbooks automate configuration management. CI/CD pipeline automates software delivery. Tools include Jenkins, GitLab, and Travis CI.
Ansible playbooks are written in YAML format and define tasks to be executed on remote hosts.
CI/CD pipeline automates the software delivery process from code commit to production deployment.
Tools for pipeline creation include Jenkins, GitLab, Travis CI, and CircleCI.
Pipeline creation involves defining stages, jobs, and triggers to autom...read more
Yes, I can write a SQL query to join two tables on a common attribute and select matching records.
Use INNER JOIN to join tables A and B on the common attribute ID
Select the records (ID_NAME) where ID values match in both tables
Java is platform independent because the code is compiled into bytecode that can run on any system with a JVM, which is platform dependent.
Java code is compiled into bytecode, which is a platform-independent intermediate code
The JVM interprets and executes the bytecode on different platforms, making it platform dependent
The JVM acts as a layer of abstraction between the Java code and the underlying operating system
Example: A Java program compiled on a Windows machine can run ...read more
Q33. There are five glasses that are kept upside down.At a time you are bound to turn four glasses.Give minimum number of times in which you can turn back all the glasses so that now none among them are upside down
Minimum number of times to turn all glasses upside down when 4 can be turned at a time.
Turn over any four glasses, leaving one untouched.
Repeat the above step until only one glass is left upside down.
Finally, turn over the last glass to complete the task.
Minimum number of turns required is 3.
JVM allocates 5 types of memory areas: Heap, Stack, Method Area, PC Register, and Native Method Stack.
Heap is used for storing objects and is shared among all threads.
Stack is used for storing method calls and local variables, each thread has its own stack.
Method Area stores class structures, method data, and static variables.
PC Register stores the address of the currently executing instruction.
Native Method Stack is used for native method calls.
Q35. There are 25 horses in which you need to find out the fastest 3 horses. you can conduct a race among at most 5 horses to find out relative speed. At no point, you can find out the actual speed of the horse in a...
read moreMinimum 7 races required to find the top 3 fastest horses.
Divide the 25 horses into 5 groups of 5 horses each.
Conduct a race among the horses in each group to determine the fastest horse in each group.
Take the top 2 horses from each group and conduct a race among them to determine the fastest horse overall.
The winner of this race is the fastest horse.
Now, take the second-place horse from the final race and the second-place horse from each group race.
Conduct a race among these...read more
Normalization forms in a DBMS help reduce data redundancy and improve data integrity.
1NF (First Normal Form) - Each column contains atomic values, and there are no repeating groups.
2NF (Second Normal Form) - Meets 1NF and all non-key attributes are fully functional dependent on the primary key.
3NF (Third Normal Form) - Meets 2NF and there are no transitive dependencies between non-key attributes.
BCNF (Boyce-Codd Normal Form) - Every determinant is a candidate key.
4NF (Fourth ...read more
Q37. What is the difference between @Controller and @RestController
The @RestController annotation is a specialized version of the @Controller annotation in Spring MVC.
The @Controller annotation is used to define a controller class in Spring MVC.
The @RestController annotation is used to define a RESTful web service controller.
The @RestController annotation is a combination of @Controller and @ResponseBody annotations.
The @Controller annotation returns a view while the @RestController annotation returns data in JSON or XML format.
Example: @Con...read more
Q38. 4. Design a list to show songs in the year in which they were published.
Create an array of song titles sorted by year of publication.
Create an array of song objects with properties for title and year of publication.
Sort the array by year of publication.
Extract the titles of the songs into a separate array.
Return the array of song titles.
Q39. Code: – Given the value of a starting position and an ending position, you have to reach from start to end in a linear way, and you can move either to position immediate right to current position or two step ri...
read morePrint all possible paths from start to end in a linear way, moving either one or two steps right.
Use dynamic programming to solve the problem
Create a 2D array to store the number of paths to each position
Start from the end position and work backwards
At each position, calculate the number of paths by summing the number of paths from the next two positions
Print all the paths by backtracking from the start position
Q40. There are 25 horses and only 5 horses can be raced at a time and the top 3 are announced in each such race. What is the minimum number of races required to find the top 3 among 25 horses
The minimum number of races required to find the top 3 among 25 horses is 7.
Divide the 25 horses into 5 groups of 5 horses each.
Race the 5 groups, which will give us the top 3 horses from each group.
Now we have 15 horses remaining.
Race the top 3 horses from each group, which will give us the top 3 horses overall.
This requires a total of 7 races.
Q41. According to you, which sorting algorithm is best and why?
It depends on the use case. QuickSort is generally the fastest, but MergeSort is more stable and efficient for larger datasets.
QuickSort is generally the fastest sorting algorithm, but can be unstable for certain datasets.
MergeSort is more stable and efficient for larger datasets, but can be slower than QuickSort for smaller datasets.
InsertionSort is efficient for small datasets, but can be slow for larger datasets.
HeapSort is efficient for larger datasets, but can be slower ...read more
Method overloading is when multiple methods in the same class have the same name but different parameters. Method overriding is when a subclass provides a specific implementation of a method that is already provided by its superclass.
Method overloading allows a class to have multiple methods with the same name but different parameters. For example, having multiple constructors in a class with different parameter lists.
Method overriding occurs when a subclass provides a specif...read more
Q43. How would you arrange the words in a string based on their order of occurence
The words in a string can be arranged based on their order of occurrence.
Split the string into an array of words
Create a dictionary to store the count of each word
Sort the array based on the count of each word
Join the sorted array back into a string
Spring Boot offers basic annotations like @SpringBootApplication, @RestController, @Autowired, @RequestMapping, @ComponentScan.
@SpringBootApplication - Used to mark the main class of a Spring Boot application.
@RestController - Used to define RESTful web services.
@Autowired - Used for automatic dependency injection.
@RequestMapping - Used to map web requests to specific handler methods.
@ComponentScan - Used to specify the base packages to scan for Spring components.
Q45. 3.Applications of python 4.What is pep8 5.What is the full form of CSS 6.Take input 1, input2 and input3 how to find input 3. 7. You and your 8 colleagues face issue how to help you resolving the issue. 8.Diffe...
read moreInterview questions for application developer including Python applications, PEP8, CSS, input handling, list vs tuples, and willingness to relocate.
Python is used for web development, data analysis, machine learning, and more
PEP8 is a style guide for Python code
CSS stands for Cascading Style Sheets and is used for styling web pages
To find input3, use input3 = input1 + input2
To resolve issues with colleagues, communicate and collaborate effectively
Lists and tuples are both use...read more
ArrayList is non-synchronized and Vector is synchronized in Java.
ArrayList is not synchronized, while Vector is synchronized.
ArrayList is faster than Vector as it is not synchronized.
Vector is thread-safe, while ArrayList is not.
Example: ArrayList<String> list = new ArrayList<>(); Vector<String> vector = new Vector<>();
Q47. PUZZLE : one circle (radius r) is drawn.You are throwing a stone in it than what is the probability that stone lies near the center?...
read moreProbability of a stone thrown in a circle with radius r lying near the center.
The probability of the stone lying near the center is directly proportional to the area of the circle near the center.
The area of the circle near the center is proportional to the square of the radius.
Therefore, the probability of the stone lying near the center is proportional to the square of the radius.
The probability can be calculated by dividing the area of the circle near the center by the tot...read more
Q48. What are abstract classes in Java and what is the difference between an abstract class and an interface
Abstract classes in Java are classes that cannot be instantiated and are used as blueprints for other classes.
Abstract classes cannot be instantiated, meaning you cannot create objects of an abstract class.
Abstract classes can have both abstract and non-abstract methods.
Interfaces in Java are similar to abstract classes, but they cannot have any method implementations.
A class can implement multiple interfaces, but it can only extend one abstract class.
Abstract classes can hav...read more
The starter dependency of the Spring Boot module is spring-boot-starter-parent.
The starter dependency provides a set of default configurations and dependencies for Spring Boot applications.
It helps in reducing the amount of boilerplate code needed to set up a Spring Boot project.
The spring-boot-starter-parent is typically used as the parent project in a Spring Boot application's pom.xml file.
Different types of waits in Selenium WebDriver include Implicit Wait, Explicit Wait, and Fluent Wait.
Implicit Wait: Waits for a certain amount of time before throwing a NoSuchElementException.
Explicit Wait: Waits for a certain condition to occur before proceeding further in the code.
Fluent Wait: Waits for a condition to be true with a specified polling frequency and timeout.
Interview Questions of Similar Designations
Top Interview Questions for Application 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