instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Create a MySQL trigger to perform a data validation check when a new row is created. | codefeedback |
Use .split() in Python to break the following text into a list of sentences.
text = "Hello! My name is John. What is your name?" | codefeedback |
Write a code to edit a given column in an SQL table. | codefeedback |
Write a function to check whether a number is a prime number in JavaScript.
let num = 7; | codefeedback |
Implement a 3d vector class with a constructor, a dot product method and a normalization method. | codefeedback |
Write a Regular Expression pattern to check if the given input is a valid email address. | codefeedback |
Compress the given string using the Huffman Coding.
aabbccdd | codefeedback |
Convert the given integer number to a Roman Numeral.
403 | codefeedback |
Use the bisection method to approximate the root of the given equation.
x^2 - 2x - 3 | codefeedback |
Given the different test scores in the list, calculate the GPA.
[('DS', 98), ('OS', 95), ('SE', 85), ('ML', 80)] | codefeedback |
Using a random seed of 0, generate a 5x4 random matrix of integers up to the given number.
10 | codefeedback |
How would you modify the following Java code to print the first 5 numbers of the Fibonacci sequence?
public class FibonacciPrinter {
public static void printNumbers() {
System.out.println("...");
}
} | codefeedback |
Create a Java program to validate a credit card number using Luhn's algorithm. | codefeedback |
Generate a random password with at least 8 characters and with at least 1 number and 1 letter. | codefeedback |
Find the most frequent name in a given array of names.
["John", "John", "Sandra", "Sandra", "Sandra", "Tom"] | codefeedback |
Create a MySQL query to get the name corresponding to the highest id. | codefeedback |
For a given array of numbers, find the length of the longest increasing subsequence
[1, 5, 4, 3, 8, 10, 6] | codefeedback |
What is the logic behind bubble sort? | codefeedback |
How is the traversal of a binary search tree done? | codefeedback |
Given an array of integers, sort the array in-place using quick sort.
[12, 8, 9, 10, 4] | codefeedback |
How can you make a dictionary key iterable in Python? | codefeedback |
Create a python program that takes a keyword as an input and prints the top 10 relevant Wikipedia articles for that keyword | codefeedback |
How would you solve this leetcode problem in Python?
Problem: Implement the following function
```def majorityElement(self, nums: List[int]) -> int:```
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. | codefeedback |
Construct a React component to show an animated loading screen. | codefeedback |
Given an array of integers, sort it using bubble sort in Java. | codefeedback |
Construct a React component to show a blog post. | codefeedback |
Generate code to create a PDF report from a given dataset.
The dataset contains information about customer orders. | codefeedback |
Create a Java program which takes two integers as input and prints their greatest common divisor.
102, 75 | codefeedback |
Generate a logic for a basic regex expression to detect a valid email address. | codefeedback |
Read the following JSON object and print the "name" corresponding to the "id" 2.
{
"1": {
"name": "John",
"age": 26
},
"2": {
"name": "Kelly",
"age": 23
}
} | codefeedback |
Compose a SQL query that returns the names and cities of customers from the Customer table whose last name starts with the letter "L". | codefeedback |
Create a web page with a React component to fetch data from an API and display it in a table. | codefeedback |
Create a class in C++ to store the rolling average of a stream of numbers. | codefeedback |
Given a binary search tree and a target value, write a python function to search for the closest node value to the target. | codefeedback |
Write a Python code to find all the prime numbers below a given number. | codefeedback |
Remove the extra spaces from a given string and make the spaces between letters and words consistent.
" The quick brown fox jumps over the lazy dog " | codefeedback |
Write a code that prints all the possible outcomes of rolling two dice. | codefeedback |
Rewrite the following code snippet from an object-oriented programming perspective.
def find_greeting(name):
if name == "Alice":
return "Hi Alice!"
else:
return "Hello!" | codefeedback |
Design an algorithm for sorting data in ascending order using selection sort. | codefeedback |
Edit the given code snippet to generate a table in HTML with four columns and three rows.
<table></table> | codefeedback |
Find the first prime number larger than 100. | codefeedback |
Estimate the value of pi to four decimal places. | codefeedback |
Given a 2-d array, write a method to flatten the array.
[[1, 2, 3], [4, 5, 6], [7, 8, 9]] | codefeedback |
Create a RNN model to predict the next character in a given string. | codefeedback |
Design an algorithm in C to find all substrings of a given string. | codefeedback |
Create a relational database with the following table structure: | codefeedback |
Generate a list containing all positive integers between 1 and 10. | codefeedback |
Write a code that sorts an array in descending order.
[7,4,1,2] | codefeedback |
Using a for loop and an if statement, count how many even numbers are in the given array.
[1,2,3,4] | codefeedback |
How to generate all permutations of a given list of items? | codefeedback |
Transform a given text into a valid JSON format with indentation and proper spacing
hello world | codefeedback |
Write a JavaScript statement to create a Timer set to 2 minutes. | codefeedback |
Write a Python script to merge two given dictionaries into one
dict1 = {'a': 1, 'c': 3, 'd': 4}
dict2 = {'a': 6, 'b': 2, 'c': 4} | codefeedback |
Write a JavaScript program to create an array of the first 100 Fibonacci numbers. | codefeedback |
Identify the input validation code that would be most appropriate for a form receiving a user's age. | codefeedback |
Describe the process of indexing documents in an Elasticsearch cluster using the REST API. | codefeedback |
Describe an algorithm for sorting an array of n integers in O(n log n) time. | codefeedback |
Change the list elements to binary numbers.
mylist=[3, 8, 9] | codefeedback |
Write a recursive function to calculate the Fibonacci sequence. | codefeedback |
Write an algorithm to calculate the nth Fibonacci number. | codefeedback |
How can you concatenate two strings in Python? | codefeedback |
Output code for a function that will remove all instances of an element from a given list.
my_list = [1, 3, 5, 3, 7, 9, 3] | codefeedback |
Explain how a hash table works. | codefeedback |
Using TensorFlow, create a model that predicts the price of an item from its features. | codefeedback |
Write a SQL query to get the names of all the employees in the "sales" department who have a salary higher than $55,000. | codefeedback |
Utilizing the Java syntax, write a code snippet to find the maximum value in the given array.
[4, 15, 11, 26, 2] | codefeedback |
Write a Tensorflow code for building a neural network with two input layers, two hidden layers and one output layer. | codefeedback |
Write an SQL query to fetch the rows with the top 3 highest salary from the table.
Table: Employees
id |name |salary
1 |John |100
2 |Bob |90
3 |Adam |80
4 |Alice |120 | codefeedback |
Write a function to generate valid random passwords.
passwordlen = 8 | codefeedback |
Find the subarray with the largest sum in an integer array of length n.
[3, -2, 1, 5, 6, -1, 4] | codefeedback |
Identify the longest consecutive sequence of zeros in a binary string.
110010001 | codefeedback |
Write a JavaScript to create a new array containing the squared values of all odd numbers in the range (1, 10)? | codefeedback |
Write a SQL query that joins two tables.
Table1:
Id Name Age
1 John 30
2 Alice 20
Table2:
Id Country
1 USA
2 England | codefeedback |
Generate a correct C++ program that computes the square root of a given number.
float number = 3.14 | codefeedback |
Compute median of a given set of integers
[1, 6, 5, 8, 14, 9] | codefeedback |
Edit this HTML form to make sure that the input data is validated.
<form action="/submit">
<input type="text" name="name" />
<input type="submit" value="Submit" />
</form> | codefeedback |
Construct an algorithm to apply merge sort to an array of integers.
[1, 10, 2, 5, 8, 7] | codefeedback |
Write a script in JavaScript to perform a bank transaction. | codefeedback |
Create a machine learning algorithm to classify emails as spam or not spam. | codefeedback |
Select the appropriate language to implement a linked list data structure. | codefeedback |
Write a Java program to print binary numbers from 0 to 15. | codefeedback |
Create a Bash function that takes an integer as input and prints out the corresponding ASCII character.
97 | codefeedback |
Write a JavaScript function to check if all elements of an array of numbers are distinct.
[1,2,3,4,5] | codefeedback |
Change the following code so that it will still print the same output but with a better runtime complexity.
def find_duplicates(list):
duplicates = []
for i in range(len(list)):
current = list[i]
for j in range(len(list)):
if i != j and list[j] == current:
duplicates.... | codefeedback |
Write a SQL query to select the 10th highest salary from an employees table. | codefeedback |
Create a JavaScript program that formats currency values. | codefeedback |
Implement a function in Python that takes two parameters, an array and a number, and sorts the array in ascending order by the number.
[5, 29, 4, 7, 28], 3 | codefeedback |
Create a machine learning model to classify the following dataset.
x1 x2 x3 y
2 4 2 0
-1 -2 1 1
-1 1 0 1
-2 2 1 0 | codefeedback |
Create a program to check if two binary trees are identical. | codefeedback |
Create a program to find the maximum depth in a binary tree. | codefeedback |
Create a machine learning model to classify an email into spam and non-spam classes. | codefeedback |
Construct an array which contains the count of each character present in the given string.
String: “Hello world” | codefeedback |
Design a data structure in C++ to store a large set of customer data | codefeedback |
Generate code in C++ to determine the number of palindromic substrings in a given string. | codefeedback |
Design an algorithm in Java for solving a linear search problem. | codefeedback |
Write a code to create Fibonacci sequence in Python | codefeedback |
Develop JavaScript code to find the nth Fibonacci number. | codefeedback |
Write a compare() function in Java that takes two values and returns -1, 0, or 1 if the first value is less than, equal to, or greater than the second value. | codefeedback |
Train a logistic regression model on the housing prices dataset with 5 features. | codefeedback |
Write a SQL query to select all rows from a table where the value of a column is between two ranges. | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.