## Developer Program Engineer Interview Questions

- 0of 0 votes
There is an interesting game named one person game. It is played via a m*n grids. There is an non-negative integer in each grid. At first your score is 0. You cannot enter a grid with integer 0. You can start and end the game at any grid you want (of course the number in the grid cannot be 0). At each step you can go up, down,left and right to the adjacent grid. The score you can get at last is the sum of the grids on your path. But you can enter each grid at most once.

The aim of the game is to get your score as high as possible.

Input:

The first line of input is an integer T the number of test cases. The first line of each test case is a single line containing 2 integers m and n which is the number of rows and columns of the grids. Each of next the m lines contains n space-separated integers D indicating the number in the correspoding grid

Output:

For each test case output an integer in a single line which is maximum score you can get at last.

Constraints:

T is less than 7.

D is less than 60001.

m and n are less than 8.

Sample Input:

4

1 1

5911

1 2

10832 0

1 1

0

4 1

0

8955

0

11493

Sample Output:

5911

10832

0

11493

- -2of 2 votes
c

- 0of 0 votes
How to design three stacks using one array ?

Also,Is there any option by which you can delete questions submitted by you ? Please let me know.

- 0of 0 votes
write a pseudo code to calculate

func(n) = 2*(func(n-1)+func(n-2)) in log(n) complexity.

Given:.func(1) = 1;func(2) = 3

- 0of 0 votes
Write pseudo code for Optimal game stratagy:

You have X amount with you, and 2N cards (N - winning cards, and N-loosing cards).

you have to play all the cards.

all cards are well shuffled, and one card is drawn randomly for each time.

if you pic one card means, next time you have to take one card from rest of the cards, i.e at last of the game you will left with one card.

If you bet 100 rupees,

If you got winning card ===> then you will get 200 rupees,

If you got a loosing card ====> then you will loose all your betting amount.i.e 100 rupees in this case.

You need to play all the cards. (I solved it.)

He asked me to solve it, with card replacement, i.e every time one card is drawn from 2N CARDS.

- 0of 0 votes
travel the tree vertically like

2

3 4

5 6 7 8

output:5 3 2 6 7 4 8

- 0of 0 votes
Write the code for mutex in c that is threadsafe

- 0of 0 votes
There is a stream of numbers and you need to find the maximum k numbers at any instant when minimum of k numbers have passed.

- 0of 0 votes
Prove that addition of consecutive odd numbers from 1 will result in number that is the square of the count of numbers added.

e.g. 1+3+5 = 9 here count is 3 and the sum is 3^2 = 9

Give a mathematical proof

- 0of 0 votes
Write a code to in place sort the strings of the type "s1d3b2m0" to "sdbm1320". Solution must be of O(n) without the use of extra space. At max one temp variable could be used.

- 0of 0 votes
What is MVC model.

- 0of 0 votes
How is Java different from javascript.

- 0of 0 votes
Divide a trapezium in 4 equal parts

- 0of 0 votes
There are two person A with Lock L1 and B with Lock L2 and a messenger M two send the box from one end to another. How to send the box so that M can never open the box.

- 0of 0 votes
What is the difference between a programming and scripting language.

- 0of 0 votes
There is an ant in a cube placed at one corner and you need to find the shortest path to the diagonally opposite corner. The ant can not fly tht is obvious.

- 0of 0 votes
Questions on Unions and its initialization and its memory usage.

- 0of 0 votes
How to implement classes in C

- 0of 0 votes
There is a channel which can send and receive signals and there is a sender and receiver. Sender can only send and receiver can only receive the message. Design classes for all three with the restrictions.

- 0of 0 votes
Design a base class that is uncopyable(need to take care of the = operator)

- 0of 0 votes
Questions on virtual methods and inheritence and C++

- 0of 0 votes
A stream of bits is passing, at any instance tell whether it is divisible by 3 or not.

- 0of 0 votes
atoi() implementation.

- 0of 0 votes
There are coins of 25 10 5 and 1 Rs. You got to tell in how many ways you can make change for an amount X. A working code was required,

- 0of 0 votes
Find the first character in the given string that is non repeating --- O(n) solution expected

- 0of 0 votes
Delete a node in Lined List

- 0of 0 votes
Level Order traversal in BST

- 0of 0 votes
Print the path whose some is S

- 0of 0 votes
Depth of BST.

- 0of 0 votes
Will this piece of Java code work:

class T {

public static void main(String args[]){

Object myObject = new Object();

synchronized(myObject){

myObject = new Object();

} //end sync

}

}