From retail to finance to medicine, every industry needs interns to provide additional support and assistance. Interview questions will vary greatly depending on the industry and role you are looking for. Expect to answer questions about how you work on teams and provide examples of any relevant work experience. To ace your interview, make sure to research the particular position you are applying for.
Write a program to find (x^y) % z
result = x mod z for i = 2 to y do result = (result * x) mod z
I think there is some point we need to check. first will x be negative? If so, we need to handle this problem In addition, in the case y is very large, a O(y) algorithm is not a good idea, we might need to use the O(lg Y) one.
(x ^ y) % z is equal to: (x << (y-1)) % z