Check whether a string is a palindrome while ignoring spaces, punctuation and case, using two pointers in O(n) time and O(1) space.
Interview Insights and Technical Explorations
Check whether a string is a palindrome while ignoring spaces, punctuation and case, using two pointers in O(n) time and O(1) space.
Process versus thread: memory, creation cost, communication, failure isolation and context switching, with a Java example and the problems shared memory causes.
Print the Fibonacci series with a loop, a recursive version, why plain recursion is exponential, and how memoisation fixes it.
Move all zeros to the end of an array in place, keeping the order of the other elements, in one pass with O(1) extra space.
Checked versus unchecked exceptions in Java: the compiler rule, the class hierarchy, examples of each, when to write a custom exception, and common mistakes.
Encapsulation, abstraction, inheritance and polymorphism explained with one realistic payment-module example instead of animals and shapes, plus how to map them to your own project.
Abstract class versus interface in Java: state, constructors, multiple inheritance, default and static methods since Java 8, and when to choose each.
Find the first character that appears only once in a string, in two passes with a count array or LinkedHashMap, with complexity and edge cases.
Check whether two strings are anagrams with a 26-count array in O(n), the sorting approach, a HashMap for Unicode, and how to ignore spaces and case.
Find the second largest element of an array in a single pass, handling duplicates, negative numbers and arrays with fewer than two distinct values.