Developer Program Engineer Interview Questions
- 5of 5 votes
Answers* Given an unsorted integer array, place all zeros to the end of the array without changing the sequence of non-zero
- haldokan August 12, 2016 in United States
* elements. (i.e. [1,3,0,8,12, 0, 4, 0,7] --> [1,3,8,12,4,7,0,0,0])| Report Duplicate | Flag | PURGE
Bloomberg LP Developer Program Engineer Algorithm - 0of 0 votes
Answers* Implement a tick server the has multiple clients interested in different tickers. Clients have Plotters that are updated
- haldokan August 12, 2016 in United States
* in real-time with the top 10 tickers that have the most price updates on the top. What data structure would you choose
* for the server and client plotters?| Report Duplicate | Flag | PURGE
Bloomberg LP Developer Program Engineer Algorithm - 0of 0 votes
Answers* Royal titles consist of name followed by space and a Roman numeral. Example: Richard IV. The Roman numeral in the title
- haldokan August 12, 2016 in United States
* can go to L (50). You are given the roman numerals from 1 to 10:
* I II III IV V VI VII VIII IX X. And you are given the 10 multiples up to 50: XX XXX IL L. Numbers between 10 and 50 that
* are not given can be formed from 10 multiples and a numeral b/w 1 and 9. Example: 48 is XLVIII wichi is XL (40) plus
* VIII (8).
* <p>
* You are given an array of Roman titles sort it as follows: sort it on the name unless the names are equal, in which
* case you have to sort it on the ordinal of the numerals.
* Examples:
* Henry II, Edward VIII => Eward VII, Henry II
* Richard V, Richard II, Richard X => Richard II, Richard V, Richard X| Report Duplicate | Flag | PURGE
Bloomberg LP Developer Program Engineer Algorithm - 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 August 10, 2016 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
AnswersvTable will be created or not for abstract class. If yes then what will be the entry in this vTable
- Pooja July 09, 2016 in India| Report Duplicate | Flag | PURGE
Brocade Developer Program Engineer - -1of 1 vote
AnswersImplement % operator using bit mask.
- Pooja July 09, 2016 in India| Report Duplicate | Flag | PURGE
Brocade Developer Program Engineer - 0of 0 votes
AnswersFind the longest cycle in a directed graph in java
- shivamdev31 June 07, 2016 in United States
I/P -> 23 --> O/P 6
Elements : 4, 4, 1, 4, 13, 8, 8, 8, 0, 8, 14, 9, 15, 9, -1, 10, 15, 22, 22, 22, 2
longest cycle -> 4, 13, 11, 9, 8, 0
Its the value and value at that index.| Report Duplicate | Flag | PURGE
Developer Program Engineer Algorithm - 0of 0 votes
AnswersGiven N balloons, if you burst ith balloon you get Ai−1∗Ai+1 coins and then (i-1)th and (i+1)th balloons become adjacent. Find maximum number of coins you can gather.
- pbox May 14, 2016 in India
If you have single balloon then you will get value written on it.
Example
if you have 4 balloons and coins associated for them are....
1 2 3 4 then you will get 20 maximum.| Report Duplicate | Flag | PURGE
AMD Developer Program Engineer Dynamic Programming - -1of 3 votes
AnswersConstruct a Binary tree from the preorder traversal and find the distance between two nodes.
- EsmailDini April 28, 2016 in canada for Alexa| Report Duplicate | Flag | PURGE
Amazon Developer Program Engineer Data Structures - 1of 1 vote
AnswersA list L is too big to fit in memory. L is partially sorted. Partially sorted in a specific way: x-sorted L[i] < L[i+x]. Any element is at most x indices out of position.
- jss_777 March 30, 2016 in United States
You can look at the condition in a different way too..
L[i] >= L[i-x]
Sort the list L.| Report Duplicate | Flag | PURGE
Google Developer Program Engineer - -1of 1 vote
AnswersYou are given an array of wooden log’s length. each of varying length.You have a wooden cutter with you. it has a sharpness value, say S.
- alien.0101 March 22, 2016 in India
You are supposed to cut as many wooden logs (desired logs), each of length L (not more or less) using only S cuts
if you cut a wood, S will decrease by 1
if you cut two woods together, even then S will decrease by the number of woods in the cut, ie. 2
assume L and S are int. and the length of each wood is also int| Report Duplicate | Flag | PURGE
Accenture Developer Program Engineer Algorithm - 0of 0 votes
AnswersGiven a matrix of ‘O’ and ‘X’, find the largest sub rectangle surrounded by ‘X’
- vinay February 26, 2016 in United States
Example :
XXXXX
X0X0X
XXXXX
XXXXX
Output : largest rectangle size is 4 x 5| Report Duplicate | Flag | PURGE
unknown Developer Program Engineer Algorithm - 0of 0 votes
AnswersIn your large programme, thereis memory leak, how will ypu find out where(Linux)
- mohapatrasandeep60 February 15, 2016 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
Answergiven 2 processes. Each having 4 threads. ! thread is having performance issue. How will you find out that thread (Linux)
- mohapatrasandeep60 February 15, 2016 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
Answersgiven 2 processes , how to use a semaphore which is locked on 1 process and released in other(Linux)
- mohapatrasandeep60 February 15, 2016 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
AnswersThere are IPCs in Linux- Pipe, Fifo, Shared Memory, Message Queue, Socket. Which cases which IPC to choose(Linux)
- mohapatrasandeep60 February 15, 2016 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
AnswersWhy to use singleton class? What is the advantage you get by restricting single object of a class.
- mohapatrasandeep60 January 10, 2016 in India
eg.If you are using a logger class, if there are many objects of the class and you want to print that sequentially, you can achieve this with mutex. Why use singleton?
write code for thread safe singleton.| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
Answerswrite commands for -
- mohapatrasandeep60 January 10, 2016 in India
1>list processes
2>remove 2lines from file
3>there are multiple hirarachical direcories. Change the file extension all .c files to .cpp
4>chang time stamp of a file
5> run a script at a particular time| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 1of 1 vote
AnswersWrite 2 functions to serialize and deserialize an array of strings. strings can contain any unicode character. Do not worry about string overflow.
- TheShocker1999 December 08, 2015 in United States| Report Duplicate | Flag | PURGE
Google Developer Program Engineer String Manipulation - 0of 0 votes
AnswersThis was a javascript interview.
- jsduder December 06, 2015 in United States
There are two arrays:
var arr1 = [2,"undefined",7,"undefined", 10,"undefined","undefiend"];
var arr2 = [5,8,12,14];
They need to be merged such that arr1=[2,5,7,8,10,12,14]
This needs to be done in place and in constant time.| Report Duplicate | Flag | PURGE
Developer Program Engineer Algorithm - 0of 0 votes
AnswersI was asked this question in an algorithm interview. Since my coding language was javascript I was asked to implement a hashmap n white board with collision detection.
- jsduder December 02, 2015 in United States
I guess they were looking for a hashing algorithm that will create a linked list in case of a collision and also an equals method| Report Duplicate | Flag | PURGE
StartUp Developer Program Engineer Algorithm - 0of 0 votes
AnswersUsing Javascript write code to detect and remove a loop from a cylic linked list
- jsduder December 01, 2015 in United States| Report Duplicate | Flag | PURGE
Developer Program Engineer Algorithm - -2of 2 votes
Answers#include<stdio.h>
- bbhagwansingh17 November 23, 2015 in India for 10
#include<string.h>
char* minimumCost(char* input1[],int input2)
{| Report Duplicate | Flag | PURGE
Developer Program Engineer C - -3of 3 votes
Answer#include<stdio.h>
- bbhagwansingh17 November 23, 2015 in India for 10
#include<string.h>
char* minimumCost(char* input1[],int input2)
{| Report Duplicate | Flag | PURGE
Developer Program Engineer C - -2of 2 votes
Answers#include<stdio.h>
- bbhagwansingh17 November 23, 2015 in India for 10
#include<string.h>
char* minimumCost(char* input1[],int input2)
{| Report Duplicate | Flag | PURGE
Developer Program Engineer - 2of 2 votes
AnswersTwo strings s1 and s2 are given. You have make a new string s3 such that it has both s1 and s2 as one of its subsequences and length of s3 is minimum.
- ritwik_pandey September 03, 2015 in India
input:
apple pear
output:
applear
7| Report Duplicate | Flag | PURGE
Alcatel Lucent Developer Program Engineer - 0of 0 votes
Answerswrite 3 threads..2 producer threads and 1 consumer thread..
- sandeepkumar2116 August 22, 2015 in India
Two players playing a game. they can type 1 or 2. if player1 and player2 both type 2, both get 4 points each..if both
type 1 they get 2 point each..if player1 types 1 and player2 types 2, then player2 gets 3 and player1 gets 1..if player1
types 2 and player1 types 1, than player2 gets 1 and player1 gets 3..
There will be 10 rounds.And their scores would get accumulated. If at the end of any round, any player is trailing by more
than 6 points the trailing player would not get a chance to type any input in the next round. However, subsequent rounds onwards
all players would be given chance to type inputs should he/she does not trail by more than 6 points.
Thread1 & 2 : They are producer threads..they will ask the user to type something..But whenever a miss occurs for a player
(because he was trailing by more than 6 points), the respective thread will not ask the user to type anything.Instead it
will assume that trailing player has typed 2. The threads will write the inputs into a buffer..
Thread3 : the consumer thread will read from the buffer and display the values entered at each round and scores accumulated
at the end of each round..The scoring will happen in Thread3 only..
You can not use sleep or delay statement anywhere in the code| Report Duplicate | Flag | PURGE
Honeywell Developer Program Engineer - 2of 2 votes
AnswersThe King's Land Sale - 2
- sunilkanaujia.manit August 14, 2015 in India
You might have seen shopkeepers offering sale on their trade items to promote their business - like sale on electronic gadgets or sale on clothing and accessories etc. But have you ever come across something like sale of land ?
Yes, the king of Byteland has grown old and wants to sell away his territory as soon as possible. So he announced a sale on his plot. This drew attention of many land lords and everybody hurried to buy land at the cheapest prices. The king had declared that he would accept bids of only rectangular plots and one needs to mention the diagonally opposite corners(a, b) and (c, d) of the land he wishes to buy. They would write these 4 numbers (a, b, c, d) on a piece of paper, seal it in an airtight envelope and give it to the king.
The king received N such envelopes. As the process was hidden there were many envelopes containing plot descriptions that shared some (or even all) common area. The king now wants to know the union of the areas of all plots that have come under the bidding.
Note that the rectangles made by the plots are always aligned to the rectangular axes, their areas is always positive and c >= a and d >= b.
Note that the rectangles made by the plots are always aligned to the rectangular axes, their areas is always positive and c >= a and d >= b.
Constraints
1 ≤ T ≤ 20
1 ≤ N ≤ 20
-10000 ≤ a, b, c, d ≤ 10000
Input
The first line of the input contains the number of test cases T. The description of T test cases follow. Each test case starts with a line containing an integer N, the number of rectangular plots. Then N lines follow, each with 4 space separated integers, a b c d,(a, b) and (c, d) representing the diagonally opposite corners of the plots.
Output
For each test case print one line, the union of the areas of all the plots.
Explanation
1) The individual areas of both plots are 4 each. But they share a common area of 1 between them (between (1, 1) and (2, 2)). Therefore the total area is 4 + 4 - 1 = 7
2)Both the plots of no area in common. So we simply add their individual areas (6 + 9 = 15).| Report Duplicate | Flag | PURGE
Adobe Developer Program Engineer Algorithm - 0of 0 votes
Answerswrite a java program for below question.
- sarath.chalasani46 August 10, 2015 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