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 explains how to create a calculator class in Python that can perform addition, subtraction, multiplication, and division operations. The calculator takes two operands (numbers) and an operator as input, and returns the result of the operation.
About this solution: The candidate's solution is complete and solves the problem. The approach is straightforward and easy to understand.
Nov 19
Python / Data Structures DifficultyMedium Python
This problem asks you to return the sum of all the odd integers in an array. For example, if the input array is [1, 2, 3, 4, 5], the output should be 9.
About this solution: This solution is optimal because it uses a generator expression to filter out the even numbers and then sums the odd numbers. This is optimal because it is a one-liner and it is also very readable.
Nov 19
Python / Web Development DifficultyMedium Python
This problem involves writing a function that takes in a list of integers and returns the sum of those integers. An example input and output are given in the problem statement.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to understand.
Nov 19
Python / Data Structures DifficultyMedium Python
Given a list of integers, the largest sum of non-adjacent numbers can be found by writing a function. The function will take the list as input and return the largest sum possible.
About this solution: The candidate's solution is correct and solves the problem. The approach is to use a dynamic programming approach, which is a good approach for this problem. The candidate could have been more concise in their solution, but overall the solution is correct and solves the problem.
Nov 19
Python / Exception handling DifficultyMedium Python
This technical problem deals with finding the sum of all the positive integers in a list. If the list is empty, the function will return 0.
About this solution: This solution is optimal because it uses a generator expression to filter the list and then sum the positive integers. This is optimal because it is a one-liner and it is also very readable.
Nov 19
Python / Exception handling DifficultyMedium Python
Given a list of integers, the Python function will find the largest number in the list. If the list is empty, the function will return None.
About this solution: This solution correctly finds the largest number in a list, and returns None if the list is empty. It uses a simple approach of just finding the maximum value in the list, which is efficient.
Nov 19
Python / Data Structures DifficultyMedium Python
This question is about how to round the values in a dataframe column to the nearest integer. The output should show the rounded values in the column.
About this solution: The candidate's solution is complete and solves the problem. The approach is general and efficient.
Nov 19
Python / Web Development DifficultyHard Python
Given a set of distinct integers, this function will print the size of the largest subset such that no two integers in the subset sum to more than k. For example, given the input [ 1, 2, 3, 4, 5] and k = 6, the output would be 3.
About this solution: The candidate's solution is correct and demonstrates a level of completeness. The approach is sound and the time and space complexity are both optimal.
Nov 19