## Software Engineer in Test Interview Questions

- 3of 3 votes
I recently, appeared for second phone interview with CloudEra, the interviewer asked me to

write a function which takes in an array of integers and returns the highest positive product

possible by multiplying 3 distinct numbers. NO SORTING is ALLOWED

PS: Please write a solution in JAVA or Python. (Not interviewer request)

example:

[1, 3, 5, 2, 8, 0, -1, 3]

=> 8 * 5 * 3 = 120

[0, -1, 3, 100, -70, -5]

=> -70*-50*100=350000

- 0of 0 votes
If you are told to test a requirement wchich you are not understanding then what will be your approach to analyze that requirement? How will you understand that requirement?

- -1of 1 vote
If are told to test a requirement and you are not able to understand that requirement then , what will you do to understanding a requirement? What will be your approach?

- 0of 0 votes
`Given the following directory structure: org | -- Robot.class | -- ex |-- Pet.class | |-- why |-- Dog.class And the following source file: class MyClass { Robot r; Pet p; Dog d; Which statement(s) must be added for the source file to compile? (Choose all that apply.) A. package org; B. import org.*; C. package org.*; D. package org.ex; E. import org.ex.*; F. package org.ex.why; G. package org.ex.why.Dog;`

- 0of 0 votes
You have a LinkList with each node having Next node and Other node and Data.

i.e. Class Node

{

Node Next;

Node Other;

int Data;

}

Next pointer always points to next node and Other node can point to any other node in the list or can be pointing to null/nothing or can point to self.

Write program to copy this link list to a new list with proper Next and Other pointers.

- 0of 0 votes
Design an LRU Cache with constant lookup, i.e, searching and updating should all happen in O(1) time. Assume a method of calculating the least recently used page is already given. Just implement the searching and updating logic which takes constant time.

- 0of 0 votes
If in a relation there are multiple duplicate rows . Your task is to delete one duplicate row.

a1 a2

1 3

1 3

2 4

3 5

3 5

3 5

after deletion

a1 a2

1 3

2 4

3 5

3 5

3

- 0of 0 votes
given a string determine which character appears the most and the number of times that character appeared.

- 0of 0 votes
Give this input: Sea!tle is a nice place. Work Hard! have Fun, make HIStory!

display this output using any C or vb script:

Seattle is a nice place.

Work hard.

Have fun.

Make history.

- 0of 0 votes
Given a sorted array with duplicates and a number, find the range in the

form of (startIndex, endIndex) of that number. For example,

find_range({0 2 3 3 3 10 10}, 3) should return (2,4).

find_range({0 2 3 3 3 10 10}, 6) should return (-1,-1).

The array and the number of duplicates can be large.

- 0of 0 votes
Implement a class that does string manipulation by overloading the following operators: <<, >>, = and ==. For example consider the following code:

StrShift example;

example = “Microsoft”;

printf(“\”example << 2\” results in %s\n“, example << 2);

In the above code the output would be “ftMicroso” which shows the last two characters of the string “Microsoft” rotated to the left of the string. Please note that state is maintained so two calls of example << 1 would give the same end result as calling example << 2 once.

- 1of 1 vote
3. Write a class that represents a minimal heap. The heap class should at a minimum support the following methods:

- AllocTinyHeap() which should initialize the heap with a given amount of bytes

- DeleteTinyHeap() which frees all memory associated with the heap

- TinyAlloc() which allocates a given number of bytes on the heap if there is room

- TinyFree() which frees a specific location on the heap

You may define whatever parameters are necessary for the above methods as well as write any additional methods. Overall consideration will be given to correctness, design, code readability as well as any unit testing done. As part of a final solution please submit test cases you used to verify correctness in addition to any unit tests done.

- 0of 0 votes
What are Unit and Integrationtesting.

- 0of 0 votes
WAP fibonoccaci series using recursion and after completion asked to to write using iteration.

write testcases for the above

- 0of 0 votes
how do you test elevator

- 0of 2 votes
Difference between blackbox and whitebox

- 0of 0 votes
This was asked to one of my friends in her telephonic interview with ADP.

Imagine you have a 5x5 matrix containing integers... If any of the elements in this original matrix is 0, then your resultant matrix should have the corresponding row and column filled with 0s. For e.g. if 1st element of 1st row, 2nd element of 2nd row......up to 5th element of 5th row are all 0s, then your resultant 5x5 matrix should be all 0s. Your code should be flexible and work for any size of matrix (not just with 5x5).

- 0of 0 votes
given 2 arrays wrds[] , chars[] as an input to a function such that

wrds[] = [ "abc" , "baa" , "caan" , "an" , "banc" ]

chars[] = [ "a" , "a" , "n" , "c" , "b"]

Function should return the longest word from words[] which can be constructed from the chars in chars[] array.

for above example - "caan" , "banc" should be returned

Note: Once a character in chars[] array is used, it cant be used again.

eg: words[] = [ "aat" ]

characters[] = [ "a" , "t" ]

then word "aat" can't be constructed, since we've only 1 "a" in chars[].

- 0of 0 votes
Forgot to add this question along with my previous...

This is a brain teaser type question...

S E N D

+

M O R E

--------------

M O N E Y

--------------

Each of the above characters hold a specific value which is unique (meaning no two characters have same value). Now the question is, to uncover what value each character stands for...

(Hint - 'M' has to be 1 because it's the carry in the result (M O N E Y). Now similarly back track the rest of the characters)

Note: this hint is given by me, for the sake of understanding the question for interested folks, it was not given to me in the interview).

- 0of 0 votes
Imagine we have a large string like this "ABCBAHELLOHOWRACECARAREYOUIAMAIDOINGGOOD" which contains multiple palindromes within it, like ABCBA, RACECAR, ARA, IAMAI etc... Now write a method which will accept this large string and return the largest palindrome from this string. If there are two palindromes which are of same size, it would be sufficient to just return any one of them.

- 0of 0 votes
First find out the number 1's in the binary digit of a given integer. Then find out an integer which is greater than the given integer and contains same number of binary 1's

- 3of 3 votes
Given a 2D array of 1 and 0, Find the largest rectangle (may not be square) which is made up of all 1 or 0.

- 0of 0 votes
How to find the adjacent elements of an single dimensional array whose difference is 1; What is the Time Complexity & Auxiliary Space you use ? What type of efficiency can be achieved?

- 0of 0 votes
How to sort an single dimensional array whose elements are {4,5,6,4,5,6}; What is the Time Complexity & Auxiliary Space you use ? What type of efficiency can be achieved?

- 0of 0 votes
WAP to check if a binary tree is balanced

- -1of 1 vote
which is the bestway to implement stack/queue (would you go for arrays/linkedlist/arraylist etc) explain pros and cons

- 0of 0 votes
Write a program to check if a binary tree is balanced

- 0of 0 votes
What is the best way to implement Stack/queue... (EX will you use array/linkedlist etc ) explain pros and cons.

- 0of 0 votes
Using the following function signature, write a C# function that prints out every combination of indices using Console.WriteLine() whose values add up to a specified sum, n. Values of 0 should be ignored.

public void PrintSumCombinations(List<int> numbers, int n);

• It’s okay to use additional private functions to implement the public function

• Be sure to print out the indices of numbers and not the values at those indices

• Don’t worry too much about memory or CPU optimization; focus on correctness

To help clarify the problem, calling the function with the following input:

List<int> numbers = new List<int> { 1, 1, 2, 2, 4 };

PrintSumCombinations(numbers, 4);

Should result in the following console output (the ordering of the different lines isn’t important and may vary by implementation):

0 1 2 (i.e. numbers[0] + numbers[1] + numbers[2] = 1 + 1 + 2 = 4)

0 1 3

2 3

4

- 0of 0 votes
Given two strings remove duplicates and test it