Software Engineer in Test Interview Questions
0of 0 votesWrite a function to evaluate a string that has only integers, and operators '+' & '*'. The evaluation should be done in a single pass. For example passing "3*2+5*6" should result in this function returning 36.
0of 0 votesWrite a function fix a loop in the linked list based on the assumption that the linked list is sorted.
0of 0 votesHow would you find if a linked list has a loop? How would you do it without using additional memory, if the linked list is sorted.
0of 0 votesWrite a function to find a key in Hash map if the value associated to that key is given as input. As a followup, swap key & value assuming that value is not equal to any of the existing keys.
0of 0 votesWrite a function to perform string replace without using any inbuilt functions.
0of 0 votesCode to check if a given short string is a substring of a main string. Can you get a linear solution (O(n)) if possible?
-1of 1 voteWhat is system.gc() and runtime.gc() ?
1of 1 voteWhich will take less time to retrieve the data if numbers are present in hashmap and sorted array .
0of 0 votesAn array of zero and non zero integer are their having range 10000 (i.e length of array is 10,000)
Arrange the array in such a way that zero comes first and after that the non zero integer.
1of 1 voteFind duplicates in infinite range .
Which data structure to be used to give efficient solution.?
I answered HashMap .
How to implement using boolean array.?
0of 0 votesPlease consider the following tables:
Code:
Table Name: Person
Person_Id Name
Table Name: DVD
DVD_ID Owner_ID Title
Here is the query:
Write a query that returns the list of DVDs that belong to owners who own “Superman”
Here is my solution:
Code:
SELECT p.name,d.dvd_id
FROM DVD d,Person p
WHERE p.person_id = d.dvd_id
AND Title = 'Superman' ;
I answered above answer. But interviewer was expecting me to do using Subquery. Is that possible?Please let me know if the above query is correct or not.
0of 0 votesHow to write test data for a vendor machine using this coins (50 paise, 1 rupee coin, 2 rupee coin, 5 rupee coin, 10 rupee coin) to get (Tea, Coffee, Ice Tea, Cold Coffee, Milk)
Concept Is
Tea - 50 paise coin
Coffee - 1 rupee coin
Ice Tea - 2 rupee coin
Cold Coffee - 5 rupee coin
Milk - 10 rupee coin
0of 0 votesIf a function is der mostCommonChar(String str, int num) ,
1-.First input is Aabra Ka Daabra and second argument is 1 then the function should return first most repeated character in the string .Means in sorted descending .
2-> First input is Aabra Ka Daabra and second argument is 2
then the function should return second most repeated character in the string
like wise 3rd 4rth ....etc
0of 0 votesA video streaming server is generating the following data. Find the potential customers facing buffering issues.
A person is said to face buffering issues when he hits the play button multiple times on the same video
You are given a huge file (say 1GB) that contains the following data:
CustomerId-TimeStamp-Event-VideoId-Videolength
0040 -01.00pm -Play -Video1 -02:30:00
Write code for this. What data structure will you use
He also said, lets say all the parsing is taken care of and you are given a collection of classes that contain the above data:Class { CustomerId TimeStamp Event VideoId }
0of 0 votesDesign an online hotel reservation system.
(I think this has been posted in Careercup earlier)
0of 0 votesDesign a furniture store with Tables and chairs. Write a constructor for chair and table
1of 1 voteYou are given a UNIX path with dot (current) and two dots (parent). Convert this to an absolute path
E.g. $/home/abc/.././def/./ghi/../.
becomes $/home/ghi/
0of 0 votes//Q. Given an array of integers,write a function that retrieves unique instances of any duplicates, returning them in a //new array -
// [2,1,2,4,3,1,5,1]
//= [2,1]
// [1,1,1,1,1,1,1,1,1]
// =[1]
// Write test cases for this function
0of 0 votesIn a shop, product X is available in different quantities q1,q2,q3...... with price tags p1,p2,p3,...
wap to purchase X of quantity Q such that total price is less and also number of baggage is less
*Consider the cost to be optimum than baggage.
(Sorry the trouble guys, I have edited the ques here)
0of 0 votesWap to find kth largest element in a binary search tree
0of 0 votesGiven a binary tree convert it to doubly linked list, with left pointer of binary tree as prev pointer of doubly linked list and right pointer of binary tree as next pointer of doubly linked list.
Example:
Input:
Binary tree with
A as root
B left of A
C right of A
B&C have no children
Output:
B->A->C->null
null<-B<-A<-C
1of 1 voteGiven a linked list, print n nodes from tail of the list in reverse order
Example:
1->2->3->4->5->6->7->8->9->10
Output:
n=3
10->9->8
0of 0 votesThere is a SRT file having timestamp and dialogue .
eg . hh:mm:ss , dialogue .
Suppose the movie runs ahead of dialogue . How or what will the approach to make it equivalent with the movie running .
For eg : The movie time is 02: 58:59 and the dialogue is 5 sec delayed.
-1of 1 voteThere are 10 balls .Determine the faulty ball in minimum steps
0of 2 votesfind a pattern in byte array and change that pattern in place (do not use temp array or variable)
for example, find pattern 0,0,3 in an byte array and replace it with 0,0
should be o(n)
my solutions :Byte*remPattern003(byte arr[] , int &size) //size is input and output variable ///outputs size of output array { int k = 0; for(int i=0;i<size;) { if(arr[i] == 0 && arr[i+1] == 0 && arr[i+2] == 3) { arr[k++]=arr[i]; arr[k++]=arr[i+1]; arr[k]=arr[i+3]; i+=3; } else arr[k++]=arr[i++]; } size= k; return arr; }
2of 2 votesConsider a city (visualize a circle). It has n petrol stations in it. You are given the maximum amount of petrol that can be filled at each of these stations. You are also given the distance between one station to the next one. The aim is to cover the entire city and come back to the start point. Assume that 1 liter of petrol will last for 1km.
Q: List out all the possible petrol stations from where the journey can be started, so as to cover the city.
5of 7 votesYou are given an integer array, where all numbers except for TWO numbers appear even number of times.
Q: Find out the two numbers which appear odd number of times.
0of 0 votesHow to check if a binary tree is a binary search tree?
0of 0 votesWrite a program in C to read all the characters from standard input and output the reverse when the user presses enter key.
0of 0 votesWrite a program in C to do run length encoding of an string in place. Desired space complexity O(1).
