Java Interview Questions
- 0of 0 votes
AnswersWrite a function to generate pascal triangle (use recursion)
- chad August 05, 2015 in United States
public static int[] generatePascal(int level)| Report Duplicate | Flag | PURGE
Expedia Software Engineer / Developer Java - 0of 0 votes
AnswersHow do you decide whether we should use Java or C++ for a particular project . what are pros and cons
- chad August 01, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP SDE-2 Java - 0of 0 votes
AnswerHow does garbage collector work ? In mark and sweep , how does gc know which objects it needs to mark , how are references stored for objects for gc to understand that its reference is null or it is no more referenced anywhere j
- chad August 01, 2015 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP SDE-2 Java - 0of 0 votes
AnswerThere are five classes having inheritance a,b,c,d,e. We have to solve an equation with all the possible methods defined in the above classes.We have multiply(), add(),subtract() and divide() methods in the above classes.
- manishvashishtha01 July 28, 2015 in United States| Report Duplicate | Flag | PURGE
Java - 1of 1 vote
AnswersGiven a hashmap, HashMap<String,List<String>> with the following data:
- Yev July 16, 2015 in United States
A: B,C
B: X Y
X: Z
Y: Z
Expected output is an array of the dependencies. I initially started with Breadh-first search for simplicy, which had running O(|V|+'E') and space O(|V|). The interviewer said depth-first search is better; I don't see how DFS is better, because it requires recursion.
Part2: He then said my solution is functionally correct and then introduced a circular dependency and asked how to resolve it. I said using a visited hashset will detect a circular dep. He said it's not quite right and there a few approaches.| Report Duplicate | Flag | PURGE
Here Software Developer Java - 0of 0 votes
AnswersGiven a string of english characters. Find the character that appears only once. I used arr[256] to store a count of each character. Then, iterate over the array to find the first non-dup, a[iter+'a']==1. The interviewer thought that storing a[iter]='x' (dup) and a[iter]=<index> was a better solution to avoid running a second pass over the string. In my mind, I disagreed using the array index, one can find the character that appears only once. The interviewer persisted, and told me to think about it.
- Yev July 16, 2015 in United States| Report Duplicate | Flag | PURGE
Here Software Developer Java - 0of 0 votes
AnswersPassing objects and correct the program:---
- Avinash July 14, 2015 in United States
class OdemoA
{
int i,j;
void function1(int i)
{
System.out.println(i);
System.out.println("Inside function()");
}
void function2(Area a1)
{
if(a1!=null)
{
a1.i=203;
a1.j=115;
}
System.out.println(a1);
System.out.println("end of function2()");
}
public static void main(String args[])
{
OdemoA d1 = new OdemoA();
Area a2 = new Area();
d1.function2(a2);
System.out.println(a2.i);
System.out.println("end main");
}
}| Report Duplicate | Flag | PURGE
ADP Developer Program Engineer Java - 0of 0 votes
AnswersHello , I must write a program that given the elements in a list , generates all combinations of these elements .
- pasquale.restaino1992 July 06, 2015 in United States
For example, if I [A, B , C ] , the possible combinations are [ A] , [B ] , [ C ] , [A, B ] . [ A, C ] , [ B, C ] , [A, B , C ] . Another example , having [ A, A, B] the possible combinations are [ A] , [ A, A ] , [A, B ] , [ A, A, B, A ] .
How can I write it in java ?| Report Duplicate | Flag | PURGE
Java - 0of 0 votes
Answerswrite a java program display the sub string from a string without using string function
- vivek260394 June 11, 2015 in India for 1| Report Duplicate | Flag | PURGE
Developer Program Engineer Java - 0of 0 votes
AnswersHave you done debugging in JVM? How would you do it.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Data Structures Java Knowledge Based Testing test - 0of 0 votes
Answerswhat's use of equals and hashcode function?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Coding Hash Table Java Object Oriented Design - 0of 0 votes
Answershashmap implementation?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Algorithm Coding Hash Table Java - -1of 1 vote
Answervector vs arraylist
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Coding Java Object Oriented Design - 0of 0 votes
Answerhashtable vs hashmap
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Coding Hash Table Java - 0of 0 votes
AnswersIs memory leaks possible in Java?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Java Testing - 0of 0 votes
AnswerHow Garbage collector know if something is not used and needs to be removed?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Coding Compiler Debugging Java - 0of 0 votes
Answersdifference between java7 and java8?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Java - 0of 0 votes
Answersjava vs javascript
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Java - 0of 0 votes
Answersstack vs heap
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Java - 0of 0 votes
AnswersDoes JavaScript has inheritance?
- Tom Walker June 07, 2015 in United States
Can you override in JavaScript?| Report Duplicate | Flag | PURGE
Amazon Software Developer Java JavaScript Object Oriented Design - 0of 0 votes
AnswersWhat's difference between Javascript and JAVA in terms of OOP principles. Provide examples.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Coding Java JavaScript Object Oriented Design - 0of 0 votes
AnswersIf given a binary file, with data like lat, long, weather, temp in key:value. It's a structured data how would u ingest it. what are the steps that are being taken before Hive process starts.
- Tom Walker June 07, 2015 in United States
- serde (serializartion deserialization). parque etc.| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm Data Mining Data Structures Database Distributed Computing Java SQL - 0of 0 votes
AnswersAfter map phase partition, shifting, sorting happen. What does it mean?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database Java - 0of 0 votes
AnswerWhat is input split in hadoop.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database Java SQL - 0of 0 votes
AnswersAs I interviewing for Big data position. Asked Hadoop question :-
- Tom Walker June 07, 2015 in United States
Difference between TextInput vs Key Value format in Hadoop.| Report Duplicate | Flag | PURGE
Amazon Software Developer Data Mining Data Structures Database Java design - 0of 0 votes
AnswersDesign Bing search.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Developer Algorithm Coding Database Java Object Oriented Design Software Design - 0of 0 votes
AnswersWhat's Hbase, Pig, used for? Why do we need Hbase if we can use Hive to query Hadoop?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Developer Data Mining Data Structures Database Distributed Computing Experience Java Knowledge Based Large Scale Computing - 0of 0 votes
AnswersWhat are different phases of Map reduce operation - I think they were looking for split, combiners, partitioners, sorting phases of whole map reduce stage.
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Software Developer Data Mining Data Structures Database Distributed Computing Java Large Scale Computing SQL - 0of 0 votes
AnswersMy interview was for big data position for their Search team. They were looking for person with good Hadoop skill set :-
- Tom Walker June 07, 2015 in United States
1. Can you describe Hadoop Architecture? What are various components of it (Primary/Secondary namednodes, data node etc)? Explain working of each.| Report Duplicate | Flag | PURGE
Microsoft Software Developer Data Mining Data Structures Database Distributed Computing Ideas Java - 0of 0 votes
AnswersGiven Two classes A & B. How will B know if an instance of A is already created?
- SantoshSingh June 02, 2015 in India| Report Duplicate | Flag | PURGE
Oracle SDE-2 Java
Open Chat in New Window