Data Science Interview Preparation

Python Coding Questions asked in Companies

 Remove duplicated from unsorted list [1,1,2,1,3,4,1,2,3,4]       

                                                            [ Asked by Company - Accenture , Profile :  Data Scientist Consultant ]

Solution :  dup_list = [1,1,2,1,3,4,1,2,3,4]

                 unique_list = list()    

                 for item in dup_list:

                       if  item not in unique_list :

                             unique_list.append(item)

                 print(unique_list) = [1,2,3,4]



Count how many times each element occur in a list ?

                                                                                    [ Asked by Company - Accenture , Profile :  Data Scientist Consultant ]

Solution :  dup_list = [1,1,2,1,3,4,1,2,3,4]  : Using Count: 



Given  a list  A = [2,3,5,4,5,7,8,8,5,9] find most occurring number.

                                                                          [ Asked by Company - Simplifai.ai , Profile :  Data Scientist ]
Solution: Approach with different methods:

            


Write a code to check whether given string or number is Palindrome or not ?.

                                                                          [ Asked by Company - Simplifai.ai , Profile :  Data Scientist ]
Solution: Approach with different methods:
                
For Palindrome String : 
                Easiest Approach: Using List properties (Python inbuilt)
 


               Second Approach: Without using any python inbuilt functionality

                                  


For Palindrome Number :

                               



© Copyright 2022, crackdatascienceinterview.in. All rights reserved.
'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();
Theme images by Barcin. Powered by Blogger.