Python

Categories: Code Problem / Data Structures and Algorithms / Recursion (32) Code Problem / Data Structures and Algorithms / Binary Search (30) Code Problem / Data Structures and Algorithms / Linked Lists (26) Code Problem / Data Structures and Algorithms / Backtracking (26) Code Problem / Data Structures and Algorithms / Stacks and Queues (25) Code Problem / Data Structures and Algorithms / Hashing (24) Databases / SQL / Backup and Recovery (19) Code Problem / Data Structures and Algorithms / Arrays and Strings (19) Databases / SQL / Database Normalization (18) Code Problem / Data Structures and Algorithms / Time Complexity (17) Databases / SQL / Locking (16) Databases / SQL / Replication (15) Databases / SQL / SQL Queries (13) Code Problem / Data Structures and Algorithms / Graphs (13) Databases / SQL / Database Security (13)  More...

Recent solutions:

Check these solutions from our community:
Python / Classes and Objects DifficultyMedium Python
This technical problem deals with implementing a stack data structure in Python using a class. The class should have two methods: push, which adds an item to the top of the stack, and pop , which removes and returns the top item from the stack. If the stack is empty, pop should raise an IndexError.
About this solution: The candidate's solution is optimal because it uses the built-in list data structure to store the items in the stack. The list is a dynamic array, which means that it can grow and shrink in size as needed. The push method is O(1) because it simply appends the item to the end of the list. The pop method is O(1) because it simply removes the last item from the list.
Nov 13
Python / Web Development DifficultyMedium Python
This technical problem deals with finding the sum of integers greater than or equal to 10 in a given list. An example input and output are provided in the problem statement.
About this solution: The candidate's solution correctly solves the problem. They iterate through the list, checking if each integer is greater than or equal to 10. If it is, they add it to the sum. This is a solid approach that would work well for this problem.
Nov 13
Python / Data Structures DifficultyMedium Python
This technical problem deals with how to keep only certain columns in a dataframe using Python. A function is provided that takes in a dataframe and a list of column names, and returns a new dataframe with only the columns in the list. An example is given of input and output.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to follow.
Nov 12
Python / Algorithmic Puzzles DifficultyMedium Python
The Tower of Hanoi problem is a classic algorithmic puzzle that can be solved using a simple recursive algorithm. Given a stack of n disks, the algorithm moves the disks from the first stack to the last stack, using only three stacks and moving only one disk at a time. The disks must be moved so that the smallest disk is on top of the largest disk.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The approach is clear and easy to follow.
Nov 12
Python / Web Development DifficultyMedium Python
This technical problem deals with scraping the title from a given URL. An example input and output is provided.
About this solution: This solution correctly imports the necessary libraries and defines the get_title function. This function takes in a url and returns the title of the page using BeautifulSoup. This is a good solution.
Nov 11
Python / Web Development DifficultyMedium Python
This problem asks for a function that can take a list of integers and return the sum of all the elements in the list. An example input and output are given to show how the function should work.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to understand.
Nov 10
Python / Data Structures DifficultyMedium Python
Given a list of words, this Python program finds the longest word that can be made by concatenating other words from the list. For example, given the input ["cat", "cats ", "dog", "dogs", "pig", "pigs"], the output would be "catsdogspigs".
About this solution: This is a great solution! The candidate has thought about the problem and come up with a solution that is both complete and efficient.
Nov 10
Python / Data Structures DifficultyMedium Python
This problem asks the programmer to sum the elements of an array of integers. The input is an array of integers and the output is an integer representing the sum of the elements in the array.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to understand.
Nov 10