xyz Interview Questions
- 0of 0 votes
AnswersJSON PARSING ( Print all the data from a Json String).
- keerthanabharani95 August 26, 2016 in India
Input : {'firstname' : 'abc'}
Output : firstname -> abc
Input : {'firstname' : 'abc', 'lastname' : 'Lincoln'}
Output : firstname -> abc lastname -> Lincoln
Input : {'address' : '365 KG', 'lastname' : 'Lincoln'}
Output : address -> 365 KG lastname -> Lincoln
Ideally, you must parse the JSON string into a map data, and then print out the elements of the map. Among other things, it will help print out the data in alphabetical order as well.| Report Duplicate | Flag | PURGE
xyz - 0of 0 votes
AnswersFind number of islands of '1' in D dimensional array containing '0', '1'. where D > 2.
- prakhar.asthana04 May 24, 2016 in United States| Report Duplicate | Flag | PURGE
xyz SDE-2 Algorithm - 0of 0 votes
AnswersHow can save money, while moving?
- bull18moversbne May 19, 2016 in United States| Report Duplicate | Flag | PURGE
xyz Moving Company - 0of 0 votes
AnswerI run ansible, but the remote machine suddenly down at the middle of the proccess? How do I fix it?
- maestrofx March 18, 2016 in United States| Report Duplicate | Flag | PURGE
xyz Site Reliability Engineer config management - 0of 0 votes
AnswersRunning ansible with my own script (say 1.0). But, for a month later, I've updated the ansible scripts more and more. And the remote machine need to orchestrate even provision again. How do I know that I can rollback to the state of ansible script version I used?
- maestrofx March 18, 2016 in United States| Report Duplicate | Flag | PURGE
xyz Site Reliability Engineer config management - 0of 0 votes
AnswerAn Integer array is given,
- chjit99 February 08, 2016 in India
Find the combination of number in the array which satisfies the equation: a to the power b= c.
A number should not be repeated in multiple combination.
1. a and b are adjacent no. in the array.c can be any where in the array.
2.No other array or data structure can be used. However modification of current array is possible.
Define a function which will take array as input and generate a output array (a modification of input array).
Example: Input array: 1 2 3 8 5
out put: 2 3 8 0 0| Report Duplicate | Flag | PURGE
xyz Software Developer - 0of 0 votes
AnswersGiven a binary tree, we are supposed to find nth smallest element.
- nick.dom1519 February 06, 2016 in India| Report Duplicate | Flag | PURGE
xyz abc Algorithm - 0of 0 votes
AnswersYou have table defining meta data for all tables in your system
- abc006 January 22, 2016 in United States for NA
col name | table name | primary key| foreign key|
design a algorithm to generate sql dynamically based on column selection.| Report Duplicate | Flag | PURGE
xyz Backend Developer Algorithm - 0of 0 votes
AnswersWrite a function that will operate on a C-string and convert all instances of "AB" to "C" without using a second string for temporary storage. Use the following function signature:
- bradpitt119 December 15, 2015 in United States
void translate(char *str)
So for example:
char astring[] = "helloABworld";
translate(astring);
// Now astring holds "helloCworld";
Your function should handle strings of arbitrary length.| Report Duplicate | Flag | PURGE
N/A xyz C - 0of 0 votes
AnswersWhat is the maximum leads that can be generated from ad budget of 30k. Below is the table provided:
- Prasad90 December 14, 2015 in Singapore
Budget 10000 20000 30000 40000 50000
Display Leads 500 1000 1200 1500 1700
SEO Leads 1000 1500 1700 1900 2500| Report Duplicate | Flag | PURGE
Komli Media xyz Algorithm - 1of 1 vote
AnswersWAP in java to find duplicate element in array in one scan.
- swapbhikule83 November 29, 2015 in India| Report Duplicate | Flag | PURGE
xyz Java Developer Arrays - 0of 2 votes
AnswersThe "Island Count" Problem
- rasmiranjanbabu November 10, 2015 in United States
Given a 2D matrix M, filled with either 0s or 1s, count the number of islands of 1s in M.
An island is a group of adjacent values that are all 1s. Every cell in M can be adjacent to the 4 cells that are next to it on the same row or column.
Explain and code the most efficient solution possible and analyze its runtime complexity.
Example: the matrix below has 6 islands:
0 1 0 1 0
0 0 1 1 1
1 0 0 1 0
0 1 1 0 0
1 0 1 0 1| Report Duplicate | Flag | PURGE
unknown xyz Algorithm - 0of 0 votes
AnswersGiven an array of both positive and negative integers , find all pairs whose sum is equal to zero.
- sudhiaithal October 30, 2015 in United States| Report Duplicate | Flag | PURGE
xyz Software Engineer Algorithm Arrays - 0of 0 votes
AnswersCount the Mines Problem:
- jsduder October 19, 2015 in United States
Your program will first read an integer N from stdin.
Then it will then read N lines of N integers separated by spaces.
Each integer in this Grid will be either 1 or 0.
The program then outputs an N x N Grid where each Grid element represents the number of 1's surrounding that element, (excluding the element itself).
For (column, row) = (0, 0), surrounding element indices are (0,1) (1,0) and (1,1).
Similarly for (1,1), surrounding element indices are (0,0) (0,1) (0,2) (1,0) (1,2) (2,0) (2,1) and (2,2).
Constraints:
Your output lines should not have any trailing or leading white space
Maximum Dimension of Grid = 1000 x 1000
Example Input:
"3 0 1 0 0 0 0 1 0 0"
Expected output:
1 0 1
2 2 1
0 1 0| Report Duplicate | Flag | PURGE
xyz Software Developer Algorithm - 0of 0 votes
AnswersGmail Password Recovery Phone Number Helpline Support.?
- alliabrown99 September 29, 2015 in United States| Report Duplicate | Flag | PURGE
xyz Android test engineer - 1of 1 vote
AnswersThere are three closed doors. Behind two of them there are donkeys, behind the third one there is a Mercedes-Benz. (Your task is to get the Mercedes, not the donkey).
- leonid.ge July 31, 2015 in United States
You are asked to choose one of the doors. Once you have chosen, they open one of the remaining two doors with the donkey. Now there are two doors left: one you chose and the other one. To maximize your chance of getting the Mercedes, should you keep your choice or switch to the other door?| Report Duplicate | Flag | PURGE
xyz Software Developer Brain Teasers - 0of 0 votes
AnswersThis is to inform u that i am learner of Multi-threading. I recently completed Synchronized method concept.Every thing is clear but i am not able to get working of Synchronized block. it seems that their are three scenario in Synchronized block . Out of three, I able to get something about first 2 but the last one is very difficult for me to understand. Plz explain "object" in arg.:
"synchronized (object){//write code here}"
- needforeducation2000 July 31, 2015 in Indiasynchronized (this) { //write code here } synchronized (Myclass.class) { //write code here } synchronized (object) { //write code here }
| Report Duplicate | Flag | PURGE
tk xyz - 0of 0 votes
Answersgiven an array with elements check if just by exchanging two elements of the array we get a sorted array.
- venuskoti June 10, 2015 in India for xyz| Report Duplicate | Flag | PURGE
xyz Developer Program Engineer Arrays - 0of 0 votes
AnswersConstruct two threads in a program and execute them one after another. Write thread writes the data in a buffer and reader thread reads the data of previous thread from the buffer. Before execution of threads, user has to provide the string of 10 words the writer thread reads data from the string and write one word in the buffer. The reader thread reads the word from the buffer and displays it on screen.
- khadijayazdan May 30, 2015 in pakistan| Report Duplicate | Flag | PURGE
xyz xyz - 0of 0 votes
AnswersLet's say you are getting a pack of 2 chips, and you know that both chips are coming from the same , either good or bad company, with equal probability. If you test a first chip and it appears to be good chip, what is the probability that second chip is also good? And at least is this probability is greater than 50% or not?
- leontol May 14, 2015 in United States| Report Duplicate | Flag | PURGE
xyz Data Scientist Probability - 0of 0 votes
AnswersThere are 2 companies making electronic chips: good and bad. Good company is making good chips with probability 80 % and defective chips with probability 20 %, and bad company is making good chips with probability 20 % and defective chips with probability 80 %. If you are getting just one chip, and the probability that it is coming from either of companies is the same, what is the probability that it is good chip?
- leontol May 14, 2015 in United States| Report Duplicate | Flag | PURGE
xyz Data Scientist Probability - 0of 0 votes
AnswersI am graduating in december2015 and I am targeting google. I have almost 6-8 month to go for it.I am a python developer although I have 3 year of experience in java but its 1.2 years pass I didn't touch that so I want to continue with python. I am using Python from last one year. any suggestion about python ? Or i have to go back and start with java again?
- Fatma Zaman April 24, 2015 in United States| Report Duplicate | Flag | PURGE
xyz Software Engineer - 0of 0 votes
AnswersI have an two arrays int[] 1 = {2,5,8,9}; and int[] 2={6,3,4,7,1};
- navishsahu April 03, 2015 in India for 5
I need to merge this two array in third array int[] 3 = new int[1.Length + 2.Length]; and give the output in sorted form.
Also I need to provide and optimized code with minimal complexity...
Output: {1,2,3,4,5,6,7,8,9}
Plz Help...| Report Duplicate | Flag | PURGE
xyz Applications Developer Arrays - 0of 0 votes
AnswersSimple java code to print a character.the character should be printed according to users height and width.
- Poornima March 07, 2015 in India
ex:h=5,w=3| Report Duplicate | Flag | PURGE
xyz Software Developer Java - 0of 0 votes
AnswersTo within a constant factor, how much time does the following algorithm take, in terms of n?
- jayashriaiyar February 24, 2015 in United States
twoToTheN(n)
if n == 1
return 0
else
return twoToTheN(n-1) + twoToTheN(n-1)| Report Duplicate | Flag | PURGE
xyz xyz - 0of 0 votes
AnswersA polygon is a piecewise-linear, closed curve in the plane. That is, it is a curve
- jayashriaiyar February 24, 2015 in United States
ending on itself that is formed by a sequence of straight-line segments, called the
sides of the polygon. A point joining two consecutive sides is called a vertex of
the polygon. If the polygon is simple, as we shall generally assume, it does not
cross itself. The set of points in the plane enclosed by a simple polygon forms the
interior of the polygon, the set of points on the polygon itself forms its boundary,
and the set of points surrounding the polygon forms its exterior. A simple polygon
is convex if, given any two points on its boundary or in its interior, all points on
the line segment drawn between them are contained in the polygon’s boundary or
interior.
Professor Amundsen proposes the following method to determine whether a sequence
hp0, p1, . . . , pn−1i of n points forms the consecutive vertices of a convex
polygon. Output “yes” if the set {6 pi pi+1 pi+2 : i = 0, 1, . . . , n − 1}, where sub
script addition is performed modulo n, does not contain both left turns and right
turns; otherwise, output “no.” Show that although this method runs in linear time,
it does not always produce the correct answer. Modify the professor’s method so
that it always produces the correct answer in linear time.| Report Duplicate | Flag | PURGE
xyz xyz Algorithm - 0of 0 votes
AnswersFind the number of substrings of 2 strings that are palindromes.
- Tuansu2021998 February 23, 2015 in United States| Report Duplicate | Flag | PURGE
xyz Student - 0of 0 votes
AnswersReverse left node of BT.
- frustatedALGO February 12, 2015 in United States
1 (ROOT)
/ \
2 3
/ \
4 5
/ \
6 7
to
1
/
2 - 3
/
4 - 5
/
6 - 7
(6 is root)| Report Duplicate | Flag | PURGE
xyz Software Engineer / Developer C++ - 0of 0 votes
AnswersParse the Employee.txt file to the following Employee class and make and Array list of the Employee objects.
- Vanquisher February 05, 2015 in XYZ for XYZ
================
class Employee
{
int empID;
String name;
String city;
}
=================
Employee.txt
------------------------------------
101,emp1,city1;2,emp2,
city2;
3,emp3,city3;4,emp4,city4;5,emp5,city5;6,
emp6,
city6;
----------------
Each Employee details is separated by (semicolon) " ; " and each field of an employee is separated by comma(" ,").
And in the file it can be that half details in first line half is in second. As shown in example.| Report Duplicate | Flag | PURGE
xyz XYZ xyz XYZ Algorithm