employer cover photo
employer logo
employer logo

Clearwater Analytics (CWAN)

Engaged Employer

Clearwater Analytics (CWAN) Interview Question

Write a method that will be given two nodes in a binary tree and will return the common ancestor node for them.

Interview Answer

Anonymous

Sep 29, 2011

I wrote a brute force solution that walked up each side of the tree and then tried a recursive solution and had it mostly done when time ran out. This was by far the most interesting question because it is an example of the kind of problem that real engineers have to solve.