0% found this document useful (0 votes)
2 views

Basic Python Questions

The document lists a comprehensive set of Python programming questions categorized into Basic, Intermediate, Advanced, and Competitive Programming sections. Each category contains various tasks ranging from simple print statements to complex algorithms and real-world applications. The total number of questions is 350, covering a wide array of topics including data structures, string manipulation, dynamic programming, and more.

Uploaded by

priyadharsini
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Basic Python Questions

The document lists a comprehensive set of Python programming questions categorized into Basic, Intermediate, Advanced, and Competitive Programming sections. Each category contains various tasks ranging from simple print statements to complex algorithms and real-world applications. The total number of questions is 350, covering a wide array of topics including data structures, string manipulation, dynamic programming, and more.

Uploaded by

priyadharsini
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Basic Python Questions (50)

1. Print "Hello, World!"


2. Swap two numbers without using a third variable
3. Check if a number is even or odd
4. Find the largest of three numbers
5. Check if a year is a leap year
6. Find the factorial of a number
7. Generate Fibonacci series up to n terms
8. Reverse a number
9. Find the sum of digits of a number
10. Check if a number is a palindrome
11. Count vowels and consonants in a string
12. Convert Celsius to Fahrenheit
13. Calculate the area of a circle
14. Convert decimal to binary
15. Convert binary to decimal
16. Find the square root of a number
17. Check if a string is a palindrome
18. Remove duplicates from a list
19. Count the occurrences of an element in a list
20. Find the second largest number in a list
21. Find the sum of elements in a list
22. Find the average of numbers in a list
23. Merge two lists and sort them
24. Find the union and intersection of two sets
25. Find common elements in two lists
26. Convert a list to a dictionary
27. Remove all occurrences of an element from a list
28. Check if a number is prime
29. Print all prime numbers in a range
30. Check if a number is Armstrong
31. Check if a number is a strong number
32. Reverse a string without using slicing
33. Count the occurrences of a character in a string
34. Convert a string to uppercase without using .upper()
35. Check if a substring exists in a string
36. Find the sum of all even numbers in a list
37. Find the missing number in a list of 1 to N
38. Find the common elements in three lists
39. Merge two dictionaries
40. Sort a list without using .sort()
41. Find the median of a list
42. Implement a simple calculator
43. Find the GCD of two numbers
44. Find the LCM of two numbers
45. Check if a string contains only digits
46. Count the frequency of words in a string
47. Reverse words in a sentence
48. Find the first non-repeating character in a string
49. Find the longest word in a string
50. Convert a nested list into a single list

Intermediate Python Questions (150)


Data Structures (Lists, Tuples, Sets, Dictionaries)

51. Implement a stack using a list


52. Implement a queue using a list
53. Find the kth largest element in a list
54. Find the kth smallest element in a list
55. Rotate a list to the right by k positions
56. Implement a circular queue
57. Flatten a nested list
58. Find the intersection of two dictionaries
59. Convert a dictionary to a list of tuples
60. Find the frequency of elements in a list

String Manipulation

61. Reverse a string using recursion


62. Find all permutations of a string
63. Remove special characters from a string
64. Convert a string to title case
65. Find the longest common prefix among a list of strings

Sorting and Searching

66. Implement binary search


67. Implement bubble sort
68. Implement selection sort
69. Implement insertion sort
70. Implement merge sort
71. Implement quick sort
72. Implement counting sort
73. Find the square root of a number using binary search
74. Find the first and last occurrence of an element in a sorted array

Recursion and Backtracking

75. Solve Tower of Hanoi


76. Find all subsets of a set
77. Find all unique subsets of a set
78. Find all permutations of a given list
79. Generate all valid parentheses combinations for n pairs
80. Solve N-Queens problem
Mathematical Problems

81. Check if a number is perfect


82. Find the sum of the first n natural numbers
83. Find the sum of the first n odd numbers
84. Find the sum of the first n even numbers
85. Find the sum of all divisors of a number

Advanced Python Questions (150)


Dynamic Programming

86. Find the nth Fibonacci number using DP


87. Solve the Longest Common Subsequence problem
88. Solve the Knapsack problem
89. Solve the Coin Change problem
90. Solve the Egg Dropping problem

Graphs

91. Implement BFS


92. Implement DFS
93. Detect cycle in an undirected graph
94. Detect cycle in a directed graph
95. Find the shortest path using Dijkstra’s algorithm
96. Find the shortest path using Bellman-Ford algorithm
97. Find the shortest path using Floyd-Warshall algorithm

Operating System Concepts (Python Implementation)

98. Implement FIFO page replacement


99. Implement LRU page replacement
100. Implement Round Robin CPU scheduling

Competitive Programming and Real-World Problems


(150)
Leetcode/HackerRank Style Problems

101. Two Sum Problem


102. Merge Intervals
103. Maximum Subarray Sum
104. Find the Peak Element in an Array
105. Trapping Rain Water Problem
106. Find the Longest Palindromic Substring
107. Find the Smallest Window in a String containing all characters of another
string
108. Longest Consecutive Sequence
109. Word Break Problem
110. Find the Largest Rectangle in Histogram

Real-World Python Applications

111. Build a URL shortener


112. Build a web scraper using BeautifulSoup
113. Build a chatbot using NLTK
114. Implement a keylogger
115. Create a simple login system

You might also like