Professional Documents
Culture Documents
I was given a scenario where a given address object was being accessed and modified by
multiple threads. The question was how to modify the object to be thread safe.
How would you check if a string is a palindrome recursively?
How would you program Monopoly?
Explain how JSP works
given an array of integers, determine the integer closest to zero.e.g., array = 1, 2, 3, -2, 4;
the answer is 1.if the array contains both 1 and -1, the answer is the positive one
How do you process a set of log files if you don't have enough memory to do it?
Suppose you have a set objects, identified by a unique name. How do you store them so
that you can retrieve them easily?
Q2) Certain Customers buy kindle on day one and certain customers buy kindle on day
two. Design an algorithm(optimum) to find customers who bought on both days. Each
customer has a unique ID (Integer). (I forgot to consider case of duplicates,until she
reminded), You need to write complete code(NOT just pseudo code within given time and
read it out)
Given a String containing java-script assets, write a parser which will output the String
with proper indentation.
How would you implement a binary search algorithm for a tree-type data structure?
what is the difference between an interface and an abstract class?
In Data Structure, what's the difference between Tree and Array in term of FIFO and
LIFO ?
Here is a large chunk of code printed out on paper: find the errors
How are Observer and Observable used?
What is the common usage of serialization?
What are different types of inner classes?
State the significance of public, private, protected, default modifiers both singly and in
combination and state the effect of package relationships on declared items qualified by
these modifiers.
Describe the benefits of Spring and the role of the BeanFactory.
Write the function that calculates price of the cup of coffee where price of the condiments
depends on size of the coffee cup. For example milk cost 10 c for small cup 15 c for
medium and 20 c for large
Arrays vs. ArrayLists
What is the difference between a Class and an Interface in Java? Give examples to
explain.
Explain in Detail Compilation to Execution of a Java Program.
How would you design garbage collection in JVM if it was your task? Describe existing GC
algorithms.
You have a technical problem, you have to make the client aware, and you have to
propose alternatives/solutions on mitigating this
How can you ensure that something you pull out of a collection is the right type?
Design Loosely Coupled Classes on a given set of objects
Create a Java class that receives a collection of collections as parameter and provides
basic iterator functions, that is next() and hasNext().The inner structure (collection of
collections) must be hidden by the external interface. The next() method must thus iterate
over all the elements of all the collections, starting with the next one if the current ends.
How synchronization is helpful in multithreading?
Write an API method to reverse a string
What is the difference between C++ and Java?
Please code up and send me a function that takes two integer arrays and returns their
intersection. This answer must take less than n^2 time.
Basic Java questions, SLDC, role of every phase of SDLC, how accquainted i was with every
phase, my previous project experience, etc
Executor framework in java.util.concurrent framework
How do you plan JVM for a web application ?
How would you implement capturing a bit stream of input coming in from a device in
Java?
What are inner classes? When they should be used?
What is stack overflow and why does that occur?
Explain the concept and working of garbage collector in Java.
What is the difference between abstract class and interface? when do you need to use
abstract and when do you need to use interface in java?
Describe the singleton pattern in Java.
When using an ArrayList as the implementation for a list collection, what happens if
adding an element exceeds the ArrayList's capacity?
Which one of the following is NOT polymorphic behavior?does java.io have for preventing
malicious code from altering Serialized Objects?What support does java.io have for
preventing malicious code from altering Serialized Objects?
Implement a sparse matrix Java class with a constructor, set and get method. The matrix
has millions of rows and columns and is at a maximum 15% populated.
What languages do you use to code?
How would you find the shortest path between two nodes in a graph? Write code in Java to
do this.
Come up with a priority queue implementation in Java on the whiteboard.
Some linkedlist related classes and methods.
What's the difference between synchronized and volatile in Java?
Sample questions concerning Java or SQL.
What does AWT stands for?
A basic 'how do you prevent a race condition' question.
You have a class in Java and you would like to know how many instances of it exist at any
given time. How would you do this?
What are the different scopes for Java variables?
GC strategies in the JVM
What is the difference between Private, Protected, and Public when applied to members of
a Java class? What is Package Scope?
Given the root node of a tree, write two Java programs to visit all nodes of the tree, one in
a depth-first fashion and the other in a breadth-first fashion, both without using recursion.
Assume a node is represented by a class named Node, which has a method children() that
returns a list of child nodes. Call node.visit() to visit a node.
Write a function in Java that will take a sorted array of ints, possibly with duplicates, and
compact the array removing all the duplicate numbers. That is, if the contains the numbers
- 1, 3, 7, 7, 8, 9, 9, 9, 10, then when the function returns, the contents should be - 1, 3, 7, 8,
9, 10. Be sure your answer is as efficient as possible. Describe the efficiency of your
algorithm using big O notation.
Solve a coding problem in Java. You're given a laptop and 2 hours.
In a Unix environment what are the top 3-5 considerations for performance monitoring a
Java application that has access to a local Oracle instance (located on the same server).
Please be as specific as possible (i.e. commands, locations, etc.)
Programming test on a machine without internet access
What different (javascript / css) libraries do you use and why? What are the benefits you
see from using these?
What is an immutable class?
Status
API
Training
Shop
Blog
About
2015 GitHub, Inc.
Terms
Privacy
Security
Contact