My interviewer said my code assignment was bad, and lacked abstract thinking
The story
“Bro last week my assignment got rejected from an interview” My friend seemed very disappointed with the interview result.
“So what’s the code assignment?” I asked.
“It’s a bank. so the code assignment is an ATM simulator, console application, parse arguments, deposit, withdraw, transfer money” He said.
“This application you should have done in a few hours and with nice test cases written!” I know he is good, he can do it very well.
“Yes, I thought I did that. However on the 2nd day, I went to the interview sitting with the interviewer looking at my code, he wasn’t happy and said my code is procedure-oriented thinking and hard to maintain, there is no abstraction thinking at all.” He said.
The code looks like below.
def login(card_no, password):
....
def withdraw(amount):
....
def deposit(amount):
....
def transfer(amount, to_card):
....
“Ok, I think I know why he said that, your code was one py file that does everything right, there is no class and few functions inside, but that is fine, we should always start with simple.”
“But wait, before you both talked about the refactoring using O-O, did you talk about transaction control or locking?” I asked.
“Nope. we didn’t” he said.