Wells Fargo Java Interview Questions

As part of job search I have attended interview in couple of companies Wells Fargo is one among them. Here I am placing the list of interview questions which I have faced in a conference round of interview. I hope this will definitely help someone who is attending on below mentioned skill set.

Java

Microservices

Spring Boot

Spring Cloud

Pivotal Cloud Foundry(PCF)

Questions:

  1. Could you please explain about your techstack and previous project?
  2. Let’s start with Core Java:

  3. What is the output of below program?
  4. class A{
       private void method1(){
          System.out.println("Inside A method");
       }
    }
    class B extends A{
       public void method1(){
          System.out.println("Inside B method");
       }
    }
    public class Test{
       public static void main(String[] args){
           A a = new B();
           a.method1();
       }
    }
    
  5. Is above program violating the rules of Overriding or not?
  6. When do you go for Interface and abstract class?
  7. From Java 8 on wards, we are able to implement methods in interface. Then what is the need of Abstract Class?
  8. What all java 8 concepts you aware?
  9. What is functional interface and how it is different from normal interface?
  10. Have you worked on multithreading?
  11. How can you communicate from one thread to another?
  12. How thread pool works?
  13. What all the classes and interfaces you worked in Collection framework?
  14. How HashMap works internally?
  15. In Java 7, there are few changes came in HashMap. Do you know what are those?
  16. If I have two keys(Key1=1, Key2=10) with same hashcode, What will happen when we try to put int HashMap?
  17. How TreeSet can store elements in order?
  18. I have custom objects of Student. What should I do to store them in ascending order in TreeMap? TreeMap will take care internally or do I need to write logic for sorting?
  19. When we use Comparable and Comparator?
  20. Coming to WebServices, Spring, Spring Boot, Spring Cloud and Microservices:

  21. Have you worked on REST(REpresentational State Transfer) WS?
  22. How can you convert the JSON data into Java Object?
  23. How can you consume the endpoint from UI?
  24. What are different modules you worked in Spring framework?
  25. Can you explain me the steps how MVC works in Spring and Spring Boot?
  26. What are the advantages of using @RestController over @Controller?
  27. In normal Spring MVC, which you prefer to use either @RestController or @Controller? Why?
  28. What are the advantages of using Spring Boot?
  29. Do you know, how configuration will take care automatically in Spring Boot? Or Do you know, how autoconfiguration works in Spring Boot?
  30. When we declare web module in pom.xml, it download all the related dependencies(JAR’s). How it will identify, which jar is for which module?
  31. How can we run Spring Boot application?
  32. Which is the default server uses in Spring Boot? Does it require any configurations to add?
  33. If server is down, instead of showing default error message, we need to show Custom message. How will you do?
  34. Have you worked on feignClient?
  35. What are different tools you worked on Spring Cloud?
  36. Have you used inline DB?
  37. Do we need to provide any configuration details to use inline DB?
  38. Have you worked on WebLogic?
  39. Coming into PCF:

  40. What is Diego? what it will do?
  41. Can you explain about 12 factor apps?
  42. While pushing application into pivotal, which way you followed? direct or with manifest?
  43. We have different environments with different configurations like Development, Staging and Prod. How will you build and push application into different environments?
  44. I have a monolithic application, how can you push that into pivotal?
  45. My application data source configuration properties are placed in WebLogic server. How will you take care of those while pushing application into pivotal?
  46. Have you used any of User provided services?
Thanks for visiting. If anyone else has extra questions which you people faced, please write in comment.

Codility Division Sequence Challenges in Java

This is one of the challenge I have completed in online coding test taking in Codility in Java.

Problem:

The actual problem given to me is, input N is given as random number, I need to find out each number is divisible with 2, 3 and 5. If input N is divisible by 2, 3 and 5, I need to print output as TWO, THREE and FIVE accordingly. If N is divisible by 2 and 3, then need to print output as TWOTHREE. The same will be applicable for others.

If the number is not divisible with any of 2, 3 and 5 then I need to print the number as it is in the output. The sample output would be look like,

Output:

1

TWO

THREE

TWO

FIVE

TWOTHREE

7

Solution:

Here I have placed the source code which will be compatible with Java technology and which meets to all conditions mentioned in above problem. As per my knowledge I have written this code. If anyone can solve in a better way, please share your source code in a comment.

public class DivisionSequence {
 static int input = 24;

 public static void main(String[] args) {
  for (int i = 1; i <= input; i++) {
   if (i % 2 == 0) {
    System.out.print("TWO");
    if (i % 3 == 0) {
     System.out.print("THREE");
    }

    if (i % 5 == 0) {
     System.out.print("FIVE");
    }
    System.out.println();
    continue;
   }

   if (i % 3 == 0) {
    System.out.print("THREE");
    if (i % 2 == 0) {
     System.out.print("TWO");
    }

    if (i % 5 == 0) {
     System.out.print("FIVE");
    }
    System.out.println();
    continue;
   }

   if (i % 5 == 0) {
    System.out.print("FIVE");
    if (i % 2 == 0) {
     System.out.print("TWO");
    }

    if (i % 3 == 0) {
     System.out.print("THREE");
    }
    System.out.println();
    continue;
   } else {
    System.out.println(i);
   }
  }
 }
}

Actual Output:

1
TWO
THREE
TWO
FIVE
TWOTHREE
7
TWO
THREE
TWOFIVE
11
TWOTHREE
13
TWO
THREEFIVE
TWO
17
TWOTHREE
19
TWOFIVE
THREE
TWO
23
TWOTHREE

Note: I have taken number 24 as input, you can pass any number as input this program will work for that. All the very best… 🙂