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 'Deloitte' - 47 question(s) found - Order By Rating | ||||
| ||||
Ans. Primary key will not accept NULL values whereas Unique key can accept one NULL value. A table can have only primary key whereas there can be multiple unique key on a table. A Clustered index automatically created when a primary key is defined whereas Unique key generates the non-clustered index. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  Unique Key  Primary Key Asked in 1 Companies | ||||
| ||||
Ans. Yes, Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they're currently authenticated. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  csrf attack  Cross-Site Request Forgery (CSRF) Asked in 16 Companies | ||||
| ||||
Ans. Use Comparable or Comparator interface | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  sql query Asked in 1 Companies | ||||
| ||||
Ans. Encrypted User Name / Password Encrypted Password within Cookie Encrypted Tokens IP Client Certificates Oauth | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  authentication  security  web service Asked in 12 Companies basic   frequent | ||||
| ||||
Ans. @component mark a java class as a bean so that component scan mechanism of spring pick it up and register in IOC container. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. Select salary from (select salary from employee where department = order by salary desc limit 5) emp order by salary limit 1 AND Select salary from (select salary from employee where department = order by salary desc limit 2) emp2 order by salary limit 1 | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  sql  database   find 2nd highest salary sql database Asked in 1 Companies | ||||
| ||||
Ans. Using comparable and comparator and sorted collections like TreeSet or TreeMap. or use stream api from java 8 onwards which internally refers to comparable and comparator through lambda expressions | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  sort  sorting  comprator  comparable  treeset  treemap  sorting collections Asked in 1 Companies Basic   frequent | ||||
| ||||
Ans. J2ee Web Containers and Core Containers | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. SOAP supports only xml whereas Rest support many other formats. Rest services are very light weight compared to SOAP. SOAP services are code heavy as they require creation. of stubs and skeltons. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  soap  rest  soap vs rest Asked in 2 Companies | ||||
| ||||
Ans. If you have mulitple Databases you just need to add multiple configuration files and create the corresponding SessionFactory object. | ||||
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 static void printTriagle(int n) { // outer loop to handle number of rows // n in this case for (int i=0; i1; j--) { // printing spaces System.out.print(" "); } // inner loop to handle number of columns // values changing acc. to outer loop for (int j=0; j<=i; j ) { // printing stars System.out.print("* "); } // ending line after each row System.out.println(); } } // Driver Function public static void main(String args[]) { int n = 5; printTriagle(n); } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. WEB APP |WEB-INF - META-INF | | | META-INF.MF | lib - WEB.xml - Classes | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  web application Asked in 3 Companies intermediate   frequent | ||||
| ||||
Ans. No | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  abstract class   multiple inheritance  object oriented programming (oops)  oops concepts Asked in 2 Companies | ||||
| ||||
Ans. Abstract class is one of the facility for achieving abstraction in Java. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
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. https://www.geeksforgeeks.org/arrays-sort-in-java-with-examples/ | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  array  sorting Asked in 16 Companies basic   frequent | ||||
| ||||
Ans. public class StackUsingArrayList { public static void main(String[] args) { List list = new ArrayList(); list.add("A"); list.add("B"); list.add("C"); Stack stack = new Stack(); list.forEach(a -> stack.add(a)); System.out.println(stack); } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
Ans. Yes | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
| ||||
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 | ||||
Frequently asked Spring interview question. | ||||
| ||||
Ans. Core: [Core, Bean, Context, Expression Language] Web: [Web, Portlet, Servlet, etc] Data Access [JMS, JDBC, etc] AOP, Aspect | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  spring  spring framework components Asked in 12 Companies | ||||
Usually asked to entry level software developers. | ||||
| ||||
Ans. public static void main(String[] args) { int num1 = 1; int num2 = 2; num1 = num1^num2; num2 = num1^num2; num1 = num1^num2; System.out.print("num1 = " + num1 +", num2 = "+num2); } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  code  coding Asked in 37 Companies basic   frequent | ||||
| ||||
Ans. Binary tree is a tree in which each node has up to two children.Tree is a data structure composed of nodes.Each tree has a root node(not necessary in graph theory). The root node has zero or more child nodes.Each child node has zero or more child nodes, and so on.The tree cannot contain cycles. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  binary tree Asked in 1 Companies | ||||
| ||||
Ans. int duplicateArray[] = { 1, 2, 2, 3, 4, 5, 6, 8, 9} Set unique = new HashSet(); for (int i = 0; i < duplicateArray.length; i) { if (unique.contains(duplicateArray[i])) { System.out.println(duplicateArray[i]); } else { unique.add(duplicateArray[i]); } } Complexity O(n) = nHashSet contains and add has O(n) = 1 | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  coding  code Asked in 2 Companies | ||||
| ||||
Ans. https://www.geeksforgeeks.org/heap-sort/ | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  sorting  heap sort Asked in 1 Companies   frequent | ||||
| ||||
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 | ||||
Frequently asked in high end product companies. Frequently asked in Deloitte. | ||||
| ||||
Ans. https://medium.com/javarevisited/internal-working-of-hashmap-in-java-97aeac3c7beb#:~:text=HashMap%20internally%20uses%20HashTable%20implementation,the%20entries%20into%20the%20map. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  hashmap  collections  hashmap internal implementation Asked in 20 Companies expert   frequent | ||||
Basic and Very Frequently asked. | ||||
| ||||
Ans. Polymorphism means the condition of occurring in several different forms. Polymorphism in Java is achieved in two manners 1. Static polymorphism is the polymorphic resolution identified at compile time and is achieved through function overloading whereas 2. Dynamic polymorphism is the polymorphic resolution identified at runtime and is achieved through method overriding. | ||||
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  polymorphism  object oriented programming (oops)  oops concepts  oops concepts Asked in 108 Companies Basic   frequent | ||||
Try 2 Question(s) Test | ||||
Very frequently asked. | ||||
| ||||
Ans. Synchronize is used to achieve mutual exclusion i.e at one time, the segment of the code, method that has been declared synchronized should be executed by single thread only and hence the lock needs to be retrieved before executing the segment and then released. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  threads  multithreading  synchronized Asked in 5 Companies basic   frequent | ||||
| ||||
Ans. 1. Switching Overheads - Even though multi threading aims at improving performance by reducing the wait time and hence improving overall throughput, there is a cost of switching resources between threads and sometime this cost can surpass the benefits if there isnt much wait for IO or external communication. 2. Debugging is hard with multi threaded code. 3. Deadlock - Execution of multi threaded code many a times lead to deadlock due to shared resources. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  multithreading  threads Asked in 4 Companies | ||||
Frequently asked at HCL Technologies ( Based on 3 feedback ) | ||||
| ||||
Ans. Checked exceptions are the exceptions for which compiler throws an errors if they are not checked whereas unchecked exceptions are caught during run time only and hence can't be checked. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   exceptions   checked exceptions   unchecked exceptions   exception handling   checked vs unchecked exceptions Asked in 39 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||