Spoonshot interview question

Questions from algebra, algorithms and data science. Writing Python code to solve some simple tasks like creating a counter of distinct elements from a list, an algorithm to compute a^b without using the ** operator in Python.

Interview Answers

Anonymous

13 Sept 2021

I was able to answer most of the algebra and algorithms questions. Couldn't answer some of the Data Science ones. I was able to write a code for computing a^b assuming b was an integer, but couldn't do it for the general case - when b could be any real number.

Anonymous

23 Jun 2022

I'm assuming that you can't use any mathematical library.You need to write an if elif else condition, if b could be any real number. If b is a negative number then output should be inverse of a^b . Similarly if b is a fraction ,different condition should be mentioned.