Java Interview Questions
- 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 - 0of 0 votes
Answerswhat is the difference between internal repository and internet repository?
- Muni July 09, 2014 in India| Report Duplicate | Flag | PURGE
Infosys Software Engineer / Developer Java - 0of 0 votes
Answerswhat about your project performance...how can i answer this question?
- Muni July 08, 2014 in India| Report Duplicate | Flag | PURGE
Infosys Software Engineer / Developer Java - 0of 0 votes
AnswersHow to convert http to https in java....can anyone knows please tell me?
- Muni July 08, 2014 in India| Report Duplicate | Flag | PURGE
Infosys Software Engineer / Developer Java - 2of 2 votes
AnswersGiven a String with print all the possible combinations of the all the characters in the string as a string for Example
- Anirudh July 05, 2014 in India
"abc" is the input the you should print the below:
abc
ab
ac
a
bc
b
c
There is one invisible string which is actually a blank string.| Report Duplicate | Flag | PURGE
Komli Media SDET Java - 0of 0 votes
AnswersGiven a string that contains exactly a single pair of parenthesis, return parenthesis and their contents, so "xyz(abc)123" yields "(abc)". etc.
- Anirudh July 03, 2014 in India
Condition: You are not allowed to use a variable anywhere, Regex is not allowed.| Report Duplicate | Flag | PURGE
Ibibo Software Engineer / Developer Java - 0of 0 votes
AnswersGiven a string that contains exactly a single pair of parenthesis, return parenthesis and their contents, so "xyz(abc)123" yields "(abc)". etc.
- Anirudh July 03, 2014 in India
Condition: You are not allowed to use a variable anywhere.| Report Duplicate | Flag | PURGE
Ibibo Software Engineer / Developer Java - 0of 0 votes
AnswersString="welcome bangalore" i want erolagnab welcome how to reverse this string..can anyone knows pls answer this one.
- Muni June 30, 2014 in India| Report Duplicate | Flag | PURGE
Java
Open Chat in New Window