Category: Interview Questions

Page table vs inverted page table

Introduction The purpose of this short post is to explain operating system’s page table vs inverted page table, mention their advantages and disadvantages in an easy to follow manner. Many students and beginners do not get the point behind these two concepts so my intention here is to clear any possible confusion rather than dive

Java Singleton Cache Example

Problem Given the Java cache interface below, write a singleton class that implements the interface so that no warnings are generated without using @SuppressWarnings annotations Solution The question is mainly about two points: Type checking warning must be fixed Singleton design pattern should be implemented here is how I approached the problem… I modified the map private

Perl return undef

Question In Perl what is the difference between return and return undef Answer Using “return” alone returns an empty list in list context and undef in scalar context. On the other hand “return undef” always returns undef even in list context. Generally speaking it is not a good idea to return undef from a subroutine