instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Create a data structure to store all of the prime numbers up to 1 million. | codefeedback |
Create a function to edit a given string, replacing all the vowels with a given character.
String: "Hello world"
Character: 'x' | codefeedback |
Generate a loop to find the largest sub-array in a given array with contiguous elements and its sum.
Array: [-2, 6, -3, 5, -2, 3, 4, -2] | codefeedback |
Clone the content of the following Github repository: https://github.com/shreya23/Coding-Challenges | codefeedback |
We have a list of numbers and a given sum. Write a program to determine if any two numbers from the list sum up to the given sum.
[1,2,3,4], 6 | codefeedback |
How could you use Machine learning to classify the sentiment of a given text? | codefeedback |
Write a class in Python to store the objects of student and their grades. | codefeedback |
Generate an array of 5 random hexadecimal numbers. | codefeedback |
Create a SQL query that selects the second and third largest values in a table. | codefeedback |
Create a recursive function that takes two parameters, a number and a base and returns the result as a string.
14, 16 | codefeedback |
Design a machine learning algorithm to classify the given dataset.
Dataset of images of cats and dogs | codefeedback |
Create a webpage using HTML and CSS that has a navigation bar with a logo, five links to different webpages, and a footer. | codefeedback |
Create a function that returns a randomly selected element from a list.
list = [1, 2, 3, 4, 5] | codefeedback |
Code a method in Java to print out the elements of a 2D array.
[[1,2,3], [4,5,6], [7,8,9]] | codefeedback |
Generate a random string of length 10 made up of characters ‘a’ to ‘d’. | codefeedback |
Code a function to flatten a dictionary.
{"a": 1, "b": {"c": 2, "d": 3}} | codefeedback |
Code an algorithm to implement merge sort
[5, 2, 4, 6, 1, 7, 8] | codefeedback |
Given a tree, write a function that finds the deepest node in the tree. | codefeedback |
Design a Greedy Algorithm to solve the sum-subset problem. | codefeedback |
Create a function to remove all non alphabetical characters from thestring
string = "Hello, world!" | codefeedback |
Generate all possible combinations of strings that can be formed using the given characters
chars = ["a", "b", "c"] | codefeedback |
Create an ios app to display the content of a given RSS feed
Url: https://www.nytimes.com/svc/collections/v1/publish/https://www.nytimes.com/section/world/rss.xml | codefeedback |
Calculate the number of days from January 1, 2021 to June 30, 2021. | codefeedback |
Create a for loop that prints the square of each number from 1 to 5. | codefeedback |
Using regular expressions, remove any duplicate words from the following sentence.
sentence = "I I am going to the the store" | codefeedback |
Write an Object-Oriented Python program to find the area of a triangle given the base and the height. | codefeedback |
How would you use Recursion to solve the Fibonacci Sequence in Python? | codefeedback |
Construct a function that adds two numbers written in reverse order in JavaScript.
893 342 | codefeedback |
Develop a program in Python to implement a Simple Linear Regression model. | codefeedback |
Change the following program to use a try/except/finally block to handle errors.
def read_file(file):
with open(file) as f:
for line in f:
print(line) | codefeedback |
What data structure would be suitable to represent a sparse matrix with thousands of columns and rows? | codefeedback |
Write a Django code to print the name of all the users in the database. | codefeedback |
Using HTML/CSS and JavaScript, construct a web page that generates a random password. | codefeedback |
Find the number of triplets in this array which sum up to zero.
arr = [-1, 0, 1, 2, 3, 4] | codefeedback |
Write a function in JavaScript that takes in a number x and returns the pythagorean triplet whose sum is x.
// Number x
int x = 12; | codefeedback |
Describe a way to implement quicksort. | codefeedback |
Generate a code to throttle a stream of messages that exceeds a set limit of messages within a certain time window.
limit = 100
time_window = 5 seconds | codefeedback |
Generate a code to implement a binary search in an array with upto 1 million elements. | codefeedback |
Find the sum of two integers without using + or - signs.
a = 7
b = 5 | codefeedback |
Given an array of integers, find the maximum possible sum of a subarray within the array. | codefeedback |
Code an algorithm to find the closest pair of elements in a given array with respect to a given target number.
arr = [10, 22, 28, 29, 30, 40], target = 44 | codefeedback |
Write a code that prints each word in a given string on a separate line. | codefeedback |
Given two strings, find out if one is a permutation of the other.
string1 = "cat"
string2 = "act" | codefeedback |
Write a C++ code to implement quick sort algorithm. | codefeedback |
Write an R code to get the names of all uncorrelated columns in a data frame. | codefeedback |
Train a machine learning model to predict the stock price of a company based on historical data.
Historical data for the company Apple Inc. | codefeedback |
Create a GPT-2 model to generate text given a seed phrase. | codefeedback |
Implement a LRU cache in Java | codefeedback |
Encrypt the following string using a substitution cipher
thisisasupersecurestring | codefeedback |
Formulate an SQL query to find the most expensive product in a given database. | codefeedback |
Write a code to detect if a string is a palindrome or not. Output true if it is a palindrome, output false if it is not.
"racecar" | codefeedback |
Create a SQL query to select all columns in a table but exclude the contents of a specific column. | codefeedback |
You need to write a program to print out the prime numbers between a given range of numbers.
start=1
end=50 | codefeedback |
Turn the statement into a valid predicate in first-order logic.
"All animals are mammals" | codefeedback |
Generate pseudocode to solve the Fibonacci sequence. | codefeedback |
Create a PHP function to print the first 1000 prime numbers. | codefeedback |
Design a key-value database with Python for storing course information.
The database should contain the following fields: Course Name, Course ID, Course Description and Course Instructor. | codefeedback |
Write a SQL query to get the top 10 customers with highest overall spending | codefeedback |
Parse the following XML data and print the value of the 'id' key as a string.
<root>
<id>123</id>
<name>John Doe</name>
</root> | codefeedback |
Determine the syntactic structure of the following sentence.
Sentence: She felt so excited that her application got approval. | codefeedback |
Write a function to check whether a linked list contains a given value. | codefeedback |
Define a function in Python that calculates the sum of the sum of the elements of a nested list. | codefeedback |
Generate a list of random alphanumeric strings of length 25. | codefeedback |
Write a SQL statement to fetch the maximum age from the table "employee". | codefeedback |
Create a binary heap sort algorithm in Java. | codefeedback |
How would you create an API endpoint that returns a list of users? | codefeedback |
Create a C program that prints all distinct combinations of characters from two given strings.
Strings: ab and cd | codefeedback |
Given an input of numbers, sort the numbers in descending order.
arr = [6, 2, 5, 3, 9] | codefeedback |
Explain how to calculate the mean value of a function defined from 0 to infinity. | codefeedback |
Write a regular expression to extract the city names from the following string.
address: #38 number street, new york city, san jose, CA | codefeedback |
Suggest a better algorithm than Bubble sort for sorting a large array. | codefeedback |
Write a code to shuffle a list randomly in Python | codefeedback |
Given two string, how would you find the longest common substring? | codefeedback |
Write a SQL query to count how many students are in each grade. | codefeedback |
Suggest improvements to the following code to optimize its performance.
requests = []
for i in range(100000000):
requests.append(i) | codefeedback |
Suggest a better data structure that can be used to store a large amount of data in a way that querying data is fast. | codefeedback |
Determine the maximum number of nodes in a height-balanced binary tree of height h.
h = 4 | codefeedback |
Suggest a method to convert a given array into a min-heap. | codefeedback |
Generate a program to reverse a string and remove all the white spaces from the string.
" The quick brown fox jumped over the lazy dog. " | codefeedback |
Create a Tableau script to retrieve data from an Amazon RDS instance. | codefeedback |
Implement a function to insert an element into a binary search tree.
tree =
5
/ \
2 8 | codefeedback |
Generate random numbers 0 to 1000. | codefeedback |
Implement a search() function that uses binary search to find a given element in an array. | codefeedback |
Generate a random sample with size n from a given pandas DataFrame. | codefeedback |
Create a program in Scala to calculate the average price of all products in the table “Products”. | codefeedback |
Reformat a given JSON string between quotes to a properly indented and formatted output.
"{\"menu\":{\"id\":\"file\",\"value\":\"File\",\"popup\":{\"menuitem\":[{\"value\":\"New\", \"onclick\":\"CreateNewDoc()\"},{\"value\":\"Open\", \"onclick\":\"OpenDoc()\"},{\"value\":\"Close\", \"onclick\":\"CloseDoc()\"}]}}}" | codefeedback |
Convert the following HTML table into a valid JSON format.
<table>
<tr>
<th>Name</th>
<th>Age</th>
<th>Country</th>
</tr>
<tr>
<td>John</td>
<td>23</td>
<td>USA</td>
</tr>
<tr>
<td>Jack</td>
<td>25</td>
<td>Canada</td>
</tr>
<tr>
<td>Jane</td>
<td>20</td>
<td>Australia</td>
</tr>
</table... | codefeedback |
Write a function that switches the odd elements and the even elements in a list
def switch_list(mylist):
#TODO | codefeedback |
Design and implement a function that takes two lists of integers as parameters and returns the minimum difference between two elements of the two lists.
list1 = [2, 4, 7, 13]
list2 = [3, 8, 9, 14] | codefeedback |
Find the longest substring with non-repeating characters | codefeedback |
Describe in code what is supervised learning. | codefeedback |
Rewrite this SQL query to select the top three records from a table named 'sales'.
SELECT * FROM sales | codefeedback |
Design a program to partition an array into two subarrays such that the difference between the sum of the two subarrays is minimum.
Input Array: [1, 6, 5, 11, 3] | codefeedback |
Write a loop in Python to find all numbers below 100 that are divisible by 7. | codefeedback |
Create a function that will take a string as an input and returns the number of upper case letters in it. | codefeedback |
What is the sum of all the even numbers in the range 1-100 inclusive? | codefeedback |
What is the Big O notation for a linear search? | codefeedback |
Given a binary tree, write a function to serialize and deserialize the tree. | codefeedback |
How would you flatten a two dimensional list? | codefeedback |
Name a data structure that allows efficient insertion and deletion of elements at the beginning, middle and end. | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.