instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Create a rectangle using the turtle library in Python | codefeedback |
Use JavaScript to illustrate the concept of inheritance with an example. | codefeedback |
Create a pandas dataframe containing the following columns and their respective values:
A, B, C
A= 12, 15, 20
B= 30, 25, 35
C= 40, 45, 50 | codefeedback |
Write an XSLT code to transform an XML document into HTML. | codefeedback |
Make a matrix multiplication program that takes an arbitrary number of matrices as input. | codefeedback |
Write a computer program to print all primes in an inputted range. | codefeedback |
Create a function that takes a string and checks if it's a valid email or not.
string = 'example[at]gmail.com' | codefeedback |
Assign a random value to each item in a given list.
my_list = [1, 2, 3] | codefeedback |
What should the following function return?
def calculate_sd(numbers): | codefeedback |
Reverse the words of the following sentence.
This is a sentence | codefeedback |
Create a quicksort alogorithm in the following language
Java | codefeedback |
If a singly linked list is represented only by its head pointer, how would you reverse it? | codefeedback |
You are given a 2-D array named "matrix" and its size is MxN. Print the matrix in a spiral form.
int matrix[][] = {{1, 2, 3},
{4, 5, 6},
{7, 8, 9}} | codefeedback |
How would you solve the FizzBuzz problem in C#? | codefeedback |
You are given a string "hello". Write a function to print out all the possible subsets of that string. | codefeedback |
Given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digits. Add the two numbers and return the sum as a linked list. | codefeedback |
Analyze the following code and determine if there any potential errors.
def foo(X, Y):
for i in range(1, X):
for j in range(1, Y):
print i
return | codefeedback |
Edit the following code to update an existing item in a MongoDB database with the name “John”.
db.collection("users").findOne({ name: "John" }); | codefeedback |
Create a algorithm to calculate the fibonacci number of nth term. | codefeedback |
Generate code to print all unique 4 digit combos | codefeedback |
Develop a method to achieve the linear interpolation between two given points | codefeedback |
Create a TensorFlow program to implement a multi-layer neural network | codefeedback |
Create a function to print the contents of a binary tree in pre-order format. | codefeedback |
Alter the following code to detect a loop in a linked list | codefeedback |
Suggest a way to serialize a binary tree in python. | codefeedback |
Sort the list ```[5, 3, 1, 4, 2]``` numerically. | codefeedback |
Create a text classification model using Scikit-learn to classify a message with either "positive" or "negative" sentiment. | codefeedback |
Create a function that returns a list of all the factors of a given number.
64 | codefeedback |
Write a code to convert a given string of English characters to corresponding Morse code.
"Hello World!" | codefeedback |
Write a Python code to convert a binary tree to its mirror tree | codefeedback |
Find all the possible moves of a knight in a chessboard | codefeedback |
Write a SQL query to select the latest registration record for each user. | codefeedback |
Parse the following HTML string and return the list of id's.
<form>
<input name="user_id" type="text" id="user_id" value="123456">
<input name="name" type="text" id="name" value="John Doe">
<input name="email" type="text" id="email" value="john@example.com">
<input name="password" type="password" id="passwo... | codefeedback |
Create an array of prime numbers between 0 and 100 and print them out. | codefeedback |
Construct a function that removes any non-alphanumeric characters from a string.
Hello world! | codefeedback |
What is the Big O notation of the algorithm below?
def myfunc(n):
total = 0
for i in range(n):
for j in range(n):
total += 1
return total | codefeedback |
Write a code snippet to display the Fibonacci sequence up to 50 numbers. | codefeedback |
What is the output of the following JavaScript code?
let x = 0;
while(x <= 5) {
console.log(x);
x++;
} | codefeedback |
Write a function to get the length of a given string without using any built-in function.
text = "Hello world!" | codefeedback |
Compute the sum of two matrices of size m x n.
A = [[1, 2],
[4, 5]]
B = [[3, 6],
[7, 8]] | codefeedback |
Create a neural network class in Python using NumPy. | codefeedback |
How do you estimate the complexity of selection sort algorithm? | codefeedback |
Write a code that takes a list of numbers, and outputs the 10th largest value.
mylist = [2, 4, 54, 31, 34, 77, 29, 11, 44, 78, 65, 23] | codefeedback |
Write a function that takes an array and returns the number of elements that are even.
arr = [1, 5, 7, 4, 9, 17] | codefeedback |
Given a string, write a regular expression to extract the last three words of the string.
text = "My name is Bill Gates" | codefeedback |
Veriyif if a given string is a valid email address.
email = "email@example.com" | codefeedback |
Generate a code to evaluate a expression of the form a * (b + c).
a = 10
b = 5
c = 6 | codefeedback |
Create a function to calculate the total cost of the items in a cart.
items = [{"item":"apple", "cost":3.00}, {"item":"orange", "cost":2.50}] | codefeedback |
What tags need to be included in HTML to make a form? | codefeedback |
In Python, how could you print a list from the last element to the first element? | codefeedback |
Design a user interface for a book library application. | codefeedback |
Suggest a sorting algorithm that is suitable for a large, unsorted integer array. | codefeedback |
Edit the given code snippet and make it run in O(N) time complexity.
int[] arr = {1, 2, 3, 4, 5};
int result = 0;
for (int i = 0; i < arr.Length; i++)
{
for (int j = 0; j < arr.Length; j++)
{
if (arr[i] % arr[j] == 0)
{
result += arr[i];
}
}
} | codefeedback |
Design a Java program to find the longest increasing sub-sequence of an array. | codefeedback |
Write a function to calculate median of array elements | codefeedback |
Create an array that contains the numbers 1 through 10. | codefeedback |
Create an angle converter function which converts degrees to radians. | codefeedback |
Build a Keras model to predict whether a patient has cancer. | codefeedback |
Design a pipeline in Scikit-learn to preprocess a given dataset. | codefeedback |
Sort a list of integers using quicksort
list = [4,2,1,5,3] | codefeedback |
Generate a code in Java for sorting an array using Mergesort. | codefeedback |
Given a list of integers and a target sum, write a function that returns a pair of said integers that add up to the target sum.
list = [3, 9, -4, 0, -7, 8] and target sum = -4 | codefeedback |
Implement a binary search algorithm in Python for searching for a specific element in a given list of numbers.
list = [1, 3, 5, 7, 9, 11 ] and target number =7 | codefeedback |
Construct a SQL query to count the number of distinct cities from table cities. | codefeedback |
Given a string, write a Java program to verify if it is a valid email address. | codefeedback |
How would you merge two sorted linked lists into one? | codefeedback |
Compute the factorial of the number 7. | codefeedback |
Create a SQLite database named "mydb" with two tables "employees" and "departments". | codefeedback |
Given a binary tree, find the height of the tree. | codefeedback |
Implement a priority queue. | codefeedback |
Create a for loop to iterate through the given array from the last index to the first.
array = [1, 2, 3, 4, 5] | codefeedback |
Visualize the given data using a bar chart.
data = [['January', 10], ['February', 15], ['March', 20], ['April', 17]] | codefeedback |
Using the given code, write a function that finds the highest value in the array.
array = [5, 2, 8, 7, 1] | codefeedback |
Using JavaScript, create an interactive web page that displays a list of strings taken from the user's inputs. | codefeedback |
Write a Python function to calculate the sum of the areas of a given list of circles, where each circle is defined as a dictionary containing 'radius' and 'x' as keys.
[{'radius': 3, 'x': 5}, {'radius': 4, 'x': 7}, {'radius': 5, 'x': 9}] | codefeedback |
Using Java, create a program to find the maximum sum of a sub-array within a given array. | codefeedback |
Create a class in C++ representing a 2D vector which has components (x, y). | codefeedback |
Create a database structure in MySQL for a shopping cart application containing a user, product and order table. | codefeedback |
Design a SQL query to find the top 3 customers with the highest spendings. | codefeedback |
Develop a function in Java that, given a positive number, returns the factorial of that number.
num = 5 | codefeedback |
Create a function to calculate Fibonacci sequence number based on the index of the number.
index = 6 | codefeedback |
How would you write a function to find the highest frequency character in a string?
string = "Hello world!" | codefeedback |
Given a Binary search tree, write a C++ program to find the lowest common ancestor (LCA) of two given nodes in the BST.
Tree:
8
/ \
3 10
/ \ /
1 6 14 | codefeedback |
Provide a context-free grammar to generate strings that contain only a’s and b’s and which have the same number of a’s as b’s. | codefeedback |
Explain how a quicksort algorithm works. | codefeedback |
Write an expression to check if a given number is a perfect square
num = 16 | codefeedback |
Construct an algorithm to check if two strings have the same characters and same frequency of characters.
String A: hello
String B: ollhe | codefeedback |
Deploy a model server on AWS Lambda to serve a machine learning model. | codefeedback |
Create a data visualization of the following data set with the target variable as red and the predictor variables as blue.
data = [[1, 2, 1, 0],
[2, 4, 0, 1],
[2, 3, 0, 1],
[3, 6, 1, 0]] | codefeedback |
Design an Android application to store a user's sensor data | codefeedback |
Create a for loop to print out the square of the numbers between 10 and 20 | codefeedback |
Transform the following string in Python into a dictionary whose keys are the names of the colors and the values are the hex codes for the colors.
"red #FF0000, blue #0000FF, green #00FF00" | codefeedback |
Create an SQL query that returns all customers in New York state who have purchased a product in the last 6 months. | codefeedback |
Write a SQL query to list the unique office locations which are older than 5 years. | codefeedback |
Write a function to compute the maximum depth of binary tree from a given list of numbers.
nums = [3,9,20,None,None,15,7] | codefeedback |
Find the nth Fibonacci number in a given range. | codefeedback |
Construct an algorithm that checks if the given sequence is an arithmetic sequence. | codefeedback |
Implement a function that will take a parameter input and return the length of the parameter. | codefeedback |
Implement a quicksort algorithm in Python to sort a list of 6 integers [52,85,23,6,37,77].
[52,85,23,6,37,77] | codefeedback |
Write a function to return the count of all prime numbers from 1 to n (inclusive). | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.