Java Interview Questions
- 0of 2 votes
AnswersHow to implement split () method
- kirann October 17, 2014 in India| Report Duplicate | Flag | PURGE
Java Developer Algorithm Java - -1of 1 vote
AnswersWrite a program to split a string without using split()method
- kirann October 17, 2014 in India| Report Duplicate | Flag | PURGE
Java Developer Algorithm Java - 0of 0 votes
AnswersGiven a string .Check if the string is palindrome or not
- sharma October 14, 2014 in India| Report Duplicate | Flag | PURGE
Goldman Sachs Java Developer Java - 2of 2 votes
AnswersThe stepping number:
- Anon October 13, 2014 in United States
A number is called as a stepping number if the adjacent digits are having a difference of 1. For eg. 8,343,545 are stepping numbers. While 890, 098 are not. The difference between a ‘9’ and ‘0’ should not be considered as 1.
Given start number(s) and an end number(e) your function should list out all the stepping numbers in the range including both the numbers s & e.| Report Duplicate | Flag | PURGE
Epic Systems Software Engineer / Developer Algorithm Data Structures Dynamic Programming Java Online Test - 0of 0 votes
AnswersGiven two classes C1 and C2 which are almost same.(remember not exactly same).
- NIC October 03, 2014 in India
You want to choose best among these classes so that it can be use as key in hashmap.
What question will you ask regarding two classes C1 and C2.| Report Duplicate | Flag | PURGE
makemytrip Software Engineer / Developer Java - 0of 0 votes
AnswersWhat is the diffenrce between join() and wait()?
- newbee September 17, 2014 in United States
What is sleep(). Which method releases the lock?| Report Duplicate | Flag | PURGE
Intuit Senior Software Development Engineer Java - 0of 0 votes
AnswerHow can we implement asynchronous call in Java? Say I want to query Google but don’t want to use all the urls want to use later. How can we do that?
- newbee September 17, 2014 in United States| Report Duplicate | Flag | PURGE
Intuit Senior Software Development Engineer Java - 1of 1 vote
AnswersHow can we divide a large file between multi threads to process it? If we are running a multi threaded application and input is a large file and we have to provide each thread a part of the file to make it fast. How we can achieve it in java?
- newbee September 14, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Java - 1of 1 vote
AnswersIf we have all the variables and methods are as static. So would that class be thread safe?
- newbee September 13, 2014 in United States| Report Duplicate | Flag | PURGE
A9 Software Engineer in Test Java - 2of 2 votes
AnswersJudgement Day
- BABUBTECH786 September 13, 2014 in United States
Skynet has figured out a way to take over the world. It will keep producing robots and molecular assemblers until it has converted all matter for its own purpose. Robots work to produce more robots and molecular assemblers. Molecular assemblers convert matter into programmable matter to be used to produce more robots and molecular assemblers.
Initial Info On day 0, Skynet started with 3 robots, 1 molecular assembler and 0 units of programmable matter.
On day i (i>0), robots produced can be calculated as the sum of the robots produced on the previous day and thrice the units of programmable matter produced on the previous day.
On day i, number of molecular assemblers produced can be calculated as the sum of robots produced on the previous day and twice the units of programmable matter produced on the previous day.
On day i, the units of programmable matter produced can be calculated as five times the number of molecular assemblers produced on the previous day.
How many robots, molecular assemblers and units of programmable matter will be produced on the Judgement Day (day n)?
Input/Output Specifications
Input format: Two integers x and y (1<=x,y<=10^6) such that the judgement day falls on day n = x*y.
Output format: Since the number of robots, molecular assemblers and units of programmable matter grows very rapidly, we want you to output them modulo 1000000007.
The output should be a string having the following format: R#M#P, where - R is the number of robots produced on judgement day modulo 1000000007 - M is the number of molecular assemblers produced on judgement day modulo 1000000007 - P is the number of units of programmable matter produced on judgement day modulo 1000000007| Report Duplicate | Flag | PURGE
Java - 0of 0 votes
AnswerDistributing Medals It's the medal distribution ceremony. 10^6 police officers, numbered from 1 to 10^6, are standing in a line. There are N (1<=N<=1000) iterations of medal distribution. In iteration i (0 < = i < N), count[i] ( 1 < = count[i] < = 100) medals are given to all officers from from[i] to to[i] ( 1 < = from[i] < = to[i] < = 10^6 )
- BABUBTECH786 September 13, 2014 in United States
If we sum up the number of medals received starting from the first officer, who would be the first officer for which the cumulative sum exceeds a given medal count THRESHOLD ( 1 < = THRESHOLD < = 10^9 )?
Input/Output Specifications Input format:
You are given 5 inputs:
input1 = N, the number of iterations
input2 = count, the array of medal counts in each iteration
input3 = from, the array of starting indices in each iteration
input4 = to, the array of ending indices in each iteration
input5 = THRESHOLD, the medal count threshold
Output format:
An integer, representing the number of the first officer such that the cumulative sum of medals starting from the first officer upto this officer exceeds THRESHOLD. The output should be -1 if such an officer does not exist| Report Duplicate | Flag | PURGE
Java - 0of 0 votes
AnswersJudgement Day
- BABUBTECH786 September 13, 2014 in United States
Skynet has figured out a way to take over the world. It will keep producing robots and molecular assemblers until it has converted all matter for its own purpose. Robots work to produce more robots and molecular assemblers. Molecular assemblers convert matter into programmable matter to be used to produce more robots and molecular assemblers.
Initial Info On day 0, Skynet started with 3 robots, 1 molecular assembler and 0 units of programmable matter.
On day i (i>0), robots produced can be calculated as the sum of the robots produced on the previous day and thrice the units of programmable matter produced on the previous day.
On day i, number of molecular assemblers produced can be calculated as the sum of robots produced on the previous day and twice the units of programmable matter produced on the previous day.
On day i, the units of programmable matter produced can be calculated as five times the number of molecular assemblers produced on the previous day.
How many robots, molecular assemblers and units of programmable matter will be produced on the Judgement Day (day n)?
Input/Output Specifications
Input format: Two integers x and y (1<=x,y<=10^6) such that the judgement day falls on day n = x*y.
Output format: Since the number of robots, molecular assemblers and units of programmable matter grows very rapidly, we want you to output them modulo 1000000007.
The output should be a string having the following format: R#M#P, where - R is the number of robots produced on judgement day modulo 1000000007 - M is the number of molecular assemblers produced on judgement day modulo 1000000007 - P is the number of units of programmable matter produced on judgement day modulo 1000000007| Report Duplicate | Flag | PURGE
Java - 0of 0 votes
AnswersWrite a java program read 3 numbers and line length make triangle..find whether triangle is isosceles or equilateral triangle,also find out rightangle triangle?
- Muni September 11, 2014 in India| Report Duplicate | Flag | PURGE
Kaseya Java Developer Java - 0of 0 votes
AnswersWrite a java program multiply two 10-digit numbers and the number is very large number(10,000) ten thousand digits,don't use any built-in functions?
- Muni September 11, 2014 in India| Report Duplicate | Flag | PURGE
Kaseya Java Developer Java - 0of 0 votes
AnswersWhat is out in System.out.println(). How can we redirect System.out.println to file than showing on console? Say we have
- newbee September 09, 2014 in United States
System.out.println("Hello World!!"). We want "Hello World!!" written to file than showing on console.| Report Duplicate | Flag | PURGE
Nook Senior Software Development Engineer Java - 0of 0 votes
AnswerHow can you handle uncheckedexceptions globally in project?
- Muni September 04, 2014 in India| Report Duplicate | Flag | PURGE
Java Developer Java - 0of 0 votes
Answers*
- Muni August 26, 2014 in India
* *
* * *
* * * * write a program in java??| Report Duplicate | Flag | PURGE
Java Developer Java - 0of 0 votes
AnswersDesign a shopping cart.
- User August 26, 2014 in United States| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Java - 0of 0 votes
AnswersNormally where singleton design pattern used in a project?
- Muni August 25, 2014 in India| Report Duplicate | Flag | PURGE
Java Developer Java - 0of 0 votes
Answerswhat is low level design and high level design in realtime java?
- Muni August 25, 2014 in India| Report Duplicate | Flag | PURGE
Java Developer Java - 0of 0 votes
Answerswhat are the top 10 coding standards/code reviews in java?
- Muni August 25, 2014 in India| Report Duplicate | Flag | PURGE
Accenture Java Developer Java - 0of 0 votes
AnswersSpring following by default singleton scope..so if we are using clone() is there anything happend?if anyone knows please tell me the answer
- Muni August 25, 2014 in India| Report Duplicate | Flag | PURGE
Java Developer Java - 0of 0 votes
AnswersHow to find non- common elements between two string arrays. Eg: String a[]={"a","b","c","d"};
- ananth.gorthi August 24, 2014 in India
String b[]={"b","c"};
O/p should be a,d| Report Duplicate | Flag | PURGE
Amazon SDE-2 Java - 0of 0 votes
AnswersJava runs on a "virtual" stack machine inside JVM, which has instruction of size of one byte (called byte-codes). How many instructions/bytecodes potentially can such a machine have?
- rahul23111988 August 22, 2014 in United States
PICK ONE OF THE CHOICES
256
Unlimited
2^32 for 32-bit machines
Depends on JVM version| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Java Operating System - 0of 0 votes
Answers[Phone screen]
- utopia August 12, 2014 in United States
Tell me about the Java Collections framework, what are its main interfaces. OK, what are the main differences between the Set and List interfaces? What do you give up if you go from a List to a Set, and what do you get in exchange for this if you go from a List to a Set? How would you go about guessing the order of an iteration() of HashSet if I told you I was going to insert the strings "first", "second", "third", "forth", and "fifth"?| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Java - 0of 0 votes
AnswersTell me about the Java Collections framework, what are its main interfaces. OK, what are the main differences between the Set and List interfaces? What do you give up if you go from a List to a Set, and what do you get in exchange for this if you go from a List to a Set? How would you go about guessing the order of an iteration() of HashSet if I told you I was going to insert the strings "first", "second", "third", "forth", and "fifth"?
- utopia August 12, 2014 in United States| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Java - 0of 0 votes
Answers[Phone screen]
- utopia August 12, 2014 in United States
Tell me what you know about the java.lang.Object class. OK, what are best practices for the equals method? How would you implement an equals method for a class with 100s of data fields?| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Java - 0of 0 votes
AnswersWrite a Program to find out Whether a given String can be a Palindrome i.e. we need to see for the palindrome after rearranging the words in that string.
- kuldeep2609singh August 12, 2014 in India
example: lets say we have a string "aabbccd" so it can be a palindrome after rearranging the words "abcdcba".
For this I need to find out the optimal solution.| Report Duplicate | Flag | PURGE
CGI-AMS Software Engineer / Developer Java - 0of 0 votes
AnswersWrite a Program to find out that a given String can be a Palindrome.we need to see for the palindrome after rearranging the words in that string.
- kuldeep2609singh August 12, 2014 in India
example: lets say we have a string "aabbccd" so it can be a palindrome after rearranging the words "abcdcba".
For this I need to find out the optimal solution.| Report Duplicate | Flag | PURGE
Java - 0of 2 votes
AnswersDesign a system like friend's functionality in facebook. should have all features of facebook's friends functionality. like for each person , he can have any number of friends , he will get suggestions for new firends , showing common friends if we visits any other profile . algo should be scalable , robust .
- gopi.komanduri August 02, 2014 in United States| Report Duplicate | Flag | PURGE
Computer Scientist Algorithm Android Application / UI Design Arrays Bit Manipulation C# C++ Cache Coding Computer Architecture & Low Level Data Mining Data Structures Database Distributed Computing Dynamic Programming Hash Table Java Large Scale Computing Linked Lists Math & Computation Object Oriented Design Problem Solving Sorting SQL Stacks System Design Trees and Graphs XML