MathWorks interview question

Algorithm question 1 : How do you find if two strings are anagram. Anagram definition : two string having the same characters eg : 'united' and 'untied' Time complexity and space complexity for the same Algorithm question 2 : How do you determine if a number is power of 2 example : 32 is 2 power 5 Time complexity and spaced complexity for the same