Implement a queue using only stacks.
Senior Software Developer Java J2ee Interview Questions
97,971 senior software developer java j2ee interview questions shared by candidates
public class WhichReturns{ public String whichReturns(){ try{ return "1"; }finally{ return "2"; } public static void main(String argv){ System.out.println("Return val: " + WhichReturns.whichReturns()); } }
I had not expected to be asked logic questions, which made me nervous. The first one was a weigh nine items on a balancing scale to find the odd one out in the fewest scale uses
I was asked to write a program to find common items between 2 lists.I used java to write the program. I wrote the program which was iterating the smaller array list and used contains. The Hiring manager argues with me saying that the code is not efficient enough because 'contains' method on arraylist would lead to o(n) and that would result in O(m*N)(which is incorrect) In the interview, I was not able to google it and I was taken aback when he was talking so assertively as I assumed that he understands java. However, after I hung up the phone I realized that I am indeed right and that the algorithm I created was very efficient. The interviewer came to the interview with a view to reject me. Its a waste of time. They should let subject mattter experts do the interviews, not the people with background in c/C++ interview java guys or the other way round. The hiring manager seemed very professorial background. I tried to tell recruiter to let them know the problem, but I do not think even she has any clue on how to approach.
Given an array of numbers [1,3,3,5,9,4,1,10,9,7,2,7], Write a php function that will print numbers that are not duplicated in array. [5,4,10,2]
Write an algorith to print a series of roman numerals.
Given a positive integer N, write a function to return a list of the first N fibonacci numbers in order. For example, if N=5, the output list is 0 1 1 2 3.
Is this valid/what would this do (C): int *p; p=0; p++; printf("%d",p);
How do you write an algorithm to count all subsets of strings in a string.
Java question was around String pattern searching which you can do easily in around 20 minutes, if you can keep your mind calm where that clock is also ticking.
Viewing 111 - 120 interview questions