C3 AI Interview Question

Coding problems: 1. Implement a function is_palindrome that checks whether a given string s is a palindrome. A palindrome is a word, phrase, or sequence that reads the same forwards and backwards, ignoring spaces, punctuation, and case differences. Your function should return True if s is a palindrome and False otherwise. 2. You are given a dataset represented by a 2D NumPy array, where each row is a sample, and each column is a feature. Your task is to implement a StandardScaler class, which will standardize the data by removing the mean and scaling to unit variance for each feature. You need to implement the following methods: fit: Given a 2D NumPy array, this method calculates and stores the mean and standard deviation for each column (feature). This method does not return anything. transform: Given a 2D NumPy array, this method returns a standardized array where each feature has zero mean and unit variance, using the mean and standard deviation stored by the fit method. If fit has not been called, transform should raise an exception.