Software Specialist Interview Questions

1,464 software specialist interview questions shared by candidates

An evil scientist has developed an injection that induces insatiable hunger in a fish. On giving this injection, a fish of size x can eat another fish of smaller size y (y < x) and become a fish of size x + y retaining this hunger. An aquarium has a number of fishes of various sizes. The scientist introduces an injected fish into this aquarium with an objective that eventually only 1 fish remains. In order to achieve this, the scientist is allowed only two types of moves: either add a normal fish of any size or remove an existing normal fish from the aquarium. Given the sizes of other fishes in the aquarium and the size of injected fish, write a program to determine the minimum number of moves needed by the scientist to achieve his objective. For example, suppose there are 5 fishes in the aquarium, the injected fish is of size 10 and the other fishes are of sizes 9, 20, 25, and 100. To ensure that only 1 fish remains in the aquarium the scientist needs to remove the fish of size 100 and add a fish of size 3. So the output is 2. The sequence of steps is shown below. The sizes of fishes in the aquarium at each step are shown in curly braces. The highlighted number is the size of the injected fish.
avatar

Specialist Programmer

Interviewed at Infosys

3.6
Jul 16, 2021

An evil scientist has developed an injection that induces insatiable hunger in a fish. On giving this injection, a fish of size x can eat another fish of smaller size y (y < x) and become a fish of size x + y retaining this hunger. An aquarium has a number of fishes of various sizes. The scientist introduces an injected fish into this aquarium with an objective that eventually only 1 fish remains. In order to achieve this, the scientist is allowed only two types of moves: either add a normal fish of any size or remove an existing normal fish from the aquarium. Given the sizes of other fishes in the aquarium and the size of injected fish, write a program to determine the minimum number of moves needed by the scientist to achieve his objective. For example, suppose there are 5 fishes in the aquarium, the injected fish is of size 10 and the other fishes are of sizes 9, 20, 25, and 100. To ensure that only 1 fish remains in the aquarium the scientist needs to remove the fish of size 100 and add a fish of size 3. So the output is 2. The sequence of steps is shown below. The sizes of fishes in the aquarium at each step are shown in curly braces. The highlighted number is the size of the injected fish.

Offline Coding Round question: An array was given and if( a[i] + a[j] ) is prime then it is said to be bad pair. We need to subtract minimum no. of elements from a such that there should not be any bad pair and return the final total no. of elements present in a.
avatar

Specialist Programmer

Interviewed at Infosys

3.6
Sep 19, 2025

Offline Coding Round question: An array was given and if( a[i] + a[j] ) is prime then it is said to be bad pair. We need to subtract minimum no. of elements from a such that there should not be any bad pair and return the final total no. of elements present in a.

Viewing 211 - 220 interview questions

Glassdoor has 1,464 interview questions and reports from Software specialist interviews. Prepare for your interview. Get hired. Love your job.