## Developer Program Engineer Interview Questions

- 0of 0 votes
RSpec's stub method can be used to override a method call on

an instance only

a class only

an instance or a class only

any Ruby object

- 0of 0 votes
Sally wants to create a dating website and decides to write an algorithm that takes a list of male and female users' preferences and returns the best matching of males with females. To test her algorithm, she manually calculates the best match. She then runs the algorithm and checks to see if the observed output matches with her manual calculation. What FIRST principle is clearly not being followed?

Fast

Independent

Repeatable

Self-checking

Timely

- 0of 0 votes
High coverage can always be achieved by writing a unit test for every method.

True

False

- 0of 0 votes
For a given array size is know but elements using index is not accessible. 2 given functions are below:

1. getIndexOfNthLargest(int n) // returns the index of nth largest number. Like for n=1 the index of largest element will be returned, for n=2 the index of 2nd largest number will be returned.

2. reverseArray(int i) // reverse the elements of the array from index 0 to i

How to sort the array in place?

- 0of 0 votes
If there are two threads in your app - T1 and T2. T2 has high priority. However, for some reason the priority decreases automatically. What could be the reason? How will you debug it? How will you fix it so that pririty stays the same, no matter what.

- 0of 0 votes
Given an array { -2 3 5 0 -3 7 -1}. Sort the array in such a way that array should contain -ve numbers first and then zero and then all +ve numbers. (Note: order of +ve number and order of -ve numbers should be same after sorting). For ex: the o/p of above array is {-2 -3 -1 0 3 5 7}

- 0of 2 votes
Given 3 sorted arrays. Find(x,y,z), (where x is from 1st array, y is from 2nd array, and z is from 3rd array), such that Max(x,y,z) - Min(x,y,z) is minimum.

- 0of 0 votes
If we have given a data type, how can we find the precision value for this........need just an algo....

- 0of 0 votes
Write an algorithm that takes a file containing a sequence of lines representing all the folders in a mailbox where each line is of the form Id,ParentId,Name and produces a sorted hierarchy of folders with children indented from their parents and each line containing DisplayName:Id. For example if the input is:

4,17,Scott

1,0,Spock

17,0,McCoy

9,17,Kirk

Then the output should be:

McCoy:17

Kirk:9

Scott:4

Spock:1

- -1of 1 vote
what is diffarence between semop and semctl?

we can change the semaphores using both apis?what is the diffarence?

- 0of 0 votes
double factorial of a number N

example: N!!

- -1of 1 vote
1)find first N factorial primes (not prime factorials)

- -1of 1 vote
write efficient program to find the sum of x^y + y^ and x^y - y^x and x^y/y^x and x^y*y^x

- 0of 0 votes
Given an array A of size 26*26. Determine whether each row and column of the array consists of set {a,b,c,d,.....z} where each element occurs exactly once

- 0of 0 votes
The shortest code by character count that takes a single input integer N (N >= 3) and returns an array of indices that when iterated would traverse an NxN matrix according to the JPEG "zigzag" scan pattern.

For Ex`1 2 3 (Input) 3 --> 4 5 6 --> 7 8 9 Output--> 1 2 4 7 5 3 6 8 9 1 2 3 4 (Input) 4 --> 5 6 7 8 9 10 11 12 13 14 15 16 output 1 2 5 9 6 3 4 7 10 13 14 11 8 12 15 16`

- 0of 0 votes
how many times the base class are called in the following code.

`class Base { } class D1:public Base { } class D2:virtual public Base { } class DD: public D1, public D2 { } int main() { DD cObj; }`

- -2of 2 votes
For Winshuttle Written Test Search on YouTube:

Winshuttle Placement Paper

- 0of 0 votes
how to sort 100 numbers given using memory size sufficient for 20 elements only(like array of size 20)

- 0of 0 votes
how to convert an english sentence into our native language sentence(given an dictionary of english-native language)..what data structures will be used for implementing dictionary and how to convert using it??

- 0of 0 votes
You are blindfolded and 20 coins are placed on the table in front of you. Out of them 10 coins have heads facing up and other tails. You are allowed to flip and move the coins. You should divide those coins into two sets such that one set contains 10 heads and other tails. You are allowed to only move or flip the coins

- 0of 0 votes
How to count the number of ones in the a number's representation. If the number is too large and how would you speeden up using parallel processing or any other technique?

- 0of 0 votes
Remove whitespace characters in a string, in place and with out shifting

- 0of 0 votes
That you are given 4 identical tablets. Of which 2 are for cold and 2 for headache. 100mg each. All the tablets look the same. You have a patient and you have to provide him with the medicine. You must give him one tablet for cold and one for headache. But you do not know which one is for cold and which one for the headache. So how will you give it to him. If he has more than 100mg of a specific medicine he'll die.

- 0of 0 votes
There are two very large arrays. Write a program to take their union in a Java Set in a time efficient way.

- 0of 0 votes
Given any five random points on a integer grid, prove that the mid-point of at least one pair lies on the grid.

- 0of 0 votes
You are given a graph-tree kind of Data structure such that it has no cylces( can also think of it as a n-ary tree). It is a undirected graph. You have to find out the node which, if taken as root, would result in making height of every node as min.( Or you can say it will be balanced)

- 0of 0 votes
You are blindfolded and placed in front a table with two jars. One jar has 50 red balls and other has 50 blue balls. What should be your strategy so that you pick up the red ball with more than 50% probability.

- 0of 0 votes
When singleton wont work as singleton??

- 0of 0 votes
What is a weakHashMap??weak References??

xplain with example

- 0of 0 votes
What is a Executer in threads??