Unthinkable Solutions
20+ Interview Questions and Answers
You are given an array of integers 'ARR' containing N elements. Each integer is in the range [1, N-1], with exactly one element repeated in the array.
Your task is to find the duplicate e...read more
The task is to find the duplicate element in an array of integers.
Iterate through the array and keep track of the frequency of each element using a hash map.
Return the element with a frequency greater than 1.
Alternatively, sort the array and check for adjacent elements with the same value.
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
The question asks to find 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 amount of water trapped on each bar to get the total amount of rainwater trapped.
Reverse the given string word wise. That is, the last word in given string should come at 1st place, last second word at 2nd place and so on. Individual words should remain as it is.
Inp...read more
The given string needs to be reversed word wise, keeping the individual words intact.
Split the string into an array of words using a space as the delimiter.
Reverse the array of words.
Join the reversed array of words using a space as the separator to form the final reversed string.
You have been given an array/list ARR consisting of ‘N’ elements. Each element in the array is either 0, 1 or 2.
Now, your task is to sort this array/list in increasing order. For ...read more
The task is to sort an array of 0s, 1s, and 2s in increasing order.
Use a three-pointer approach to partition the array into three sections: 0s, 1s, and 2s.
Initialize three pointers: low, mid, and high. low points to the start of the array, mid points to the current element being processed, and high points to the end of the array.
While mid <= high, perform the following checks: if arr[mid] == 0, swap arr[low] and arr[mid], increment low and mid. If arr[mid] == 1, increment mid...read more
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
The task is to find the second largest element in an array of integers.
Iterate through the array and keep track of the largest and second largest elements.
Initialize the largest and second largest variables with the first two elements of the array.
Compare each element with the largest and second largest variables and update them accordingly.
Return the second largest element at the end.
You are given ‘N’ distinct integers in the form of an array ‘ARR’. You need to find whether it is possible to sort the given array by choosing a continuous subarray and reversing that subarray. You ha...read more
The question asks whether it is possible to sort an array by choosing a continuous subarray and reversing it.
Check if the array is already sorted. If yes, return true.
Find the first and last elements of the subarray that needs to be reversed.
Check if the subarray is in non-decreasing order. If yes, return true.
Check if the elements after the subarray are in non-increasing order. If yes, return true.
Otherwise, return false.
You will be given a stream of numbers, and you need to find the kth largest number in the stream at any given time.
As the stream of numbers can not be given during compile time, so you need to ...read more
There is a Binary Search Tree (BST) consisting of ‘N’ nodes. Each node of this BST has some integer data.
You are given a pointer to the root node of this BST, and an integer ‘X’. Print "True" if t...read more
Ninja is playing with numbers but hates when he gets duplicate numbers. Ninja is provided an array, and he wants to remove all duplicate elements and return the array, but he has to maintain th...read more
Q10. 1) coding question range is given example 2 to 10 in this range find 3 largest prime number sum. and for this 2 to 10 range exmaple is 3, 5 , 7 sum=15.
Find the sum of three largest prime numbers within a given range.
Create a function to check if a number is prime.
Loop through the given range and store prime numbers in an array.
Sort the array in descending order and sum the first three elements.
Return the sum.
What is a semaphore?
What is race condition?
Describe all the joins in SQL with a Venn diagram.
Q12. Implement debouncing, create a nodejs server with a get / post api, a puzzle, javascript questions like clousers, let / var / const, event loop, output based questions etc.
Implement debouncing, create a nodejs server with get/post api, and answer JavaScript questions.
Implement debouncing by using setTimeout and clearTimeout to limit the number of times a function is called.
Create a nodejs server with Express framework to handle get and post requests.
Answer JavaScript questions on closures, let/var/const, event loop, and output based questions.
Provide examples for each concept to demonstrate understanding.
Q13. SQL query to find second highest salary
SQL query to find second highest salary
Use the ORDER BY clause to sort salaries in descending order
Use the LIMIT clause to retrieve the second row
Q14. what is SANITY , Smoke Testing. Explain difference giving live project examples.
Sanity and Smoke Testing are types of software testing used to ensure the stability of the application.
Smoke Testing is a quick and shallow test to check if the application is stable enough for further testing.
Sanity Testing is a more thorough test to check if the application is ready for release.
Smoke Testing is usually done after a new build is released, while Sanity Testing is done after major changes are made to the application.
Example of Smoke Testing: Checking if the lo...read more
Q15. Star pattern in C language
Star pattern is a common programming exercise to print a pattern of stars in a specific shape.
Use nested loops to print the desired number of rows and columns.
Use if-else statements to determine when to print a star or a space.
Experiment with different loop conditions and print statements to create different patterns.
Q16. What is difference between integration and System testing.
Integration testing checks if different modules work together, while system testing checks if the entire system meets requirements.
Integration testing focuses on testing the interfaces between modules or components of a system.
System testing focuses on testing the entire system as a whole, including all integrated components.
Integration testing is performed before system testing.
System testing is performed after integration testing.
Integration testing is usually done by devel...read more
Q17. Designing dbms for a college website
Designing a DBMS for a college website involves creating tables for students, courses, faculty, and more.
Create tables for students, courses, faculty, departments, etc.
Establish relationships between tables using foreign keys.
Include attributes like student ID, course ID, faculty ID, etc.
Implement normalization to reduce redundancy and improve data integrity.
Consider implementing views for complex queries or reports.
Q18. What is Agile .Explain
Agile is a project management methodology that emphasizes on iterative development, collaboration, and customer satisfaction.
Agile is based on the Agile Manifesto, which values individuals and interactions, working software, customer collaboration, and responding to change.
Agile involves breaking down a project into smaller, manageable chunks called sprints.
Agile encourages continuous feedback and improvement throughout the development process.
Examples of Agile methodologies ...read more
Q19. Tell about Technical Skills
I have strong technical skills in test automation, manual testing, bug tracking, and test case design.
Proficient in test automation tools like Selenium and JUnit
Skilled in manual testing techniques and methodologies
Experience with bug tracking systems such as Jira
Ability to design comprehensive test cases for various scenarios
Q20. 1)Largest Area of Histogram
The largest area of a histogram is the maximum area that can be enclosed by a rectangle within the histogram bars.
Calculate the largest area of a histogram by finding the maximum area of rectangles that can be formed within the histogram bars.
This can be done by iterating through each bar and calculating the area of rectangles that can be formed with that bar as the height.
Keep track of the maximum area found so far and return it as the largest area of the histogram.
Q21. minimum effort in an array
Find the string with minimum length in an array of strings.
Iterate through the array and keep track of the minimum length string
Return the string with the minimum length
Q22. String reverse code in any language
Reverse a string in any programming language
Use a loop to iterate through the characters of the string
Swap the characters from start to end of the string
Repeat until the entire string is reversed
Q23. Find loop in linked list
Use Floyd's Tortoise and Hare algorithm to find a loop in a linked list.
Initialize two pointers, slow and fast, at the head of the linked list.
Move slow pointer by one step and fast pointer by two steps.
If they meet at some point, there is a loop in the linked list.
Q24. Longest common substring
Finding the longest common substring among a set of strings.
Iterate through all substrings of the first string and check if they are present in all other strings.
Keep track of the longest common substring found so far.
Return the longest common substring.
Q25. sum without plus sign
Use bitwise operators to perform addition without using the plus sign.
Use bitwise XOR operation to add two numbers without carrying over
Use bitwise AND operation to find the carry bits and shift them to the left
Repeat the process until there are no more carry bits
Q26. Define Constructors
Constructors are special methods in a class that are used to initialize objects.
Constructors have the same name as the class they belong to.
They are called automatically when an object of the class is created.
Constructors can have parameters to initialize the object with specific values.
Example: public class Car { public Car(String color) { this.color = color; }}
Q27. Define Oops pillars
Oops pillars refer to the four main concepts of object-oriented programming: Inheritance, Encapsulation, Polymorphism, and Abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Polymorphism: Ability of a function to behave differently based on the object it is acting upon.
Abstraction: Hiding the complex implementation details and showing only the necess...read more
Q28. Largest Area of Histogram
The largest area of a histogram can be found by calculating the maximum area of rectangles formed by the histogram bars.
Calculate the area of rectangles formed by each bar and find the maximum area.
Consider the width of the rectangle as the number of consecutive bars with height greater than or equal to the current bar.
Example: For histogram [2,1,5,6,2,3], the largest area would be 10 (5*2).
Q29. reverse the string
Reverse a given string
Use a loop to iterate through the characters of the string and build a new string in reverse order
Alternatively, use built-in functions like reverse() or StringBuilder in some programming languages
Top HR Questions asked in null
Interview Process at null
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month