Ebay Interview Questions
- 4of 4 votes
AnswersFind the latest version of released software. For e.g1. 2 and 2.2.. latest is 2.2.
- techpanja October 02, 2013 in United States
eg2: 3.1 and 3.1.3... latest version is 3.1.3... version is passed as string in above format.| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Java - 2of 2 votes
AnswersDesign an architecture for REST APIs where you have to upload big data like images/videos etc. Request should be async. Follow up: How will you tune the performance if you have millions of requests coming at same time? Clues: Queueing the request, Storing data in filesystems rather than traditional DB etc.
- techpanja October 02, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Distributed Computing - 1of 1 vote
AnswersDifference between concurrency and parallelism
- JSDUDE June 27, 2013 in United States
How has threading helped concurrency and parallelism?| Report Duplicate | Flag | PURGE
Ebay SDE1 Threads - 1of 1 vote
AnswerFormula for nth PI is (-1^n)/(2n+1). Write an efficient way to calculate this.
- JSDUDE June 27, 2013 in United States
After i wrote a recursive and iterative solution, she wanted a faster solution. So i went to threading.
Eventually she said that if the value of n is a million and you can't have million threads how will you distribute:
Problem is as n increases the above computation becomes time consuming and hence cannot be simply split in ranges.
She hinted me towards: Queue of jobs, threads picking jobs and en-queuing the work| Report Duplicate | Flag | PURGE
Ebay SDE1 Math & Computation Threads - 0of 0 votes
AnswersWrite a function to calculate the nth prime number:
- JSDUDE June 27, 2013 in United States
N = 0; Prime#: 2
N=1; Prim#: 3
What is the complexity of this alogirthm| Report Duplicate | Flag | PURGE
Ebay SDE1 Math & Computation - 0of 0 votes
AnswersYou are given a 2D array that is your sea. It has more than one ships which don't overlap each other. All ships are not necessarily of the same size.
- JSDUDE June 27, 2013 in United States
You are to improve on performance and space is no concern.
Write a program that takes in two co-ordinates:
If the attack co-ordinates did not have a ship, print "Missed"
If the attack co-ordinates have a ship, print "Attacked Ship <Name>"
If the attack co-ordinates have a the same part of the attacked ship, print "Already Attacked"
If the last piece of the un-attacked ship was attacked print: "Ship sunk".| Report Duplicate | Flag | PURGE
Ebay SDE1 Coding Data Structures - 0of 0 votes
AnswersGiven a binary tree with each node having a pointer to its parent, Write a function that can find the immediate right neighbor of a given node. Don't use BFS.
- JSDUDE June 27, 2013 in United States
Node* RightNeighbor(Node* node)
Note: Root of the tree is not given| Report Duplicate | Flag | PURGE
Ebay SDE1 Trees and Graphs - 0of 0 votes
AnswersThere is a file on a server. There are 3 access levels to this file: 1. Read\Write 2 Read 3. No access.
- JSDUDE June 27, 2013 in United States
A person can: 1. Copy a file. 2. Edit it on the server 3. Overwrite the existing file on the server
Write all the test cases for this scenario| Report Duplicate | Flag | PURGE
Ebay SDE1 test - 2of 2 votes
AnswersCheck if the given binary tree is BST or not.
- aopencv June 14, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Algorithm Data Structures Java - 0of 0 votes
AnswersGiven an integer array, find pairs in an array which sum up to a given number.
- aopencv June 14, 2013 in United States
For example: Array{4,5,1,3,2} and required sum=6 then output should be [1,5] and [2,4].| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Data Structures Java - 0of 0 votes
AnswersN nodes, each node consists of a couple fields and methods. These are:
- JSDUDE June 13, 2013 in United States
int id; //every node has an ID. All of these IDs are sequential, and begin with 0. I.e. all ids are uniquely in the range of 0 t N-1
int val; //every node has a value
int max; //max = N. Every node knows how many nodes are in the system.
void send(int idTo, int payload)
int recv(int idFrom)
Write a single piece of code which runs on every node simultaneously, such that when it is finished running every node in the system knows the sum of the values of all the nodes in the system.| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Trees and Graphs - 1of 1 vote
AnswersGiven two array of integers write two functions that will return an Union and Intersection
- JSDUDE June 13, 2013 in United States
Time efficient
Both time and space efficient implemented| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Arrays - 2of 2 votes
AnswersProblem: you are given 2 words with equal number of characters. Find an algorithm to go from first word to second word, changing one character at each step, in such a way that each intermediate word exist in a given dictionary.
- EugenDu May 24, 2013 in United States
Example:
Words are pit, map. A possible solution:
pit, pot, pet, met, mat, map| Report Duplicate | Flag | PURGE
Ebay Software Engineer in Test Algorithm - 0of 0 votes
AnswersThere is a sorted array of integers (suppose sorted in "ascending order"). How will you find a specific element in an array? You can not use traditional iterative method to find a specific element in an array.
- gunsnroses23k May 08, 2013 in United Kingdom| Report Duplicate | Flag | PURGE
Ebay Java Developer Algorithm - -4of 4 votes
Answersif u have singleton class n war file and two application are acceing the war file what wil hapeen to that singleton class.....ans - some class loader concepts.
- abcd March 06, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer - -4of 4 votes
Answershow wil u use the lock mechanism in java
- abcd March 06, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer - -3of 3 votes
Answerswhat will happen if u build code on java 16 and put on machine with java 15
- abcd March 06, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer - -1of 1 vote
AnswersExplain exceptions in java..what is base class of exception...what does error class do..what does runtimeexpception class do
- abcd March 06, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Algorithm - 0of 2 votes
AnswersDifference between thread and process
- abcd March 06, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Threads - 0of 2 votes
AnswerExplain how hashtables work internally. How is hashcode generated and what wiill happen to hash code when 2 values are same.
- abcd March 06, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Hash Table - 0of 0 votes
AnswerHow do you handle a misspelled word in a web search engine? (I explained about Longest common subsequence and edit distance as well as Trie).
- Zagoritt February 02, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Software Engineer / Developer Algorithm - 0of 0 votes
AnswersPrint all the permutaion of a given string.
- adam2008 January 29, 2013 in United States
1) explain time\space complexity?
2) how can you improve time\space complexity?| Report Duplicate | Flag | PURGE
Facebook Ebay Software Engineer / Developer Algorithm Coding - 0of 0 votes
AnswersHow to maintain a Singleton in clustered environment
- vasa.v03 January 28, 2013 in India| Report Duplicate | Flag | PURGE
Ebay Member Technical Staff Java - 0of 0 votes
AnswersProgram to calculate a pow n...
I gave a answer with O(logN)
- vasa.v03 January 28, 2013 in Indiapublic static long exp(int a , int n) { boolean is_N_Odd = false; if ( n % 2 > 0 ) { n++; is_N_Odd =true; } if ( n == 2 ) return a * a; else if (n == 1 ) return a; else { long calc = exp (a , n/2) ; if ( is_N_Odd ) return calc * calc /a; else return calc * calc ; } }
| Report Duplicate | Flag | PURGE
Ebay Member Technical Staff Java - 0of 0 votes
AnswerHow to maintain locks/monitors in clustered environment ?
- vasa.v03 January 28, 2013 in India| Report Duplicate | Flag | PURGE
Ebay Member Technical Staff Java - 0of 0 votes
AnswerHow to manage a singleton in clustered environment ?
- vasa.v03 January 28, 2013 in India| Report Duplicate | Flag | PURGE
Ebay Member Technical Staff Java - 0of 0 votes
AnswersHow to manage multiple Database drivers ?
- vasa.v03 January 28, 2013 in India
Basically how to use DriverManager to register and retrievee multiple drivers| Report Duplicate | Flag | PURGE
Ebay Member Technical Staff SQL - 0of 0 votes
AnswersA Query to delete duplicate rows ....
- vasa.v03 January 28, 2013 in India
Let say i have a table
Employee - Emp_id,Emp_name,Emp_email
and there is no primary/unique key
Emp_id,Emp_name,Emp_email
1 abc a@b.com
1 abc a@b.com
2 abc a@b.com
Retain only unique rows for Emp_id,Emp_name,Emp_email like ,
Emp_id,Emp_name,Emp_email
1 abc a@b.com
2 abc a@b.com| Report Duplicate | Flag | PURGE
Ebay Member Technical Staff SQL - 0of 0 votes
AnswersHow Denormalization improves performance ?
- vasa.v03 January 28, 2013 in United States| Report Duplicate | Flag | PURGE
Ebay Member Technical Staff SQL - -1of 1 vote
AnswersRead a file and create a a datastructure which holds all the anagrams of words conatined in the file..
- vasa.v03 January 28, 2013 in India
For e.g lets say file content is "abc bca"
we need a DS to say "abc" and "cba" are anagrams.
I told i will use a FileReader to read characters than bytes
and assing a prime number for each alphabet
say
a - 2
b - 3
c - 5
and calculate the compound ofr multiplication
say abc = 2 * 3 * 5 = 30
bca = 3 * 5 * 2 = 30
i will use the compound a key in hashmap.
like 30 = abc-> bca -> cba
Let me know for any other better solution| Report Duplicate | Flag | PURGE
Ebay Member Technical Staff Data Structures