NK Securities Research interview question

code in python based on OOPS concept