Python interview questions in Programming — Part 1
Below are some of the programming questions I faced when I attended for senior python developer. You can find source code all these programs at GitHub.
- Given a string/word, Remove all pairs(2 consecutive same character) of characters which occur consecutively. And continue till no such pairs exist. (Asked in Altimetrik interview)
You can find source code in the below GitHub link.
2. Check sub string letters present in the same order in the main string or not. (Altimetrik)
3. Implement Fibonacci series using recursion and memoization(Crisil)
- Memoization:
- Is a concept of storing values and retrieved when required.
- This will save lot of processing time and eliminates repeated operations.
- This concept really helpful in recursive operations and avoid memory overflow exceptions. - I have implemented fibonacci series using memoization with and without inbuilt function functools.lru_cache.
- Find the python implementation in the GitHub link
https://github.com/chanduthedev/python/blob/main/fibonacci_memoization.py
4. Rearrange list of integers in such way that all -ve numbers should come first and +ve numbers should come next. Numbers no need to be in sorted order.(Altemetrik)
5. Display round robin order string from given list of strings.(Foraysoft)
6. Implement logic to find a given string is become palindrome(Foraysoft)
7. Given a string, find the most frequently occurring character, 2nd most frequently occurring character and print the corresponding counts(Foraysoft)
8. Given a alphanumeric string, find list of integers and its unique count.(Quentelli)
9. How to find two given strings are anagrams or not?
All the source code for these programs can be found at GitHub. You can find more questions in Part2 article.