## sarath.chalasani46

BAN USER- 0of 0 votes

AnswersConsider an array A of N integers, only permitted operation in this array to reverse the subarray of any length, where the middle index of sub array and middle index of array a are equal. you need to find whether the given array can be sorted using multiple such reverse operations. if sorting is possiable print "Possible". "Not Possible" otherwise.

- sarath.chalasani46 in India

For example, if the given array is [1,6,3,4,5,2,7] then 2 reverse operations are needed to make this array sorted. first [3,4,5] is reversed to make [1,6,5,4,3,2,7], then [6,5,4,3,2] is reversed to make [1,2,3,4,5,6,7]. so "Possible" should be printed.

Input: first line contains a number N denotes the length of array, Next line contains N numbers separted by spaces.

output : "Possible" if sorting is possible, " Not Possible otherwise.| Report Duplicate | Flag | PURGE

ADP - 0of 0 votes

Answersa positive non reduceable fractions can be written has x/y where x,y are positive integers, find the count of non

- sarath.chalasani46 in India

reduceable fractions which is less than 1 for the given N where x,y <=N.

For example , if N=>4 then your output should be 5.

explanation : for N=4 the fractions can be formeted as fallows.

1/1,1/2,2/2,1/3,2/3,3/3,1/4,2/4,3/4,4/4

but 2/4 can be reduce to 1/2, also 1/1,2/2,3/3 and 4/4 is equal to 1, so we can elimi nate those fractions the list and we

have 5 non reduceable fractions whic is less than 1.

input : single number

out put : single number displayed the count of non reduceable fraction less than 1.| Report Duplicate | Flag | PURGE

ADP Developer Program Engineer - 0of 0 votes

AnswersWrite a java program:

- sarath.chalasani46 in India

There is plant species (say P) in a desert that has a specific living pattern. A rectangular

field of the land is divided into squara cell.The land will have R rows and C columns of the

cell.Each cell will be surrounded by up-to eight neighboring cells(note that the cells at the

edge of the field will have fewer then eight nuighboring cells). A cell can either be empty

(having no plant in it) or living(having a plant in it).A particular cell is said to have N

neighbors(1<N<8), if exactly N cells in the neighborhood have living plants.

the plants fallow a certain rules for survival.the rules are as fallows.

1) if a cell with plant s1 to s2 neighbors (1<=s1<=s2<=8), it survives to the next generation.

i.e. the plant dies if it has less than s1 neighbors or more than s2 neighbors.

2) If an empty cell has B1 to B2 neidhbors (1<=B1<=B2<=8), a new plant takes birth in that cell

in the next generation.

Input Specification:

theinput will have two arrays, as fallows

1)An integer array: {R,C,S1,S2,B1,B2,G}

where R and C specify size of the field in row and columns respectively, with 1<=R<=2000 and

1<=C<=2000 s1,s2,B1 and B2 are integers as explained in the survival rules. G is the number of

generations for wich the simulation has to be run.

2)An integer array specifying intial state of the field: size of the array will be R*c

the data will be expressed in the array as fallows:{E11,E12,E1c,E21,....,E2C,ER1,ERC} where Eij

is cell in the field at ith row and jth column. Eij can have value 0 or 1. 0 corresponds to

empty cell and 1 corresponds to living cell.

output specification:

output will be an integer array specifying state of the field at the end of the simulation in

the same manner as in input.

Examples:

Example 1:

input1: {3,4,2,3,3,3,3}

input2: {0,1,0,0,0,1,1,0,1,0,1,0}

output : {0,1,1,1,0,0,0,1,0,0,1,0}

Example 2:

input1: {3,4,2,3,3,3,4}

input2: {0,1,0,0,0,1,1,0,1,0,1,0}

output: {0,0,1,1,0,1,0,1,0,0,0,0}

Method Signature:

public static int[] survivalcells( int[] input1,int input2){

}| Report Duplicate | Flag | PURGE

ADP abc - 0of 0 votes

Answersyou are given an MxN matric.Every cell of the matrix has a cost associated. initially you are at(0,0) and you have to reach (M-1,N-1). Question is to find the minimum cost path from (0,0) to (M-1,N-1) and also the minimum cost. From a cell you can only make a move to right cell or down cell or diagonally lower cell.

- sarath.chalasani46 in India

Input Specification:

Input1: A string array containing rows of the cost matrix as element.

input2: An integer having number of rows in the cost matrix.

For above example, the matrix would be {5#7#2#4,1#8#1#3,6#2#9#5,1#6#2#8} and number of rows would be 4.

output Specification:

The output will be a string containing minimum cost and the path chosen separated by the comma.

For Example , Given the cost matrix

5 7 2 4

1 8 1 3

6 2 9 5

1 6 2 8

1) minimum cost value is 5+1+2+2+8=18

2) minimum cost path from (0,0,) to (M-1,N-1) is BDDR

B- for down move

D- Diagonal Move

R- Right move

NA- No solution

Hence your output will be 18,BDDR

method signature:

public static String minimumCost(String[] input1, int input2) {

}| Report Duplicate | Flag | PURGE

ADP abc - 1of 1 vote

AnswersNeed Java Program :

- sarath.chalasani46 in India

A rectangular plot comprising n*m block ( cement block in shape of a cube) were kept, one block per each cell. the base of

each block covers one cell completely and its surface is equals to one square meter. cube on adjacent cell are so close

that there are no gaps between them.due to a heavy rain on the constuction, water is accumulated in the gaps created

between a group of blocks due to the difference in their heights.

write a program to calculate the volume of water accumulated between the blocks on the constrution.

Input Specifications:

your function must read three arguments i.e plot_length,plot_breadth and block_height

where

- Plot_length (r) : provides the length of each rectangular plot in metres.

- Plot_breadth (c) : provides the breadth of each rectangular plot in metres.

- Block_height(int array) : provides the height of r*c blocks row-wise.

Constraints

1<=plot_length,plot_breadth,block_height<=10

Output Specifications:

output will be an integer that will depict the volume of water (in cubic metres) accumulated in the puddles due to the

difference in heights of block.

Examples:

Example 1:

input1 =3

input2=6

input3={3,3,4,4,4,2,3,1,3,2,1,4,7,3,1,6,4,1}

output: 5

Example 2:

input1 =6

input2=3

input3={3,3,7,3,1,3,4,3,1,4,2,6,4,1,4,2,4,1}

output: 5| Report Duplicate | Flag | PURGE

ADP Applications Developer - 0of 0 votes

AnswersNeed Java code:

- sarath.chalasani46 in India

In a Multinational company employees are ordered to seat according to their height in a line. they always choose their

positions randomly to displeasure their manager. one evening, the employee learn that their strict manager has secretly

recorded their seating positions from that morning, and that he will be checking their positions in the next moning to

make sure they are exactly the same.

Each employee only remember one thing from that morning: the number of people to his left that were teller then him.

there are N employees, each with a different height between 1 to n. using this information you must reconstruct the

seating arrangement from that morning.

you are given a int[], the ith element of which represents the number of taller employees to the left of the employee with

height i (where i is a 1-based index). Return a int[] containing the heights of the employees from left to right in the line.

Note: The input is guaranteed to produce a valid and unique output.

Inputs Specifications:

your function should accept the fallowing inputs:

Input 1: N

Input 2: An array(left[]) of n integers

Output Specifications:

you need to return the int [] containing the heights of the employees from left to right in the line.

Example :

Input:

input 1: 4

input 2: {2,1,1,0}

Output: {4,2,1,3}

Explanation:

Employee of height 1 remembered there were 2 employees taller than him to his left.

Employee of height 2 remembered there were 1 employees taller than him to his left.

Employee of height 3 remembered there were 1 employees taller than him to his left.

Employee of height 4 remembered there were no employees taller than him to his left.

the orginal order from left to right must have been 4,2,13.

this ordering satisfies all four conditions.

For example, there are exactly two employees to the left of the employees with height 1 that are taller then him(heights 4

and 2). A different ordering,like 4,3,1,2, satisfies some, but not all of the four conditions. in this incorrect ordering, there

are two employees to the left of employee with height 2 that are taller then him(height 4 and 3), but input states that

there was only one.| Report Duplicate | Flag | PURGE

ADP Applications Developer - 0of 0 votes

AnswersThere are N friends sitting in a circle, they are numbered clockwise 1 to N. Game starts with

- sarath.chalasani46 in India

player 1 receiving the ball. A player needs to pass the ball to other player based on some

conditions.

1. if he is receiving ball for pth time,he passes that ball to persion L places to left if P is even

or L places right if P is odd.

2. if any player receives the ball M times then game is over.

Eample :

Input 1(N):5

Input 1(M):3

Input 1(L):2

Output: 10

Explanation:

First player 1 gets tha ball. since he has held the ball 1 time , he passes the ball to player 4,

who is two places to his right. this is player 4 first time holding the ball, so he gives it to

player 2, who passes it to player 5. player 5 then passes the ball to player3. who passes it

back to player 1.since player 1 has now held the ball 2 times, hepasses it to player 3, who

passes it to player 5, who then passes the ball to player 2. finally, player 2 passes the ball to

player 4, who then passes it to player 1. player 1 has now held the ball 3 times, and the game

ends.| Report Duplicate | Flag | PURGE

ADP abc - 0of 0 votes

Answerswrite a java program for below question.

- sarath.chalasani46 in United States

suppose john has been give task of monitoring a radio which is jumping to random frequency on a hourly basis. joha has to find the maximum positive frequency difference of that radio in at most two selections.

examples :

1. suppose radio is tuned to 91MHz to 98MHz and then to 95MHZ.

In first tunning Df= f2-f1 =98-91=7 (positive frequency diff)

In second tunning Df= f2-f1 =95-98=-3 (negative frequency diff)

2. Input1: {2,30,15,10,8,25,80}

input2: 7

output:100

To have maximum frequency diff with at most two selections. john has to select 2MHZ and he has to drop it to 30MHZ and second selection, he has to pick 8MHz to 80Mhz.

so output is 28+72=100

Java method signature :

public static int maximumPositiveFrequency(int[] input1,int input2)

{

}| Report Duplicate | Flag | PURGE

ADP Developer Program Engineer - 0of 0 votes

Answerssuppose john has been give task of monitoring a radio which is jumping to random frequency on a hourly basis. joha has to find the maximum positive frequency difference of that radio in at most two selections.

- sarath.chalasani46 in India

examples :

1. suppose radio is tuned to 91MHz to 98MHz and then to 95MHZ.

In first tunning Df= f2-f1 =98-91=7 (positive frequency diff)

In second tunning Df= f2-f1 =95-98=-3 (negative frequency diff)

2. Input1: {,30,15,10,8,25,80}

input2: 7

output:100

To have maximum frequency diff with at most two selections. john has to select 2MHZ and he has to drop it to 30MHZ and second selection, he has to pick 8MHz to 80Mhz.

so output is 28+72=100| Report Duplicate | Flag | PURGE

ADP Developer Program Engineer - -1of 1 vote

Answersconsider a battlefield to be made up of square cells of unit dimensions. a soldier on the battlefield can move from a cell to all(8) of it's neighboring cells. soldier has a gun with with him which he can shoot the targets up to any distance along any of the 8 possible directions (north,east,west,south,north-east,north- west,south- east,south- west). also some sell are bulletproof which prevents bullets to pass but soldier can walk over them as if it were a normal cell.he can destroy the target from a bulletproof cell but not from a cell behind it.

- sarath.chalasani46 in India for dev

position of a target/ soldier can be given by the cell, they are on.given the position of the target, starting position of a target and position of all the bullet proof cells. you have to tell the position of closest shooting point i.e the cell from which, the soldier can shoot the target and is closest to the starting position of the soldier. if there are more than such cells, output all of them.

Input/output specifications :

Input specifications :

I) size of the battlefield { integer pair (N,M) : battlefield will be of N*M size )

II) staring position of the soldier {integer pair (i,j)}

III) position of the target {integer pair (x,y) : position of the cell on which target is mounted}

IV) position of the all bullet proof cells { list of integer pair a#b : each element in the list is a position of bullet proof cells }

output specifications :

sequential list of integer pair i#j (cell) that are closest shoot points and must fallow row wise traversal.

Note: if the output list contains four shoot points : (2,1), (1,2), (3,2), (2,4) on a 4x4 battle field.

then the correct output will be {1#2,2#1,2#4,3#2} not {1#2,2#1,3#2,2#4}

Examples:

Input : {2,2} {2,1} {2,2} {1#1,1#2}

output : 2#1

below is the method signature in java:

public static String[] nearest_shoot_point(int[] input1,int[] input2,int[] input3String[] input4){

}| Report Duplicate | Flag | PURGE

Amazon Developer Program Engineer Java

RepEarned praise for analyzing acne for the government. Earned praised for my work implementing mantra to get desired husband in ...

Rep**JohnMThomaa**, Systems Design Engineer at USAAManaged a small team writing about dust in Minneapolis, MN. Spent high school summers marketing Online vacuum pump sale New ...

Rep**ShaneMMullen**, SEO at IIT-DAre you facing love life and married life problem. Contact vashikaran specialist right now. He will guide your solution with ...

Rep**Edwin Adcox**, Dev Lead at Advisory Board CompanyWelcome to the best and certified exotic car rental company of USA. Here, at Prestige luxury Rentals, we offer the ...

Rep**HazelMiller**, Site Reliability Engineer at Delve NetworksHazel Miller has been a stalwart advocate for sound public policy that advances the jobs creating potential of America’s ...

RepHad a brief career donating velcro in Africa. Spent several years training sock monkeys in Pensacola, FL. Gifted in working ...

RepNY Vape Shop is the most popular Vaporizer Store for new trend vaporizer pen and all related accessories. We are ...

RepBlack magic mantra is simple and easy mantra. Call our specialist today for advice on black magic mantra to kill ...

Rep**suganpdhchejara921**, Problem Setter at TPAre you facing love life and married life problem. Contact vashikaran specialist right now. He will guide your solution with ...

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window