Infogain
Sim Infosystems Interview Questions and Answers
Q1. What is deadlock .what are the conditions of deadlock?
Deadlock is a situation where two or more processes are unable to proceed because they are waiting for each other to release resources.
Deadlock occurs when two or more processes are blocked and unable to proceed.
It happens when each process is holding a resource and waiting for another resource to be released.
There are four necessary conditions for deadlock: mutual exclusion, hold and wait, no preemption, and circular wait.
Examples of resources that can cause deadlock include...read more
Q2. What is Checked and Unchecked Exception.An Example of each?
Checked and Unchecked Exceptions are types of exceptions in Java. Checked exceptions are checked at compile-time while unchecked exceptions are not.
Checked exceptions are those which are checked at compile-time and must be handled by the programmer using try-catch or throws keyword.
Examples of checked exceptions include IOException, SQLException, ClassNotFoundException.
Unchecked exceptions are those which are not checked at compile-time and can occur at runtime.
Examples of un...read more
Q3. Can we use super and this in a single constructor?
Yes, we can use super and this in a single constructor.
Using 'super' in a constructor calls the parent class constructor.
Using 'this' in a constructor calls another constructor in the same class.
We can use both 'super' and 'this' in the same constructor to call both parent and same class constructors.
Example: public MyClass(int x) { this(x, 0); super(); }
Q4. Will protected member be inherited in subclasses in hierarchy?
Yes, protected members are inherited in subclasses in hierarchy.
Protected members are accessible within the class and its subclasses.
They are not accessible outside the class hierarchy.
Subclasses can access protected members of their parent class.
Example: class A has a protected member x, class B extends A can access x.
Example: class C extends B can also access x.
Q5. What is the super class of Exception?
The super class of Exception is Throwable.
Throwable is the root class of all exceptions in Java.
It has two direct subclasses: Exception and Error.
Exceptions are used for recoverable errors while Errors are used for unrecoverable errors.
All exceptions and errors inherit from Throwable.
Throwable provides methods like getMessage() and printStackTrace() to handle exceptions.
Q6. Area of interest.Then why we need data Structures
Data structures are essential for efficient storage and retrieval of data.
Data structures allow for faster access and manipulation of data.
They help in organizing and managing large amounts of data.
Examples include arrays, linked lists, trees, and graphs.
Without data structures, algorithms would be less efficient and more complex.
Data structures are used in various fields such as computer science, finance, and engineering.
Q7. A programme to check palindrome?
A programme to check if a given string is a palindrome.
Create a function that takes a string as input.
Convert the string to lowercase and remove any non-alphanumeric characters.
Reverse the string and compare it to the original string.
If they are the same, return true. Otherwise, return false.
Q8. Use of super and this
super and this are used in object-oriented programming to refer to the parent class and current instance respectively.
super is used to call a method or constructor from the parent class
this is used to refer to the current instance of the class
super() must be the first statement in a constructor
this() can be used to call another constructor in the same class
More about working at Infogain
Top Junior Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month