FactSet Research Systems, Inc Interview Question Software Engineer / Developers
0of 0 votesDifferences between C and Java?How is memory managed in Java and C? what is your favorite algorithm?Write code to insert an element into a binary search tree?
Country: United States
Interview Type: Phone Interview

Q: Differences between C and Java? How is memory managed in Java and C?
- Anonymous on October 31, 2011 Edit | Flag ReplyA: Quite too many to name. I'll just address the second question because it's one difference. In Java, allocated memory that becomes unreachable is automatically returned to the pool of memory available for tasks through a process known as "garbage collection". In C, memory must be allocated and deallocated manually, except for on-stack memory, which is freed when the corresponding function returns.
I'd probably start with that and have my interviewer prompt for more details if they care to.
Q: What is your favorite algorithm?
A: This is a ridiculous question. If I were to humor this, I suppose maybe I'd try to name something the interviewer has never heard of (or has and knows to be really advanced). I'd probably have to say ILP-relaxation (well, that's a family of algorithms, I suppose). I could say Djikstra's Banker's algorithm if I thought the more theoretical aspects of concurrency were important to these people. Maybe I'd say Savitch's algorithm in academia (a very surprising and interesting algo, but rather useless in practice). Of course there's no wrong answer.
Q: Write code to insert an element into a binary search tree?
A: Standard algorithm; you can find it (not what I'd say in the interview, I'm just addressing the reader here).