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 - Order By Newest | ||||
| ||||
Ans. An asynchronous event is one that occurs at an unpredictable time outside the control of the program that the CPU is running. It is not "synchronized" with the program. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  j2ee   internet   web application   asynchronus   asynchronus communication   architecture Asked in 1 Companies | ||||
Frequently asked in CTS ( Based on 2 feedback ) | ||||
| ||||
Ans. Comparable interface is used for single sequence sorting i.e.sorting the objects based on single data member where as comparator interface is used to sort the object based on multiple data members. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   java.util   comparable   comparator   collections Asked in 23 Companies basic   frequent | ||||
| ||||
Ans. Collections are re-sizable in nature. We can increase or decrease the size as per recruitment. Collections can hold both homogeneous and heterogeneous data's. Every collection follows some standard data structures. Collection provides many useful built in methods for traversing,sorting and search. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   collections classes   advantages of collections over arrays   collections vs arrays   basic interview question Asked in 6 Companies basic   frequent | ||||
| ||||
Ans. public void checkIfAnagram(String str1,String str2){ boolean anagram = true; for(char c:str1.toCharArray()){ if(!str2.contains(String.valueOf(c))){ System.out.println("Strings are Anagrams"); anagram = false; } if(anagram == true){ System.out.println("Strings are not Anagrams"); } } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   check if 2 strings are Anagrams Asked in 30 Companies basic   frequent | ||||
Very frequently asked if being interviewed for hibernate. Frequently asked in Tata Consultancy (TCS) and Overstock.com | ||||
| ||||
Ans. If id doesnt exist in the DB load throws an exception whereas get returns null in that case.get makes the call to DB immediately whereas load makes the call to proxy. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  hibernate Asked in 16 Companies basic   frequent | ||||
| ||||
Ans. It is an InputSream which is usually connected to the keyboard input of console program. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  System.in  Input Stream  Input Output | ||||
| ||||
Ans. System is a class within java.lang package that contains several useful class fields and methods. It cannot be instantiated and hence can use only statically.even in this case this has been used statically i.e with class name itself and without creating an instance. out is the static reference of Printstream declared as following in the System Class - public final static PrintStream out = null; println is the method of PrintStream class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  System class  Streams  Input Output  println Asked in 1 Companies basic   frequent | ||||
| ||||
Ans. https://en.wikipedia.org/wiki/Database_normalization | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  normalization  database Asked in 35 Companies intermediate   frequent | ||||
| ||||
Ans. public class BuggyBread { public static void main(String args[]) { System.out.println(factorial(5)); } private static int factorial(int number){ if(number == 1){ return 1; } else { return number * factorial(number - 1); } } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  recursion Asked in 25 Companies | ||||
| ||||
Ans. Selenium WebDriver is a tool for automating web application testing.It helps in replicating the manual tester behavior like keyboard entry, mouse events etc and then matching the output against the expected. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  selenium  webdriver Asked in 37 Companies | ||||
| ||||
This question was recently asked at 'Veritas'.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  Virtual Memory vs Demand Paging Asked in 1 Companies | ||||
| ||||
Ans. OAuth is an open-standard authorization protocol or framework that describes how unrelated servers and services can safely allow authenticated access to their assets without actually sharing the initial, related, single logon credential. Like using Google or Facebook to login to something. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 17 Companies | ||||
Frequently asked to fresh graduates. | ||||
| ||||
Ans. 1. when an OS wants to start running program it creates new process means a process is a program that is currently executing and every process has at least one thread running within it. 2). A thread is a path of code execution in the program, which has its own local variables, program counter(pointer to current execution being executed) and lifetime. 3. When the JavaVirtual Machine (JavaVM, or just VM) is started by the operating system, a new process is created. Within that process, many threads can be created. 4. Consider an example : when you open Microsoft word in your OS and you check your task manger then you can see this running program as a process. now when you write something in opened word document, then it performs more than one work at same time like it checks for the correct spelling, it formats the word you enter , so within that process ( word) , due to different path execution(thread) all different works are done at same time. 5. Within a process , every thread has independent path of execution but there may be situation where two threads can interfere with each other then concurrency and deadlock come is picture. 6. like two process can communicate ( ex:u open an word document and file explorer and on word document you drag and drop another another file from file explorer), same way two threads can also communicate with each other and communication with two threads is relatively low. 7. Every thread in java is created and controlled by unique object of java.lang.Thread class. 8. prior to jdk 1.5, there were lack in support of asynchronous programming in java, so in that case it was considered that thread makes the runtime environment asynchronous and allow different task to perform concurrently. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   operating system   threads   processes Asked in 2 Companies   frequent | ||||
Usually asked only to fresh graduates. | ||||
| ||||
Ans. Threads enters to waiting state or block on I/O because other threads can execute while the I/O operations are performed. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   threads   multithreading   scheduling   operating system | ||||
Frequently asked to fresh graduates. | ||||
| ||||
Ans. When a object invokes yield() it returns to ready state. But when an object invokes sleep() method enters to not ready state. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   threads   multi threading   yield   sleep   scheduling   operating system Asked in 4 Companies basic   frequent | ||||
Usually asked only to fresh graduates. | ||||
| ||||
Ans. Ready state. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  operating system   threads   multi threading   java   thread states Asked in 1 Companies basic   frequent | ||||
| ||||
Ans. suspend() method is used to suspend the execution of a thread for a period of time. We can then restart the thread by using resume() method. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   threads   multi threading   operating system   synchronization basic   rare | ||||
Usually asked only to fresh graduates. | ||||
| ||||
Ans. Suspend method is used to suspend thread which can be restarted by using resume() method. stop() is used to stop the thread, it cannot be restarted again. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   threads   multi threading   operating system   synchronization   suspend   stop basic   rare | ||||
| ||||
Ans. System.console() returns null if your application is not run in a terminal (though you can handle this in your application)System.console() provides methods for reading password without echoing charactersSystem.out and System.err use the default platform encoding, while the Console class output methods use the console encoding | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   system class   system.out.println   system.console.write   input output   java6 intermediate   rare | ||||
Usually asked only to fresh graduates and less experienced developers. | ||||
| ||||
Ans. These are threads that normally run at a low priority and provide a basic service to a program or programs when activity on a machine is reduced. garbage collector thread is daemon thread. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   threads   multi threading   operating system   daemon thread   garbage collection Asked in 10 Companies intermediate   frequent | ||||
Try 2 Question(s) Test | ||||
| ||||
Ans. Translation of JSP PageCompilation of JSP PageClassloading (class file is loaded by the classloader)Instantiation (Object of the Generated Servlet is created).Initialization ( jspInit() method is invoked by the container).Reqeust processing ( _jspService() method is invoked by the container).Destroy ( jspDestroy() method is invoked by the container). | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  j2ee   servlets   servelets   web application   jsp   jsp life cycle   mindtree Asked in 9 Companies | ||||
| ||||
Ans. System.out and System.err both represent the monitor by default and hence can be used to send data or results to the monitor. But System.out is used to display normal messages and results whereas System.err is used to display error messages and System.in represents InputStream object, which by default represents standard input device, i.e., keyboard. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   io   system.out   system.err   system.in   difference between   advanced   basic interview question | ||||
| ||||
Ans. It is part of the analysis of a program and describes a situation that a program might encounter and what behavior the program should exhibit in that circumstance. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  use cases   design   high level design   testing   test driven development   software system analyst   project lead basic   frequent | ||||
| ||||
Ans. The purpose of the System class is to provide access to system resources. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   system   io   file io | ||||
| ||||
Ans. The only time finally won't be called is if you call System.exit() or if the JVM crashes first. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   exceptions   exception handling   try   catch   finally   system   system.exit | ||||
| ||||
Ans. PATH is the variable that holds the directories for the OS to look for executables. CLASSPATH is the variable that holds the directories for JVM to look for .class files ( Byte Code ). | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   path   classpath   byte code   jvm   basic interview question Asked in 3 Companies intermediate   rare | ||||
| ||||
Ans. The build path is used for building your application. It contains all of your source files and all Java libraries that are required to compile the application. The classpath is used for executing the application. This includes all java classes and libraries that are needed to run the java application. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||
Very Frequently asked. Favorite question in walkins and telephonic interviews. Usually among first few questions. Asked in different variants. Must know for intermediate and expert professionals.Among Top 10 frequently asked questions. | ||||
| ||||
Ans. A Class must override the hashCode method if its overriding the equals method. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   hashcode  hash code   equals   collections Asked in 44 Companies intermediate   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. Lazy fetching is the technique of not loading the child objects when parent objects are loaded. By default Hibernate does not load child objects. One can specify whether to load them or not while doing the association. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  hibernate   lazy fetching   architecture Asked in 11 Companies   frequent | ||||
Try 2 Question(s) Test | ||||
| ||||
Ans. No, Java runs on a virtual machine called JVM and hence doesn't embed well with the underlying hardware. Though we can create a platform independent system software but that would be really slow and that's what we would never need. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   system software java   jvm   yes-no   yes no   java operating system   architecture | ||||