The Banker's algorithm is a resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, then makes an 's-state' check to test for possible deadlock conditions for all other pending activities.
Explain the difference between readline and readlines in Python.
Python
Suggested Answer
readline() reads a single line from the file and returns it as a string, while readlines() reads all lines from the file and returns them as a list of strings.
The interviewer probed into the implementation details of core Java collections like HashMap.
Knowledge of database connection pooling and the underlying connection process was scrutinized.
Questions Asked
Difference between == and equals in Java
Java
Suggested Answer
The == operator compares the memory addresses (references) of two objects, while the .equals() method is intended to compare the actual content or values of the objects.
Explain deep vs shallow copy.
Programming Concepts
Suggested Answer
A shallow copy creates a new object but inserts references into it to the objects found in the original, whereas a deep copy creates a new object and recursively copies all objects found in the original.
Practice graph-based problems with variations to handle dynamic interviewer modifications.
Review core CS fundamentals including OS, DBMS, and Networking for online assessments.