Sapient Global Market Java Interview Questions and Coding Exercise

Munish Chandel | December 26, 2017 at 11:22 PM | 290 views


Skills Required

  1. Core Java

    • Polymorphism - overloading vs override, specifications for override, etc.

    • Inheritance - Abstract Classes, Interfaces, Casting classes, etc.

    • Generics - Upper bound, lower bound etc.

    • Multi-threading and Concurrency (must have) - wait() sleep() notify(), creating threads, Executors, volatile, Atomic package, Java Memory Model, Producer Consumer Problem, etc.

    • Collections (must have) - ArrayList, Vector, HashMap, ConcurrentHashMap, HashSet etc.

  2. Design Patterns and Design Skills

    • Creational Design Patterns - factory method, abstract factory etc.

    • Behavioral Design Patterns

    • Hands on Skills for coding exercise

  3. Database

    • Basic Knowledge of DB

    • Performance Tuning

  4. Unit Tests

    • Test Driven Development

    • Blackbox and Whitebox Testing

    • Automation Testing

    • System and Integration Testing

  5. Best Practices

    • Agile Methodology

    • Test Driven Development

    • DevOps

    • Continuous Integration

Sapient Global Market Java Interview Questions

  1. How do we synchronize a static method to prevent data corruption in concurrent update?

  2. How will you introduce multi-tasking in your java application?

  3. Design a program to search files inside a directory using multi-threadig?

  4. How will you implement a LRU timed cache in Java?

  5. There is a folder containing multiple SQL files. Each file’s name contain a sequence number which determines the execution order of that particular SQL script file. Design an API that will take such folder and execute the SQL in correct order.

  6. Difference between wait() and sleep() method?

  7. What is a deadlock situation? How will you handle deadlock in development and production environment?

  8. What is mechanism for inter-thread communication?

  9. Would adding multi-threading to sorting algorithm improve its performance?

  10. In what practical scenario’s multi-threading actually improves the performance of Java application?

  11. Do we need to synchronize getter and setter both to prevent concurrency related issues on a collection?

  12. Explain the key classes in java.util.concurrent package?

  13. What is purpose of ConcurrentHashMap?

  14. What is purpose of a Future? How will you use it?

  15. How will you create your own custom Thread Pool?

  16. What is a BlockingQueue?

Coding Exercise

  1. There is three file contains flight data. File data has in csv format. 1)Write a standalone program to search flight detail from all files depend on criteria 2)Criteria would be departure location,arrival location, flight date. 3)Program should follow\Oops principle. And right unit test case also. 4)Result should be in Ascending or descending order. 5)Data separated with pipe | .

    File A has data like below:
    FLIGHT_NUM|DEP_LOC|ARR_LOC|VALID_TILL|FLIGHT_TIME|FLIGHT_DURN|FARE
    AF299|FRA|LHR|20-11-2010|0600|4.10|480
    AF118|DUB|MUC|21-12-2010|1410|5.40|580
    AF371|AMS|MAD|30-11-2010|1210|3.45|320
    File B has data like below:
    FLIGHT_NUM|DEP_LOC|ARR_LOC_VALID_TILL|FLIGHT_TIME|FLIGHT_DURN|FARE
    BA123|DEL|AMS|12-10-2010|0050|8.00|950
    BA412|BOS|CDG|31-12-2010|0210|7.50|800
    BA413|BOS|AMS|30-11-2010|1530|7.00|750
    File C has data like below:
    FLIGHT_NUM|DEP_LOC|ARR_LOC_VALID_TILL|FLIGHT_TIME|FLIGHT_DURN|FARE
    LH348|DEL|AMS|30-11-2010|2325|11.00|1050
    LH201|LHR|MEL|21-11-2010|0230|15.30|1400
    LH342|VIE|JFK|20-10-2010|1130|14.20|980
  2. Coding Exercise for Designing Smart Card System for Delhi Metro. implement 'Metro Smart Card System' (MSCS) for Delhi city. For application assume there is a single metro line covering 10 stations linearly. The stations name are A1, A2, A3, A4, A5, A6, A7, A8, A9, A10 as shown below. The travel can be in any direction.

    Travelers have smart cards that behave just like any regular debit card that has an initial balance when purchased. Travelers swipe-in when they enter a metro station and swipe-out when they exit. The card balance is automatically updated at swipe-out.
    Objective of the exercise is to create an automated system that has following functionalities:
    2.1 Card should have a minimum balance of Rs 5.5 at swipe-in. At swipe-out, system should calculate the fare based on below strategies set at the start of the day. The fare must be deducted from the card.
    2.2 Card should have the sufficient balance otherwise user should NOT be able to exit.
         Weekday – Rs. 7 * (Number of stations traveled)
         Weekend – Rs. 5.5 * (Number of station traveled if it's Saturday or Sunday)
         (* there can be more such fare strategies in future)

Coding Exercise Evaluation Criteria

  1. Code Completeness/ Correctness

  2. Code Structure and quality: Modularity, usage of OO principles, size of classes/functions,

  3. Choice of data structures

  4. Unit Test cases

  5. Coding productivity (more time you take to submit the exercise, lesser you will score)

  6. class/function/variable names, package/class structure

Most of these questions has been answered in my eBook "Cracking the Core Java Interview"


Buy DRM Free PDF for Complete Collection of Interview Questions
Generic placeholder image
ebook PDF - Cracking Spring Microservices Interviews for Java Developers

This ebook discusses 120 plus real problems and their solutions for Spring microservices architecture based on Spring Boot, Spring Cloud, Cloud Native Applications. It covers core concepts of microservices architecture, various design patterns, interview questions & answers, security in microservices, testing strategies and best practices in distributed system design.

Free Email Updates
Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.


Similar Articles:
  1. Top 50 Java Interview Questions for Investment Banking Domain & HealthCare IT
  2. Sapient Global Market Java Interview Questions and Coding Exercise
  3. BlackRock Java Interview Questions
  4. RBS Java Interview Questions
  5. Citibank Java Interview Questions
  6. ION Trading Interview Questions
  7. UBS Java Interview Questions
  8. Morgan Stanley Java Interview Questions
  9. Java Topics covered in Investment Banking Intreviews (Morgan Stanley, Barclays, RBS, UBS, BlackRock)
  10. Goldman Sachs Java Interview Questions for Senior Java Developer

This website uses cookies to ensure you get the best experience on our website. more info