Interview Questions and Answers for 'Amdocs' | 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 'Amdocs' - 35 question(s) found - Order By Newest

next 30
Very frequently asked. Among first few questions in almost all interviews. Among Top 5 frequently asked questions. Frequently asked in Indian service companies (HCL,TCS,Infosys,Capgemini etc based on multiple feedback ) and Epam Systems
  Q1. Difference between == and .equals() ?Core Java
Ans. "equals" is the method of object class which is supposed to be overridden to check object equality, whereas "==" operator evaluate to see if the object handlers on the left and right are pointing to the same object in memory.

x.equals(y) means the references x and y are holding objects that are equal. x==y means that the references x and y have same object.

Sample code:

String x = new String("str");
String y = new String("str");

System.out.println(x == y); // prints false
System.out.println(x.equals(y)); // prints true

  Sample Code for equals

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

   Like         Discuss         Correct / Improve     java   string comparison   string   object class   ==    equals   object equality  operator   == vs equals   equals vs ==     Asked in 294 Companies      basic        frequent

Try 6 Question(s) Test


  Q2. Explain OOPs

or

Explain OOPs Principles

or

Explain OOPs Concepts

or

Explain OOPs features

or

Tell me something about OOPs
Core Java
Ans. OOPs or Object Oriented Programming is a Programming model which is organized around Objects instead of processes. Instead of a process calling series of processes, this model stresses on communication between objects. Objects that all self sustained, provide security by encapsulating it's members and providing abstracted interfaces over the functions it performs. OOP's facilitate the following features

1. Inheritance for Code Reuse
2. Abstraction for modularity, maintenance and agility
3. Encapsulation for security and protection
4. Polymorphism for flexibility and interfacing

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

   Like         Discuss         Correct / Improve     oops  oops features     Asked in 260 Companies      basic        frequent


Very Frequently asked to fresh graduates and less experienced. Favorite question in Walk in drives. Frequently asked in Indian Services companies.
  Q3. Difference between Overloading and Overriding ?Core Java
Ans. Overloading - Similar Signature but different definition , like function overloading.

Overriding - Overriding the Definition of base class in the derived class.

  Sample Code for overloading

  Sample Code for overriding

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

   Like         Discuss         Correct / Improve     java   oops   overloading   overriding   oops concepts   basic interview question   overloading vs overriding     Asked in 86 Companies      basic        frequent

Try 1 Question(s) Test


Very frequently asked.Usually among first few questions.
  Q4. What is MVC ? Design
Ans. MVC is a Design Pattern that facilititates loose coupling by segregating responsibilities in a Web application

1. Controller receives the requests and handles overall control of the request
2. Model holds majority of the Business logic, and
3. View comprise of the view objects and GUI component

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

   Like         Discuss         Correct / Improve     j2ee   mvc   mvc design pattern   design pattern   struts   spring   web application   web frameworks   ebay     Asked in 60 Companies      basic        frequent

Try 1 Question(s) Test


Frequently asked to fresh graduates and less experienced.
  Q5. Difference between Composition and Inheritance ?Core Java
Ans. Inheritance means a object inheriting reusable properties of the base class. Compositions means that an abject holds other objects.

In Inheritance there is only one object in memory ( derived object ) whereas in Composition , parent object holds references of all composed objects.

From Design perspective - Inheritance is "is a" relationship among objects whereas Composition is "has a" relationship among objects.

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

   Like         Discuss         Correct / Improve     java   oops   oops concepts   inheritance  object oriented programming (oops)  oops concepts   composition  object oriented programming (oops)  oops concepts   difference between   basic interview question     Asked in 12 Companies      basic        frequent

Try 2 Question(s) Test


 Q6. How to find whether a given integer is odd or even without use of modulus operator in java?Core Java
Ans. public static void main(String ar[])
{
int n=5;
if((n/2)*2==n)
{
System.out.println("Even Number ");
}
else
{
System.out.println("Odd Number ");
}
}

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

   Like         Discuss         Correct / Improve     java   code   coding   tricky questions   interesting questions   modulus operator     Asked in 4 Companies        frequent


Very frequently asked in phone and walk in interviews.
  Q7. What are Marker Interfaces ? Name few Java marker interfaces ?Core Java
Ans. An interface without any method declaration is called as marker interface. there are 3 in-built interfaces in JVM i.e. serializable, clonable, remote

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

   Like         Discuss         Correct / Improve     java   oops   interfaces   marker interface   serializable   clonable     Asked in 21 Companies      intermediate        frequent

Try 1 Question(s) Test


  Q8. What is reflection ?
Ans. It is the process of examining / modifying the behaviour of an object at runtime.

  Sample Code for reflection

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

   Like         Discuss         Correct / Improve     java   reflection   reflection api   ebay   mindtree     Asked in 29 Companies      basic        frequent


 Q9. what is fail fast and Fail Safe in collections?Core Java
Ans. Iterators in java are used to iterate over the Collection objects.

Fail-Fast iterators immediately throw ConcurrentModificationException if there is any addition, removal or updation of any element.

Fail-Safe iterators don't throw any exception if a collection is structurally modified while iterating over it. This is because, they operate on the clone of the collection and not on the original collection.

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

   Like         Discuss         Correct / Improve     ail fast   fail saf     Asked in 9 Companies      intermediate


  Q10. Why java doesn't support multiple Inheritance ?

or

Explain Java Diamond Problem.
Core Java
Ans. class A {
void test() {
System.out.println("test() method");
}
}

class B {
void test() {
System.out.println("test() method");
}
}

Suppose if Java allows multiple inheritance like this,

class C extends A, B {
}

A and B test() methods are inheriting to C class.

So which test() method C class will take? As A & B class test() methods are different , So here we would Facing Ambiguity.

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

   Like         Discuss         Correct / Improve     multiple inheritance  object oriented programming (oops)  oops concepts  diamond problem     Asked in 20 Companies      basic        frequent


  Q11. What is JSON ?Json
Ans. JSON is "JavaScript Object Notation", primarily used for client-server or server-server communication. Its a much lighter and readable alternative to XML. JSON is language independent and is easily parse-able in all programming languages.

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

   Like         Discuss         Correct / Improve     json   markup language   client server communication     Asked in 26 Companies      basic        frequent

Try 2 Question(s) Test


  Q12. How are values passed in Java ? By value or reference ?Core Java
Ans. Java only provides pass by value.

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

   Like         Discuss         Correct / Improve     ebay   pass by value   pass by reference   method call   methods   functions   function call     Asked in 10 Companies      basic        frequent


Very Frequently asked to Senior Software Engineers or Developers.
  Q13. Describe some of the Design Patterns you have used ?Design
Ans. [Open Ended Answer]

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

   Like         Discuss         Correct / Improve     design patterns     Asked in 17 Companies      intermediate        frequent


  Q14. What is the use of HashCode in objects ?Core Java
Ans. Hashcode is used for bucketing in Hash implementations like HashMap, HashTable, HashSet etc.

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

   Like         Discuss         Correct / Improve     java   string   hashcode   hash code   string comparison  hashtable     Asked in 17 Companies      basic        frequent


  Q15. Explain Application / Server architecture being used in your project ?

or

Explain your project architecture ?
Ans. We are using cluster of Web servers and Application servers. Load Balancer is used to manage the load between them. Down the layer we have middleware server and then DB server to access database.

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

   Like         Discuss         Correct / Improve     architecture   production support   java   servers   application support     Asked in 7 Companies        frequent


  Q16. How is multiple inheritance implemented in Java ?Core Java
Ans. There was no multiple inheritance in java before version 8 as implementing multiple interfaces cannot be termed as inheritance.

With Java 8 , came the concept of default methods wherein the class implementing the interface carries the default implementation from the interface and hence facilitating multiple inheritance.

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

   Like         Discuss         Correct / Improve     multiple inheritance  object oriented programming (oops)  oops concepts   inheritance  object oriented programming (oops)  oops concepts   oops concept     Asked in 10 Companies        frequent


 Q17. What is the purpose of Commit and Rollback in Databases ?Database
Ans. When a DML is executed, the changes only stays in session and still not pushed to DB Tables, Commit is used to push those changes to the Tables.

In case we realize that we don't want to commit those changes and would like to ignore them, we can use rollback.

For example - You may like that for a banking transaction you would like to update the account balance only if the debit or credit record was correctly inserted, so you may like to encapsulate both DML's - insert for transaction and update for balance in a single transaction and would only commit if both succeeds else rollback.

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

   Like         Discuss         Correct / Improve     databases  commit  rollback     Asked in 2 Companies      Basic


Frequently asked in Accenture.
  Q18. What is your biggest achievement at work ?General
Ans. [Open Ended Answer]

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

   Like         Discuss         Correct / Improve     general question  non technical question     Asked in 20 Companies        frequent


  Q19. What is an exception and exception handling in Java ?Core Java
Ans. An Exception in java is the occurrence during computation that is anomalous and is not expected.

Exception handling is the mechanism which is used to handle such situations.


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

   Like         Discuss         Correct / Improve     exception handling     Asked in 18 Companies      basic        frequent


 Q20. What are the methods to connect to database in Java ?Database
Ans. JDBC ( Java Database Connectivity ),ODBC (Open Database Connectivity), Hibernate, JPA ( Java Persistence API ), JOOQ,MyBatis

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

   Like         Discuss         Correct / Improve     database connection  jdbc  ORM  Hibernate     Asked in 1 Companies


 Q21. Write a SQL to delete duplicate records in a tableDatabase
Ans. DELETE FROM TABLE WHERE ROW_NUM NOT IN ( SELECT MAX(ROW_ID) FROM TABLE GROUP BY DUPLICATE_FIELD )

or

DELETE FROM TABLE a WHERE ROW_ID >(SELECT MIN(ROW_ID FROM TABLE b WHERE a.DUPLICATE_FIELD=b.DUPLICATE_FIELD);

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

   Like         Discuss         Correct / Improve          Asked in 3 Companies


  Q22. Difference between == and === ?JavaScript
Ans. == compares values === is used in scripting languages for comparing two values as well as there data tpe. like in js,php.

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

   Like         Discuss         Correct / Improve     ==  ===  == vs ===     Asked in 13 Companies      basic        frequent


 Q23. Can you tell me any 10 unix command you have worked with ?Unix
Ans. grep, ls, kill, vi , scp , wget,telnet, zip, unzip,mv,cp

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

   Like         Discuss         Correct / Improve     unix commands     Asked in 1 Companies      basic


 Q24. Pascal Triangle Program
Ans. package snippet;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Pascal {
   public static void main(String[] args) {

      System.out.println(generatePascalTriangle(5));

   }

   static Map> generatePascalTriangle(int size) {
      Map> triangle = new HashMap<>();

      triangle.put(0, Arrays.asList(1));
      triangle.put(1, Arrays.asList(1, 1));

      for (int i = 2; i <= size; i ) {
         List coeffListForI = new ArrayList<>();
         List coeffListForI_1 = triangle.get(i - 1);
         coeffListForI.add(1);
         for (int j = 0; j <= coeffListForI_1.size() - 2; j ) {
            coeffListForI.add(coeffListForI_1.get(j) coeffListForI_1.get(j 1));
         }
         coeffListForI.add(1);
         triangle.put(i, coeffListForI);
      }

      return triangle;
   }
}

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

   Like         Discuss         Correct / Improve          Asked in 8 Companies


 Q25. Write a Program to find depth of node binary tree ? Algorithm
Ans. public static int getLevel(Node root, int key) {
int levelOfNode = getLevelUtil(root, key, 1);
return levelOfNode;
}

public static int getLevelUtil(Node root, int key, int level) {
if (root == null) return 0;
if (root.data == key) return level;
int left = getLevelUtil(root.left, key, level 1);
int right = getLevelUtil(root.right, key, level 1);
if (left != 0) return left;
else return right;
}

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q26. Can you give me a use case where you utilized serialization in your project code?Core Java
Ans. we use serialization when we send response to client in JSON format.(the process of converting model object into json is nothing but serialization

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

   Like         Discuss         Correct / Improve     serialization     Asked in 1 Companies


 Q27. How do you analyze memory leaks in your java application ?
Ans. https://dzone.com/articles/what-to-do-about-java-memory-leaks-tools-fixes-and

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q28. Explain how a class is loaded ?Core Java
Ans. Java classLoder is resposible to load java classes.

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q29. What is the difference between map and filter methods in streams ?Core Java
Ans. By using map , you can transform the object values. The map operation allows us to apply a function, that takes input parameter of one type, and returns something else.

Filter is used for filtering the data, it always returns the boolean value. If it returns true, then item is added to list else its filtered out (ignored)

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

   Like         Discuss         Correct / Improve     java 8     Asked in 1 Companies


 Q30. Write a program to rotate a matrix.Core Java
Ans. public class Matrix {

   public static void main(String[] args) {
      int[][] matrix = {
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
      };
      Matrix.rotateMatrix(matrix);
      for (int i = 0; i < matrix.length; i ){
         for (int j = 0; j < matrix.length; j ){
            System.out.print(matrix[i][j] " ");
         }
         System.out.println();
      }
   }

   public static void rotateMatrix(int[][] matrix){
      int row = matrix.length;
      //first find the transpose of the matrix.
      for (int i = 0; i < row; i ){
         for (int j = i; j < row; j ){
            int temp = matrix[i][j];
            matrix[i][j] = matrix[j][i];
            matrix[j][i] = temp;
         }
      }
      //reverse each row
      for (int i = 0; i< row; i ){
         for(int j = 0; j< row/2; j ){
            int temp = matrix[i][j];
            matrix[i][j] = matrix[i][row - 1 - j];
            matrix[i][row - 1 - j] = temp;
         }
      }

   }

}

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


next 30

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: