Sapient Global Market Java Interview Questions and Coding Exercise

Munish Chandel | March 30, 2019 at 07:39 AM | 569 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:
    File B has data like below:
    File C has data like below:
  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"

You may also be interested in..
Generic placeholder image
ebook PDF - Cracking Spring Microservices Interviews for Java Developers
You may also be interested in..
Generic placeholder image
ebook PDF - Cracking Java Interviews v3.4 by Munish Chandel

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