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. Priority inversion is a problematic scenario in scheduling in which a high priority task is indirectly preempted by a lower priority task effectively inverting the relative priorities of the two tasks. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 5 Companies | |||||||||||
| |||||||||||
Ans. JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.JVMs are available for many hardware and software platforms (i.e. JVM is platform dependent).Runtime Instance Whenever you write java command on the command prompt to run the java class, an instance of JVM is createdThe JVM performs following operation:Loads codeVerifies codeExecutes codeProvides runtime environment | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  memory management  jvm Asked in 3 Companies basic   frequent | |||||||||||
| |||||||||||
Ans. class Student { /// /// /// private int id; private String name; /// /// /// public Student(int id, String name) { this.name = name; this.id = id; }// Student /// /// /// public int getId() { return id; }// getId /// /// /// public void setId(int id) { this.id = id; }// setId /// /// /// public String getName() { return name; }// getName /// /// /// public void setName(String name) { this.name = name; }// setName @Override public boolean equals(Object obj) { if (obj == null) return false; if (!(obj instanceof Student)) return false; if (obj == this) return true; return this.getId() == ((Student) obj).getId(); }// equals /// /// /// @Override public int hashCode() { return this.getId(); }// hashCode }// Student | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. mutual exclusion i.e the resource is not shareable and hence a process should have exclusive access to it at a particular time Hold and Wait i.e the process doesn't release all existing resources held by it before requesting for another one. No preemption i.e noone can forcefully release a resource held by another process and the process should voluntarily release the resource held by it. Circular Wait - For ex, P1 is waiting on resource to be released by P2, P2 is waiting on resource to be released by P3 and P3 is waiting on the resource to be released by P1 | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  deadlock  process | |||||||||||
| |||||||||||
Ans. Livelock is when two threads or processes get deadlocked because they try to perform the same action to come out of a potential deadlock. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  livelock  deadlock] | |||||||||||
| |||||||||||
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  CountingSemaphore  CountDownLatch | |||||||||||
| |||||||||||
Ans. It's an operating system file that maps IP address to host names. The hosts file assists the OS in addressing networked components and serves the function of translating human friendly hostnames into numeric protocol addresses, called IP addresses, that identify and locate a host in an IP network. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  host file  operating system Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. Following Classes in Java SE creates immutable objects String class Wrapper Classes like Integer, Float etc. StackTraceElement Most Enum classes File Class Locale Class | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  immutable  immutability objects  immutable  immutability Asked in 1 Companies Basic   frequent | |||||||||||
| |||||||||||
Ans. Games are very good examples of threading.You can use multiple objects in games like cars, motor bikes, animals, people etc. All these objects are nothing but just threads that run your game application. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  threads  multithreading Asked in 1 Companies | |||||||||||
Very frequently asked. Usually among very first few questions. | |||||||||||
| |||||||||||
Ans. Encapsulation is a feature of OOP's that binds the data and it's associated methods together as a single unit and facilitate protection and data hiding by providing minimal interface to outside. For example - member variables are declared private and are accessed through public methods. Moreover we have private methods that can only be used internally and hence providing minimal interface to outside class through use of public methods. | |||||||||||
Sample Code for encapsulation | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  encapsulation  object oriented programming (oops)  oops concepts  oops  oops concepts  oops features Asked in 4 Companies Basic   frequent | |||||||||||
| |||||||||||
This question was recently asked at 'Dell'.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  producer consumer problem  multi-process synchronization problem Asked in 1 Companies | |||||||||||
| |||||||||||
Ans. There are four main OOP concepts in Java. These are: Abstraction. Abstraction means using simple things to represent complexity. We all know how to turn the TV on, but we don?t need to know how it works in order to enjoy it. In Java, abstraction means simple things like objects, classes, and variables represent more complex underlying code and data. This is important because it lets avoid repeating the same work multiple times. Encapsulation. This is the practice of keeping fields within a class private, then providing access to them via public methods. It?s a protective barrier that keeps the data and code safe within the class itself. This way, we can re-use objects like code components or variables without allowing open access to the data system-wide. Inheritance. This is a special feature of Object Oriented Programming in Java. It lets programmers create new classes that share some of the attributes of existing classes. This lets us build on previous work without reinventing the wheel. Polymorphism. This Java OOP concept lets programmers use the same word to mean different things in different contexts. One form of polymorphism in Java is method overloading. That?s when different meanings are implied by the code itself. The other form is method overriding. That?s when the different meanings are implied by the values of the supplied variables. See more on this below. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  oops  oops concepts Asked in 16 Companies basic   frequent | |||||||||||
| |||||||||||
This question was recently asked at 'Patni Computer Systems,IGate'.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 2 Companies | |||||||||||
| |||||||||||
Ans. The most effective and acceptable reasons for leaving your current job should be positive e.g. moving forward in your life or career | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 21 Companies | |||||||||||
| |||||||||||
Ans. [Open Ended Answer] Possible Answer - We are using Agile. We have daily standups, Bi weekly Backlog Grooming , Planning and Retrospective, We have a 2 week sprint and We use Jira for Scrum Management. We are using Java 8, Spring Boot, JSF , Apache Kafka , Soap as well as Rest Services. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 9 Companies | |||||||||||
| |||||||||||
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   | |||||||||||
| |||||||||||
This question was recently asked at 'PegaSystems'.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. 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. OSGI is open service gateway initiative, its used as java framework for developing and deploying the modular softwares. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 23 Companies | |||||||||||
| |||||||||||
Ans. https://blog.timesunion.com/careers/the-10-most-important-personality-traits-for-career-success/633/ | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 32 Companies | |||||||||||
| |||||||||||
Ans. Time Slicing is the process to divide the available CPU time to the available runnable threads. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  Time Slicing  threads  thread scheduling   thread scheduler | |||||||||||
| |||||||||||
Ans. Thread Scheduler is the Operating System service that allocates the CPU time to the available runnable threads. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  Thread scheduler  threads | |||||||||||
| |||||||||||
Ans. Every fresh session having its own cache memory, Caching is a mechanism for storing the loaded objects into cache memory. The advantage of cache mechanism is, whenever again we want to load the same object from the database then instead of hitting the database once again, it loads from the local cache memory only, so that the no. of round trips between an application and a database server got decreased. It means caching mechanism increases the performance of the application. In hibernate we have two levels of caching First Level Cache [ or ] Session Cache Second Level Cache [ or ] Session Factory Cache [ or ] JVM Level Cache | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve   Asked in 23 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 | |||||||||||
| |||||||||||
This question was recently asked at 'Mercury Systems'.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. System.getEnv gets the environment variables where System.getProperties gets Java properties. | |||||||||||
Help us improve. Please let us know the company, where you were asked this question : | |||||||||||
Like Discuss Correct / Improve  System.getEnv  System.getProperties  environment variables | |||||||||||
| |||||||||||
This question was recently asked at 'Informatica'.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 | |||||||||||
| |||||||||||
| |||||||||||