Interview Questions and Answers for 'Mastercard' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Mastercard' - 8 question(s) found - Order By Newest

 Q1. What are the benefits of using Spring Framework ?Spring
Ans. Spring enables developers to develop enterprise-class applications using POJOs. The benefit of using only POJOs is that you do not need an EJB container product.

Spring is organized in a modular fashion. Even though the number of packages and classes are substantial, you have to worry only about ones you need and ignore the rest.

Spring does not reinvent the wheel instead, it truly makes use of some of the existing technologies like several ORM frameworks, logging frameworks, JEE, Quartz and JDK timers, other view technologies.

Testing an application written with Spring is simple because environment-dependent code is moved into this framework. Furthermore, by using JavaBean-style POJOs, it becomes easier to use dependency injection for injecting test data.

Spring is web framework is a well-designed web MVC framework, which provides a great alternative to web frameworks such as Struts or other over engineered or less popular web frameworks.

Spring provides a convenient API to translate technology-specific exceptions (thrown by JDBC, Hibernate, or JDO, for example) into consistent, unchecked exceptions.

Lightweight IoC containers tend to be lightweight, especially when compared to EJB containers, for example. This is beneficial for developing and deploying applications on computers with limited memory and CPU resources.

Spring provides a consistent transaction management interface that can scale down to a local transaction

  Sample Code for spring

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   spring framework   mvc   spring container   architecture   technical architect   java architect   technical lead  ioc     Asked in 2 Companies      basic        frequent


 Q2. How to implement an immutable class ?Core Java
Ans. We can make a class immutable by

1. Making all methods and variables as private.

2. Setting variables within constructor.

Public Class ImmutableClass{

private int member;
ImmutableClass(int var){
member=var;
}
}

and then we can initialize the object of the class as

ImmutableClass immutableObject = new ImmutableClass(5);

Now all members being private , you cant change the state of the object.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   oops   immutable  immutability   immutable  immutability class   technical lead     Asked in 5 Companies      intermediate        frequent

Try 2 Question(s) Test


Very frequently asked. Favorite question in Walk in Drive of many Indian service companies.
  Q3. What is a Final Variable ?Core Java
Ans. Final variable is a variable constant that cannot be changed after initialization.

  Sample Code for final variable

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     oops   java   final   final variable   basic interview question     Asked in 12 Companies      basic        frequent

Try 1 Question(s) Test


 Q4. How to find the median number in an array of integers ?Core Java
Ans.

Arrays.sort(numArray);
double median;
if (numArray.length % 2 == 0)
   median = ((double)numArray[numArray.length/2] (double)numArray[numArray.length/2 - 1])/2;
else
   median = (double) numArray[numArray.length-1/2];

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     coding     Asked in 2 Companies


  Q5. Explain OOps concepts.Core Java
Ans. There are four main OOP concepts in Java. These are:

Abstraction. Abstraction means using simple things to represent complexity. We all know how to turn the TV on, but we don?t need to know how it works in order to enjoy it. In Java, abstraction means simple things like objects, classes, and variables represent more complex underlying code and data. This is important because it lets avoid repeating the same work multiple times.

Encapsulation. This is the practice of keeping fields within a class private, then providing access to them via public methods. It?s a protective barrier that keeps the data and code safe within the class itself. This way, we can re-use objects like code components or variables without allowing open access to the data system-wide.

Inheritance. This is a special feature of Object Oriented Programming in Java. It lets programmers create new classes that share some of the attributes of existing classes. This lets us build on previous work without reinventing the wheel.

Polymorphism. This Java OOP concept lets programmers use the same word to mean different things in different contexts. One form of polymorphism in Java is method overloading. That?s when different meanings are implied by the code itself. The other form is method overriding. That?s when the different meanings are implied by the values of the supplied variables. See more on this below.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     oops  oops concepts     Asked in 16 Companies      basic        frequent


  Q6. What is collection framework in Java ?Core Java
Ans. The Java collections framework (JCF) is a set of classes and interfaces that implement commonly reusable collection data structures. Although referred to as a framework, it works in a manner of a library. The JCF provides both interfaces that define various collections and classes that implement them.

  Sample Code for Map

  Sample Code for HashMap

  Sample Code for Treemap

  Sample Code for set

  Sample Code for hashset

  Sample Code for treeset

  Sample Code for list

  Sample Code for arraylist

  Sample Code for linkedlist

  Sample Code for queue

  Sample Code for priorityqueue

  Sample Code for concurrenthashmap

  Sample Code for vector

  Sample Code for stack

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     collections     Asked in 9 Companies      basic        frequent


 Q7. Why do you want to leave your current job ?General
Ans. The most effective and acceptable reasons for leaving your current job should be positive e.g. moving forward in your life or career

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 21 Companies


 Q8. What methodology and technology stack do you use ?General
Ans. [Open Ended Answer]

Possible Answer - We are using Agile. We have daily standups, Bi weekly Backlog Grooming , Planning and Retrospective, We have a 2 week sprint and We use Jira for Scrum Management. We are using Java 8, Spring Boot, JSF , Apache Kafka , Soap as well as Rest Services.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 9 Companies



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: