Microsoft Interview Question

1. Maximum sum of array having non adjacent elements. 2. Frequency of element in sorted array