Sunday, April 19, 2015

Barclay Java Interview Questions


  1. What is an Immutable Class ? Why is it important in multi-threading context ? Can you write a Custom immutable class ? What are semantics for writing an Immutable Class in java ?
  2. How will you use your custom Object as a Key inside hashing datastructure (Hashmap, ConcurrentHashmap, hashSet, etc.)?
  3. Explain the working of put and get method of a hashmap class ? How does equals() and hashcode() comes into picture there ?
  4. What is difference between Executor Framework and ForkJoinPool ?
  5. What is difference between Executor.submit() and Executor.execute() method ?
  6. Write a code to iterate over a standard hashmap object in Java.
  7. What all things to keep in mind when you use Hashmap in multi-threaded environment ?
  8. What is difference between sleep() and wait() method ?
  9. What is Composite Design Pattern ?
  10. Write a code in java to remove elements of an array while iterating over it.
  11. What is ThreadLocal variable in Java ?
  12. What is pass-by-value and pass-by-reference ? Which mechanism is being used by Java ?
  13. Discuss through example, The Producer Consumer problem.
  14. Discuss how HashSet works internally in java ?
  15. Explain database normalization and its various usages.
  16. What are top 10 coding standards for code reviews in Java ?
  17. Write a recursive Java program to print Fibonacci Series ?
  18. How will you design a distributed algorithm for Prime Number generation in Java ? Discuss the Design only.
  19. How Garbage Collection works in Java, explain the underlying mechanism for any one of the Garbage Collector ? Give few names of existing garbage collectors ?

hCentive Java Interview Questions

Multi-threading Questions
  1. What do you understand by thread-safety ? What are various mechanisms to achieve thread-safety in java ?
  2. How will you design your own ReentrantReadWriteLock class where one thread can write and  many threads can read in parallel ? How does it affect the throughput of a multi-threaded system ?
  3. What are various methods to acquire lock in java ? discuss their comparison.
  4. How to avoid deadlock in your application ?
  5. How is ConcurrentHashMap better than hashmap in java ?
General Java
  1. What are different memory generations in Java ? What is Stack and heap memory ?
  2. Write a thread-safe Singleton Java Class.
  3. What is difference between hashtable, hashmap and Concurrenthashmap in java ?
  4. What is difference between Iterator and ListIterator in Java ?
  5. What is Immutable Class ? What is reason behind using a Immutable class in your application ?
  6. What is difference between String, StringBuffer and StringBuilder ?
  7. What is difference between CheckedException and UncheckedException ? Give some example of RuntimeException ?
Spring Framework
  1. What are different Bean scopes in Spring ? What is the default bean scope ?
  2. How many objects Spring container creates for a given bean definition ?
  3. What is Bean Lifecyle ?
  4. How do you encrypt a password in spring security ?
  5. Describe practical use of Spring Interceptors ?
  6. What is Servlet LifeCycle ?
  7. How do you declare a custom error page in Spring ?
  8. What is difference between doGet() and doPost() methods ?
  9. What is difference between Forward and Redirect ?

Saturday, April 18, 2015

There is a pricing service which connects to Reuters & Bloomberg and fetches the latest price for the given Instrument Tics. There could be multiple price events for the same Stock and we need to consider the latest one. Design a service to show prices for the Top 10 stocks of the Day ?

Black Rock Java Interview Questions

Design Problem
  1. There is a pricing service which connects to Reuters & Bloomberg and fetches the latest price for the given Instrument Tics. There could be multiple price events for the same Stock and we need to consider the latest one. Design a service to show prices for the Top 10 stocks of the Day ? Solution is discussed in eBook
  2. There is a very Big file containing many words, how will you read and process it to print the below information ?
    a) Top 10 ranked distinct words.
    b) Occurrence of each Alphabet in the file.
  3. How will you implement a Stack using a Queue ?
  4. How will you implement a Queue using a Stack ?
  5. How will you design a two way Elevator Software for a building ?
  6. What is Immutability ? How will you make a class Immutable in Java ?
  7. How will you achieve thread-safety in your Java Program ?
  8. What are the ways to increase throughput of a multi-threaded java program ? (concurrency enhancements - use java.util.concurrent package, connection pooling, other resource pooling, caching, GC tuning, etc.)
  9. How will you troubleshoot poor memory performance of a live production program ?
  10. How will you find a single duplicate number from a large array in minimum time ?