:::: Python Logic Building :::: All Programs

**Python Logic Muscle Roadmap – 75 Micro Challenges**


---


### ✅ Level 1: Core Logic & Flow (15 Questions)


1. Generate Fibonacci series up to N terms

2. Reverse a string

3. Find maximum and minimum in a list

4. Separate even and odd numbers from a list

5. Check if a string is a palindrome

6. Swap two variables without using third variable

7. Sum of digits in a numeric string

8. Find missing number from a list

9. Find second largest number in a list

10. Count digits, letters, and special characters in a string

11. Find all pairs in list that sum to a target

12. Count vowels and consonants in a string

13. Calculate factorial using loop

14. Find average of numbers in a list

15. Print multiplication table of a number


---


### 🔹 Level 2: Pattern-Based String & List Problems (10 Questions)


16. Check if two strings are anagrams

17. Remove duplicate elements from list/string

18. Count character frequency in a string

19. Group anagrams from a list of words

20. First non-repeating character in a string

21. Sort characters in a string by frequency

22. Compress string like aabcc → a2b1c2

23. Move all zeroes to the end of a list

24. Merge two sorted arrays

25. Sort string by custom order


---


### 🔹 Level 3: Logic with Sets, Dicts, Tuples (10 Questions)


26. Count word frequency in a sentence

27. Find intersection of two lists

28. Find top K frequent elements in list

29. Detect duplicates using set

30. Count pairs with specific difference k

31. Solve two-sum using dictionary

32. Convert list of tuples to dictionary

33. Merge two dictionaries

34. Perform set operations (union, intersection, difference)

35. Sort list by value using dictionary mapping


---


### 🔹 Level 4: Slicing, Indexing, Recursion (10 Questions)


36. Reverse string without slicing

37. Find factorial using recursion

38. Check palindrome using recursion

39. Find nth Fibonacci using recursion

40. Split list into even and odd indexed items

41. Find peak element in list

42. Implement binary search (logic only)

43. Recursively flatten a nested list

44. Find max in rotated array

45. Custom slicing (e.g., every 3rd element)


---


### 🔹 Level 5: Real Interview-Style Logic Problems (15 Questions)


46. Longest substring without repeating characters

47. Find majority element

48. Trapping rainwater problem

49. Max profit (buy/sell stock once)

50. Find first missing positive integer

51. Spiral matrix print

52. Kadane's algorithm (max subarray sum)

53. Zigzag conversion

54. Validate parentheses sequence

55. Min window substring

56. Search in rotated sorted array

57. Palindrome partitioning

58. Group anagrams from string list

59. Sliding window maximum

60. Word break problem


---


### 🔹 Level 6: Data Structures in Logic (10 Questions)


61. Implement stack using list

62. Implement queue using list

63. Build a basic LRU cache

64. Use heapq for priority queue

65. Sum two linked lists (as numbers)

66. Merge K sorted linked lists (logic only)

67. Create custom hash map

68. Implement min stack

69. Rotate matrix by 90 degrees

70. Graph traversal (DFS, BFS basics)


---


### 🔹 Level 7: Python for Automation (5 Questions)


71. Parse CLI/log output to extract data

72. Read JSON/YAML and extract key info

73. Validate IP address and port format

74. Filter test cases by tag from structured data

75. Generate summary table from list of test result dicts

Some Fav Programs:
++++++++++++++++
Input = ['arc', 'car', 'rae', 'ear', 'are', 'hello']
#Output = [[“arc”, “car”],[“rae”, “ear”, “are”],[“hello”]]
d1={}
for word in Input:
    key=''.join(sorted(word))
    if key not in d1:
        d1[key]=[word]
    else:
        d1[key].append(word)
print(list(d1.values()))

Comments

Popular posts from this blog

TCL Interview Programs

-: Networking interview questions :-

100 Networking Questions