Note: Please provide optimized solutions in Python and discuss the approach used to solve the problems so that I can understand the approach when I walk through the code
1. A file contain 10 ip’s of the different machine. Write a python program where a function will telnet with this different machine and find the memory usage of a process in that machine. funct(filename, process x)
2. Given a file (which can be considered as a String with comma delimiter for the complexity of the question) of usernames and a value k, find top k usernames (with number of logins) who logged into the system the most. For example – Input: User (String) = user1, user4, user2, user1, user3, user1, user2, user3 k (int) = 2 Output: user1 (3) user2 (2) user3 (2)
3. Write a Python Program to access a text file and determine the IP addresses that are available in the file :
Eg: Text File contents:
Akcnklasncklnaskckasc 192.168.1.1 asckjasscjasjkc
4. Write code to sum 2 integer but u cant use a+b method, you have to use either ++ or –. How you will handle negative numbers.
5. There are several words in a file. Get the occurrence of every word and sort it based on the occurrence, if more than one word is having same occurrence than sort it alphabetically. Solution Hint: Use Hash Map
6. given a string determine which character appears the most and the number of times that character appeared.
7. WAP fibonoccaci series using recursion and after completion asked to to write using iteration.
8. given 2 arrays wrds , chars as an input to a function such that wrds = [ “abc” , “baa” , “caan” , “an” , “banc” ] chars = [ “a” , “a” , “n” , “c” , “b”] Function should return the longest word from words which can be constructed from the chars in chars array. for above example – “caan” , “banc” should be returned Note: Once a character in chars array is used, it cant be used again. eg: words = [ “aat” ] characters = [ “a” , “t” ] then word “aat” can’t be constructed, since we’ve only 1 “a” in chars.
9. Imagine we have a large string like this “ABCBAHELLOHOWRACECARAREYOUIAMAIDOINGGOOD” which contains multiple palindromes within it, like ABCBA, RACECAR, ARA, IAMAI etc… Now write a method which will accept this large string and return the largest palindrome from this string. If there are two palindromes which are of same size, it would be sufficient to just return any one of them.’
10. Write code to search and return all those file names present in a given directory (for e.g. C:/>) where the string “Amazon” is present. All the files will be located at different folder levels. Also discuss your approach, time and space complexities for your solution.
Get a 10 % discount on an order above $ 100
. WITH BEST NURSING TUTORS TODAY AND GET AN AMAZING DISCOUNT
The post provide optimized solutions in Python and discuss the approach used to solve the problems so that I can understand the approach when I walk through the code appeared first on BEST NURSING TUTORS .
The post provide optimized solutions in Python and discuss the approach used to solve the problems so that I can understand the approach when I walk through the code appeared first on The Nursing Hub.