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. |
|
| ||||
Interview Questions and Answers for 'Amdoc' - 35 question(s) found - Order By Rating | ||||
| ||||
Ans. https://www.geeksforgeeks.org/pojo-vs-java-beans/ | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. No | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. Using Collections.sort() | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
This question was recently asked at 'Amdocs'.This question is still unanswered. Can you please provide an answer. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. public class MyClass { static boolean binarySearch(int [] c, int start, int end, int value) { while (start <= end) { int mid = (start end) / 2; if (c[mid] == value) { return true; } if (c[mid] > value) { end = mid - 1; } else { start = mid 1; } } return false; } public static void main(String args[]) { int [] a = new int[] {1,2,4,6}; int [] b = new int[] {3,9}; int [] c = new int[] {2,4,5,6,7,9,10,12,15}; for (int i = 0; i < a.length; i ) { for(int j = 0; j < b.length; j ) { int value = a[i] b[j]; boolean find = binarySearch(c, 0, c.length - 1, value); if (find) { System.out.print(value " "); } } } } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
Frequently asked in Accenture. | ||||
| ||||
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 | ||||
Very Frequently asked to Senior Software Engineers or Developers. | ||||
| ||||
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 | ||||
| ||||
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 | ||||
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 | ||||
| ||||
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 | ||||
| ||||
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 | ||||
Very Frequently asked to fresh graduates and less experienced. Favorite question in Walk in drives. Frequently asked in Indian Services companies. | ||||
| ||||
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 in phone and walk in interviews. | ||||
| ||||
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 | ||||
| ||||
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 | ||||
Very frequently asked.Usually among first few questions. | ||||
| ||||
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 | ||||
| ||||
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 | ||||