-
오늘 뉴욕 Brooklyn에 있는 한 회사와 phone 인터뷰를 했습니다.
문제를 3문제밖에 내질 않아서 좀 황당하긴 했습니다.
오늘 중에 onsite를 할지 안할지를 결정내리겠지요. 떨리는 마음으로 기다리고 있습니다.1. difference between call by value and call by reference
trying to explain some general about them
and saying java only provides call by value. So
it’s not easy to write swap function without using wrapper class.
여기까진 대채로 맞은것 같은데…
그럼 list를 parameter로 pass하면 어쩌구 하면서
제가 제대로 다음질문엔 제대로 답변을 못한것 같습니다.2. how to accomplish modularify and less coupling
I answered this question saying
” we should use abstraction and encapsulation “
abstraction: it allows other components to see this api at only a cerntain level of details.
Encapsulation: it prevents other components from looking at this api at some level of details3. write a function that takes array and int x and if array has any two value whose sum is equal to x, then return true
1. first get first data(a) from arrray
2. x – a = b
3. inside the for loop
try to look for b in array
if there’s b, return true
else return false
4. 위에 알고리즘이 worst O(n) 이라고 얘기했습니다.같이 한번 답을 맞춰 보시죠…