Java Interview Questions
- 0of 0 votes
AnswersGiven a 1D array with integers,print vertical bars of # such that if a[i] = n, then print # n times from the bottom.
- bestluck March 10, 2015 in United States
For eg, {1,4,3,2}
o/p : #
# #
# # #
# # # #| Report Duplicate | Flag | PURGE
Amazon Software Engineer Intern Java - 0of 0 votes
AnswersSimple java code to print a character.the character should be printed according to users height and width.
- Poornima March 07, 2015 in India
ex:h=5,w=3| Report Duplicate | Flag | PURGE
xyz Software Developer Java - 0of 0 votes
AnswersOne classic method for composing secret message is called a Square code. The spacesare removed from the english text and the characters are written into a square or rectangle.
- Poornima March 04, 2015 in United States
For example the sentence "If man was meant to stay on the ground god would have given us roots" is 54 characters long. So it is written into a rectangle with 7 rows and 8 columns.
ifmanwas
meanttos
tayonthe
groundgo
dwouldha
vegivenu
sroots
The coded message is obtained by reading down the columns going left to right.
For example the message above is coded as:
imtgdva fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
In your program, have the user enter a message in english, remove the spaces and then build the square code and display the output..| Report Duplicate | Flag | PURGE
Java - 0of 0 votes
AnswersFind a longest string which contain continues alphabets in a jumbled letters of a string. For ex: I/O="asdbcdefgmnxyz" O/P="bcdefg".
- Poornima March 04, 2015 in United States| Report Duplicate | Flag | PURGE
Java - 0of 0 votes
Answerswrite a program in java to take the i/p as "aaahhrrrvfuuk" and return the o/p as "a3h2r3vfu2k"
- Poornima March 03, 2015 in United States| Report Duplicate | Flag | PURGE
Java - 2of 2 votes
AnswerThe problem gives you a sample input data file containing the all the employee-employer relationship information of a company. For example "Peter, John, 2013, software developer--John, NULL, 2012, CEO--David, Peter, 2014, technician..." means there are 3 people int this company (segmented by '--' ), the first 1 is Peter, his boss is John, he entered the company in 2013 as a software developer. The second is John as CEO, with no boss, the third is David as technician, his boss is Peter. The problem is asking to output information in hierarchy style
- dknguyen13 February 28, 2015 in United States| Report Duplicate | Flag | PURGE
unknown Software Developer Java - 2of 2 votes
AnswersYou have a function rand5(). This function returns numbers between 1 and 5 randomly with equal probability. Implement a function rand7() which makes use of rand5 to return a number between 1 and 7 randomly with equal probability.
- reddygokul.i7 February 27, 2015 in India| Report Duplicate | Flag | PURGE
Intern Algorithm Arrays Java Python - 0of 0 votes
AnswersThe SHIELD is a secretive organization entrusted with the task of guarding the world against any disaster. Their arch nemesis is the organization called HYDRA. Unfortunately some members from HYDRA had infiltrated into the SHIELD camp. SHIELD needed to find out all these infiltrators to ensure that it was not compromised.
- reddygokul.i7 February 26, 2015 in India
Nick Fury, the executive director and the prime SHIELD member figured out that every one in SHIELD could send a SOS signal to every other SHIELD member he knew well. The HYDRA members could send bogus SOS messages to others to confuse others, but they could never receive a SOS message from a SHIELD member. Every SHIELD member would receive a SOS message ateast one other SHIELD member, who in turn would have received from another SHIELD member and so on till NickFury. SHIELD had a sophisticated mechanism to capture who sent a SOS signal to whom. Given this information, Nick needed someone to write a program that could look into this data and figure out all HYDRA members.
Sample Input
Nick Fury : Tony Stark, Maria Hill, Norman Osborn
Hulk : Tony Stark, HawkEye, Rogers
Rogers : Thor,
Tony Stark: Pepper Potts, Nick Fury
Agent 13 : Agent-X, Nick Fury, Hitler
Thor: HawkEye, BlackWidow
BlackWidow:Hawkeye
Maria Hill : Hulk, Rogers, Nick Fury
Agent-X : Agent 13, Rogers
Norman Osborn: Tony Stark, Thor
Sample Output
Agent 13, Agent-X, Hitler
You can code in any language of your choice. Input and Output must be in the same format as above| Report Duplicate | Flag | PURGE
xyz Algorithm C++ Java Python - 0of 0 votes
AnswersIn a single pass, find Nth node from last in a Linked List.
- Sunny February 24, 2015 in United States for java
{ N can be any value. }| Report Duplicate | Flag | PURGE
Student Intern Algorithm Java - -2of 2 votes
AnswerGarbage collection in java
- poojaarora014 February 22, 2015 in India| Report Duplicate | Flag | PURGE
Deshaw Inc SDET Java - 0of 2 votes
AnswersWe have a folder containing around 10000 files and each file having size greater than 2 GB.These files contain three fields namely date,users and their names.
- bornfromashes2011 February 10, 2015 in United States
How can we get the count of all unique users from 10000 files?| Report Duplicate | Flag | PURGE
Java - 3of 3 votes
AnswersHow to find efficiently the minimum of an array of integers that is the maximum of other arrays?
- wingchun0511 January 31, 2015 in France
Example:
A = [126, 110, 130]
B = [125]
C = [105, 115]
The minimum element of array A that is the maximum of B and C is 126| Report Duplicate | Flag | PURGE
Java Developer Algorithm Coding Java Online Test - 0of 0 votes
AnswersYou are given a list of strings
- rao January 28, 2015 in United States for Legal
/flapp/server/apache
/d/apps
/d/apps/pub
/flapp
/flocal/firms
/d/sw/java
/d/sw/orcl/jdbc
The filtered strings shoud be
/flapp
/d/apps
/d/sw/java
/d/sw/orcl/jdbc
/flocal/firms
You have to identify the problem/requirement and provide solution that can work for any input with similar pattern.| Report Duplicate | Flag | PURGE
Thomson Reuters Senior Software Development Engineer Algorithm Java Puzzle - 0of 0 votes
AnswersI have interview with Ericsson:
- nilofaraziz9 January 08, 2015 in United States
Working knowledge of server-side JavaScript
Working knowledge of WSDL, XSD and XML
Working knowledge of workflow concepts such as BPM, BPMN, BPML and BPEL.
Working knowledge of HTML
Working knowledge of integration technologies/frameworks including AXIS, SOAP, JMS, HTTP, Socket, FTP, SMTP/POP and integration platforms (EAI, ESB, BPI) such as JMS, MQ, WLI and Tibco
Good design skills
please help if anyone gone through interview process of Ericson.| Report Duplicate | Flag | PURGE
Java - 0of 0 votes
AnswersA program that prints all combinations of a n letter word without using recursion technique.
- ujirani123 January 07, 2015 in India
Example :
Word : abcd
abcd
bacd
cabd
acbd
bcad
cbad
dbac
bdac
adbc
dabc
badc
abdc
acdb
cadb
dacb
adcb
cdab
dcab
dcba
cdba
bdca
dbca
cbda
bcda| Report Duplicate | Flag | PURGE
Java - -5of 5 votes
AnswersHaving A List of int [1,1,1,3,1,2,1,1,4,1]
- NullVoid December 31, 2014 in India for ERP
Output needed [1,5,6,3,7,2,8,9,4,10]
Note: Need not to change value of 3,2,4| Report Duplicate | Flag | PURGE
N/A Software Engineer / Developer Arrays Java Linked Lists - 0of 0 votes
AnswersImplement a Singleton class in java? How will this help?
- pbsureja December 19, 2014 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer Intern Java - 0of 0 votes
AnswersA server receives requests from different clients...each client send a Runnable job and time on which this job should be run. Write a java program that would accept these jobs and run each job at the required time. Hint: the solution should have a job priority queue to hold the jobs and it should be multithreaded. One thread should accept the tasks, the other one should run the jobs. Also conditions and signalling will be used
- koks2000 December 09, 2014 in United States| Report Duplicate | Flag | PURGE
Linkedin Software Engineer Intern Java Threads - 1of 1 vote
AnswersYou have a class that many libraries depend on. You need to modify the class for one application. Which of the following changes require recompiling all libraries before it is safe to build the application?
- manojkumar16 December 04, 2014 in India
a. add a constructor
b. add a data member
c. change destructor into virtual
d. add an argument with default value to an existing member function| Report Duplicate | Flag | PURGE
Walmart Labs Applications Developer Java - -1of 1 vote
AnswersDo thread join without join function?
- manojkumar16 December 04, 2014 in India| Report Duplicate | Flag | PURGE
Walmart Labs Applications Developer Java - 0of 0 votes
Answershow to sent buffer limit in BufferedReader/ BufferedWriter class
- mdfirozansari December 03, 2014 in India| Report Duplicate | Flag | PURGE
HCL Product Security Engineer Java - 0of 0 votes
AnswersHow to implement thread safety in java without using synchronized method?
- mdfirozansari December 03, 2014 in India| Report Duplicate | Flag | PURGE
HCL Product Security Engineer Java - 0of 0 votes
AnswersChinese chess has 8*8=64 cells.And the point is (1,1),(1,2),..............(8,8).And the horse walks by diagonal line of two cells from where point it is.Calculate the shortest step(s) between two points for the horse to walk. Eg. (1,1) to (4,4). Horse go like this (1,1)>(2,3)>(4,4)
- MakeMe November 28, 2014 in United States| Report Duplicate | Flag | PURGE
Notfamous Developer Program Engineer Java - 0of 0 votes
AnswersChinese chess has 8*8=64 cells.And the point is (1,1),(1,2),..............(8,8).And the horse walks by diagonal line of two cells.Calculate the shortest step(s) between two points for the horse to walk. Eg. (1,1) to (4,4). Horse go like this (1,1)>(2,3)>(4,4)
- MakeMe November 28, 2014 in United States| Report Duplicate | Flag | PURGE
Notfamous Developer Program Engineer Java - 0of 0 votes
AnswersWrite a program to read file of following data structure: Name: favcolor=blue Find out which color is favorite by most people (print the color and number of people)
- KH November 06, 2014 in United States| Report Duplicate | Flag | PURGE
Software Engineer / Developer Java - 0of 0 votes
AnswersHow many minimum numbers from fibonacci series are required such that sum of numbers should be equal to a given Number N?
- abdulhameed.pathan November 03, 2014 in India
Note : repetition of number is allowed.
Example1.
N= 7;
answer = 2 (5 + 2 = 7)
Example 2.
N = 70;
Answer = 3 (34 + 34 + 2)| Report Duplicate | Flag | PURGE
Alcatel Lucent Java Developer Brain Teasers Java - 0of 0 votes
AnswersGiven an array of paper products in which each product has an attribute name, width, and height, and given a sheet of paper that has width xx and height yy, write a program that returns the number of sheets of paper needed to print out the array of paper products
- emptypeace October 24, 2014 in United States| Report Duplicate | Flag | PURGE
Vistaprint Software Engineer / Developer Algorithm Java - 4of 6 votes
AnswersWrite a program to implement Double Linked List from Stack with min. complexity.
- Purushotham Kumar October 20, 2014 in United States| Report Duplicate | Flag | PURGE
Google Software Engineer Intern Data Structures Java Linked Lists Stacks - -1of 1 vote
AnswersHow to implement split () method
- kirann October 17, 2014 in United States| Report Duplicate | Flag | PURGE
Java Developer Algorithm Java