## Developer Program Engineer Interview Questions

- 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

}

}

- 0of 0 votes
How do you identify which process has crashed in customer env, if there are multiple process crash at same time.

- 0of 0 votes
Lunatic server solution got a project in which they have to make a intranet web campus.

so entry for software developer , company make this problem.

solution must be in java.

Consider a university having a very big campus spread in acres of land. The university is undergoing

computerization. All the departments (at-most 50) are to be connected to form the intranet of the university.

You have to write a program, implementing Prims algorithm, which will suggest the network topology and

also minimise the total length of cable for connecting all the departments. Input to the program will be

names of all the departments and straight line distances between the departments (Only those pairs of

departments between which cable can be laid will be given). Output of the program should be the minimum

length of the cable required.

Input specifications

The first line will contain 2 natural numbers, N and M, separated by a blank space. N indicated the number

of departments in the university and M indicates the number of pairs of departments where the cables can be

laid. The following M lines will specify the distances between M pairs of departments as

dept1 dept2 distance

Where dept1 and dept2 are names of the departments (maximum 20 characters) and distance is a positive

integer (>0). Assume that the given distances between each pairs of departments will be unique and these M

lines will contain atleast one pair for each department.

Output specifications

The first line of the output will be names of the departments as they are included in the solution separated by

blank space. If two or more departments are included at a time then their names should be printed in the

alphabetic order. The next line will be the minimum length of cable required to form the intranet, terminated

with a new line character.

Sample Input/Output

input

7 10

physics chemistry 8

biology physics 9

biology office 15

chemistry office 4

chemistry sanskrit 5

sanskrit office 7

english office 16

english sanskrit 19

english cs 12

sanskrit cs 6

output

chemistry office sanskrit cs physics biology english

44

Hint : a simple prim's algorithm is implemented.