Java Interview Questions
- 1of 1 vote
AnswersGiven a list of ranges as input ((1,2),(3,4),(3,6),(8,10)),the output would be those ranges that don't overlap.For example, the output could be merging the ranges 1) (1,2),(3,4)
- aifra2000 December 02, 2013 in United States
2) (1,2) (3,6) etc
The output cannot contain (3,4),(3,6) as 3 is common to both| Report Duplicate | Flag | PURGE
Amazon Java Developer Java - 0of 0 votes
AnswersWrite an interface for HashMap.
- nosyDeveloper November 22, 2013 in United States| Report Duplicate | Flag | PURGE
Yahoo Software Development Manager Java - 0of 0 votes
Answersquicksort using divide and counquer . Need code please java
- fgfsdgs November 18, 2013 in United States| Report Duplicate | Flag | PURGE
Infosys Java Developer Java - 1of 1 vote
AnswersUsing a Java data structure, eliminate all unnecessary/stop words from a string. Assume you are given the string
- andreiarefiev November 14, 2013 in United States
"To be or not to be - that is the question: Whether it is nobler in the mind to suffer, the slings and arrows of outrageous fortune. Or to take up arms against a sea of troubles, and by opposing end them"
The unnecessary words to remove are "a", "be", "to", "the", "that", "this", "or"
So the resulting string should be like this
"not - is question: Whether it is nobler in mind suffer…| Report Duplicate | Flag | PURGE
Intuit Quality Assurance Engineer Java - 3of 3 votes
Answerswhen we have to override equals and hashcode in java..?
- PRASHANTGAURAV November 12, 2013 in India
what will happened if you dont override .. Explain with program.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 5of 5 votes
Answerswhy strings are immutable ?
- tare.rohan November 11, 2013 in India
how many objects will be created in
String temp = "A" + "B" + "C" ;
explain your answer in detail.| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Java - 1of 3 votes
AnswersC={1,2,2,3,4,5}
- fgfsdgs November 09, 2013 in United States
Sum=5
subset;
{1,2,2}
{1,4}
{2,3}
using exhaustive force in java
ideas| Report Duplicate | Flag | PURGE
Palantir Technology iOS Developer Java - 0of 0 votes
Answershow do we compare two objects in java.
- gautam October 25, 2013 in India| Report Duplicate | Flag | PURGE
Software Trainee Java - -1of 1 vote
AnswersI am capturing the voice as buffer at client side and sending that buffer to server using Socket programming, then at server side I receive it and play using SourceDataLine , and its properly running on LAN but when I deploy it to Remote Server the voice carry noise data.
- zsanchit October 22, 2013 in India
tell me the solution.| Report Duplicate | Flag | PURGE
Java Developer Java - 0of 0 votes
AnswersDifference in SOAP and IIOP?
- java.interviews.questions October 16, 2013 in India| Report Duplicate | Flag | PURGE
Citigroup Java Developer Java - 0of 0 votes
AnswersWhat is externalizable interface?
- java.interviews.questions October 16, 2013 in India| Report Duplicate | Flag | PURGE
Citigroup Java Developer Java - 0of 0 votes
Answersjava code to calculate size of String without using any length or size method?
- java.interviews.questions October 16, 2013 in India
String input = "abcde ";
int output = 5;| Report Duplicate | Flag | PURGE
Citigroup Java Developer Java - 0of 0 votes
AnswersWrite code in java to move char to next position with minimum space requirement?
- java.interviews.questions October 16, 2013 in India
String input = "abcde";
String output = "eabcd";| Report Duplicate | Flag | PURGE
Citigroup Java Developer Java - 0of 0 votes
AnswersDo thread join without join function
- antipotato October 16, 2013 in India| Report Duplicate | Flag | PURGE
JP Morgan Senior Software Development Engineer Java - -2of 2 votes
AnswersString temp = "A" + "B" + "C" ;
- tare.rohan October 11, 2013 in India
how many objects are created| Report Duplicate | Flag | PURGE
Developer Program Engineer Java - 0of 0 votes
AnswersSpiraly print n*n matrix.
- Prajna October 10, 2013 in India
Eg: [1,2,3,4]
[12,13,14,5]
[11,16,15,6]
[10,9,8,7]
Should print
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16| Report Duplicate | Flag | PURGE
JP Morgan Software Engineer / Developer Java - 2of 2 votes
AnswersCan you predict the output of the following code?
- Prithvi October 06, 2013 in Nepal for Java Developerfor (int i = 0; i < 101; i++) { if (i % 2 == 0) { System.err.print(i); } else System.out.print(i); }
| Report Duplicate | Flag | PURGE
Software Engineer / Developer Java - -3of 3 votes
AnswersWhat is spring Initialization Bean interface?
- java.interviews.questions October 06, 2013 in India| Report Duplicate | Flag | PURGE
Citigroup Applications Developer Java - -3of 3 votes
Answerswhat is generic Eraser in java?
- java.interviews.questions October 06, 2013 in India| Report Duplicate | Flag | PURGE
Citigroup Applications Developer Java - -3of 3 votes
Answersdecide collection in java where you can store this range based search?
- java.interviews.questions October 06, 2013 in India
age range : group id
0-25 : 1
26: 50 : 2
> 51 : 3
best way to store this DS and In search input is age and we should get group id?| Report Duplicate | Flag | PURGE
Citigroup Applications Developer Java - -3of 3 votes
Answerwhen to use serialization vs externalizable interface?
- java.interviews.questions October 06, 2013 in India| Report Duplicate | Flag | PURGE
Citigroup Applications Developer Java - -3of 3 votes
AnswersIf new object is created by thread then where object's attributes are going to be created? stack or heap?
- java.interviews.questions October 06, 2013 in India
class Myclass{
String data;
MyObject object;
public void mehtod(){
data = new String("ddd");
object = new MyObject();
int i = 10;
}
Suppose now thread A creates object of this class and calls method() then where data, object and i will be created? heap or stack of thread?| Report Duplicate | Flag | PURGE
Citigroup Applications Developer Java - 0of 4 votes
AnswersYou have been given a series of 'n' numbers and the series is in a random order. Write a program to find the median of the series with minimum complexity.
- Purushotham Kumar October 05, 2013 in Canada for Graduate Recruitement Team| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm Java - 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 - -1of 5 votes
AnswersWrite a comparator which can be used to compare any type of objects?
- java.interviews.questions September 20, 2013 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Java Developer Java - 0of 0 votes
AnswersImplement a Boolean vector: T, F, F, T, F, … with the following operations:
- adi September 13, 2013 in United States
append(boolean b)
boolean get(int index)
set(int index, boolean b)
int length()
Restriction: no Java collections classes
What if you knew the vector has 99.99% T and only 0.01% False. How would you change the approach?| Report Duplicate | Flag | PURGE
Google SDE1 Java - 0of 0 votes
AnswersDesign high throughput trading application? Application is hosted in NY and we have traders all over the world accessing this application. What things we need to take care on designing this application.
- java.interviews.questions September 11, 2013 in India| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Java - 0of 0 votes
AnswersHow to create singleton class and what if the constructor is throwing IOException? what will be best strategy to create instance of this class?
The question is more on constructor throws exception.
- java.interviews.questions September 11, 2013 in United States//create singleton class. private SingltonExample() throws FileNotFoundException { File f = new File("data.txt"); FileInputStream fis = new FileInputStream(f); }
| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Java