Infosys
20+ Divami Design Labs Interview Questions and Answers
There are an infinite number of electric bulbs. Each bulb is assigned a unique integer starting from 1. There are ‘N’ switches also and each switch is labeled by a unique prime number. If a switch ...read more
You are given an array of integers ARR[] of size N consisting of zeros and ones. You have to select a subset and flip bits of that subset. You have to return the count of maximum one’s that you can obt...read more
You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:
You have given a 2-dimensional array ‘ARR’ with ‘N’ rows and ‘M’ columns in which each element contains only two values,i.e., 0 and 1. Your task is to convert the given matrix into the Good matrix i...read more
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
Ninja is in space with his super spaceship having unlimited fuel. Ninja initially has a health level ‘H’ and his spaceship has an armour ‘A’. He decides to play a game, where at any instant he can ...read more
You have been given two integers ‘DAY_HOURS’ and ‘PARTS’. Where ‘DAY_HOURS’ is the number of hours in a day and a day can be divided into ‘PARTS’ equal parts. Your task is to find total instance...read more
You are given an array of strings. Your task is to find the number of unique strings.
A string is considered unique if it cannot be formed from any other strin...read more
You are given a 2D matrix, your task is to return a 2D vector containing all elements of the matrix in a diagonal fashion.
Example:
Following will be the output of the above matrix:
1 5 2 9 6 3 1...read more
For a given Singly Linked List of integers, sort the list using the 'Merge Sort' algorithm.
Input format :
The first and the only line of input contains the elements of the linked list sepa...read more
Ninja has its own technique of making a decision to do something or not. This technique is known as the ninja technique. In this technique, Ninja generates a random string containing only digits,...read more
You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a squar...read more
The city of Ninjaland is analogous to the unweighted graph. The city has ‘N’ houses numbered from 1 to ‘N’ respectively and are connected by M bidirectional roads. If a road ...read more
You are given an undirected graph in the form of an adjacency matrix along with an integer M. You need to tell if you can color the vertices of the graph using at most M colors such that no tw...read more
You are given a string 'S'. Your task is to partition 'S' such that every substring of the partition is a palindrome. You need to return all possible palindrome partitioning of 'S'.
Note:...read more
You are given an array/list NUM of integers. You are supposed to rearrange the elements of NUM such that no two adjacent elements will be the same or find out if it not possible.
For example:...read more
he asked me to explain all of the projects i had mentioned in my resume with each and every details i mentioned in the description of the projects along with the technology used , he also...read more
Q18. Write a program to check if a number is a palindrome or not.
Program to check if a number is a palindrome or not.
Convert the number to a string
Reverse the string
Compare the reversed string with the original string
If they are the same, the number is a palindrome
Q19. Find the sum of all the even numbers in an array
Sum of even numbers in an array
Loop through the array and check if each element is even
If even, add it to a running sum
Return the sum
Q21. What are NOSQL databases?
NOSQL databases are non-relational databases that store and retrieve data in a flexible and scalable manner.
NOSQL stands for 'Not Only SQL'
They are designed to handle large volumes of unstructured or semi-structured data
They offer high scalability and availability
Examples include MongoDB, Cassandra, and Couchbase
Q22. What are ACID properties?
ACID properties are a set of properties that ensure database transactions are processed reliably.
ACID stands for Atomicity, Consistency, Isolation, and Durability.
Atomicity ensures that a transaction is treated as a single, indivisible unit of work.
Consistency ensures that a transaction brings the database from one valid state to another.
Isolation ensures that concurrent transactions do not interfere with each other.
Durability ensures that once a transaction is committed, it ...read more
Q23. Thrashing in OS?
Thrashing is a phenomenon in OS where excessive paging occurs, leading to a decrease in system performance.
Occurs when the system is overcommitted with too many processes or tasks
Causes excessive swapping of pages between RAM and disk
Can be resolved by adding more RAM or reducing the number of processes
Can be identified by monitoring page fault rates
Reviews
Interviews
Salaries
Users/Month