Visa Inc. interview question

The interviewer asked me some behavioural questions and then asked me to implement malloc, calloc functions in java.