instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Create a game of rock-paper-scissors using functions and conditionals. | codefeedback |
Create a Keras model that can classify between two classes. | codefeedback |
Create a SQL query that prints a list of customers and the total amount they have purchased.
Table 1: Customer
- Name
- Address
Table 2: Order
- Customer Name
- Order Amount | codefeedback |
Implement a version of your own version of quicksort in Python | codefeedback |
Output the first 10 numbers in the Fibonacci series. | codefeedback |
Find all numbers from a given array that can be expressed as the sum of two squares.
arr = [2, 3, 4, 6, 8, 10] | codefeedback |
Design a MongoDB collection Schema for stores' inventory records. | codefeedback |
Create a JavaScript Object for a Student with key-value pairs for their id, name, and nationality. | codefeedback |
Write a function to find the longest substring without repetition.
str = "pwwkew" | codefeedback |
Generate a random 10-character string with an even distribution of lowercase letters and numbers. | codefeedback |
Reverse the words of the English sentence "This is a pen". | codefeedback |
Write a query to find the second highest salary from the table Employees. | codefeedback |
Create a code to save the first ten prime numbers in an array. | codefeedback |
Create a TCP server program using Python. | codefeedback |
Write a code to construct a BST with the elements 11, 18, 14, 6 and 7. | codefeedback |
Rewrite the given line of code to make it more efficient and concise.
ifA==1 and B==2 and C==3: | codefeedback |
Compute the length of a given string without using in built length function.
String: Hello | codefeedback |
Insert a node at a specific position in the linked list.
Linked List: 0->3->4->7
Node: 5
Position: 2 | codefeedback |
Design a classifier using Machine Learning in Python | codefeedback |
Write a Pascal program to convert a number from decimal to hexadecimal. | codefeedback |
In a given list of integers, find the value that appears most frequently.
nums = [2,2,2,2,3,4,5,6,6,7] | codefeedback |
Insert the missing code to print the list of numbers in reverse order.
nums = [1, 2, 3, 4, 5] | codefeedback |
Write C# code to create a simple calculator that can add, subtract, divide, and multiply two numbers. | codefeedback |
Given two strings, write a JavaScript code snippet to check if the two strings are anagrams of each other. | codefeedback |
Given a 2-D array, write a C++ code snippet to find the maximum sum of all the numbers that are strictly increasing in a diagonal pattern.
[[1, 2, 3],
[4, 5, 6],
[7, 8, 9]] | codefeedback |
Write a number of equations using the variable x to calculate the area of a triangle with its base set to 5 and its height set to 7. | codefeedback |
Write a regular expression that matches a valid email address format. | codefeedback |
Develop a C program to reverse a string using a pointer. | codefeedback |
Convert the HTML code to valid XML.
<html>
<body>
<div>Hello World!</div>
</body>
</html> | codefeedback |
Generate a regular expression that matches any number that is greater than 0.
No input | codefeedback |
Design a program to create a new string with the characters of the first string in the reverse order.
String = "Hello World" | codefeedback |
Suggest a better way to improve the following SQL statement.
SELECT * FROM students WHERE score > 50 | codefeedback |
Output the Fibonacci sequence from 0 to 15. | codefeedback |
Construct a RegEx pattern to identify a number followed by three uppercase letters. | codefeedback |
Using the given array, create a function that returns a new array that contains elements that are greater than the given number.
arr = [2, 3, 6, 9, 5]
num = 4 | codefeedback |
Create an array of numbers that is a random combination of integers from 1 to 25 | codefeedback |
Generate a random password of 8 characters, including at least one letter, one number, and one symbol | codefeedback |
Convert the following XML code to JSON.
<people>
<person>
<name>John</name>
<age>24</age>
</person>
<person>
<name>Dave</name>
<age>30</age>
</person>
</people> | codefeedback |
Generate a SQL query to select all students who are in the 'Computer Science' program.
table_name = 'students' | codefeedback |
Find all possible permutations of the string "ABC". | codefeedback |
Find the longest substring of a string without repeating characters
string="abcabcbb" | codefeedback |
Write Python code to return all indices of substrings in a given string.
string= "hi world bye world" | codefeedback |
Compress a given string using Run Length Encoding
string="WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW" | codefeedback |
Parse a given expression tree to evaluate the result | codefeedback |
Convert the given list to a dictionary where the items are the keys and the values are square of the keys.
myList3 = [1, 2, 3, 4, 5] | codefeedback |
Describe the necessary steps to debug a python program. | codefeedback |
Write a function to retrieve the last element of a given array of strings.
arr = ["word", "sentence", "paragraph"]; | codefeedback |
Create a function to sort an array of objects by the value of a certain key.
arr = [{'name': 'john', 'age': 20}, {'name': 'tim', 'age': 25}, {'name': 'mike', 'age': 30}]; | codefeedback |
Using the given data, write a function that returns the average of the given numbers
a_list = [1, 2, 3, 4, 5] | codefeedback |
Create an algorithm with pseudocode to find maximum and minimum element of an array. | codefeedback |
Design a function in Java that rotates a N x N matrix 90 degrees. | codefeedback |
Can you propose a way in C for extracting the day, month and year of the input date in the format "dd-mm-yyyy"?
date = "31-12-2020" | codefeedback |
Suggest a line of code in Rust for generating a random number within a given range. | codefeedback |
Can you propose a C++ program for adding two matrices?
Matrix1 = [[2, 3],
[4, 5]]
Matrix2 = [[6, 7],
[8, 9]] | codefeedback |
Generate the first 10 prime numbers. | codefeedback |
Rearrange the elements of the list in ascending order.
my_list = [8, 1, 3, 5, 4, 9] | codefeedback |
Using the given dictionary, find the most frequent element
my_dict = {"A":1,"B":1,"C":3,"D":3,"E":3} | codefeedback |
Write a SQL query to retrieve the author and title of all books whose title contains the word "machine". | codefeedback |
Write a function that takes in two numbers in Roman numerals and outputs the sum.
Roman numeral 1: XVI
Roman numeral 2: IX | codefeedback |
Create a function that takes an array of integers and returns an array where each index is the product of all the numbers except for the number at that index.
lst = [1, 2, 3, 4, 5] | codefeedback |
How can you let a user input a character in a Java program? | codefeedback |
Construct a SQL query to count the number of occurrences of a certain value in a particular column of a table. | codefeedback |
Find the length of the longest increasing subsequence in an array.
arr = [10, 22, 9, 33, 21, 50, 41, 60] | codefeedback |
Convert the following number from binary to decimal form: 1101.
1101 | codefeedback |
Create an algorithm to evaluate a given expression.
(3 + 5) * 2 | codefeedback |
Create an assembly program that takes an integer as input and displays the sum of digits of that number. | codefeedback |
Find the intersection of two sorted arrays in Java.
arr1=[1, 2, 4, 5, 6]
arr2=[2, 3, 5, 7] | codefeedback |
Create a C Program that takes an array of integers and returns an array of the prime numbers present in the array.
arr = {2, 3, 5, 6, 9, 10, 15} | codefeedback |
What is the purpose of using a data structure? | codefeedback |
You are given two strings and you need to output true if they are anagrams of each other, false otherwise.
String 1: eat
String 2: tea | codefeedback |
Read the given code and detect which variables are not declared.
int x=3;
y=4;
int z=x+y; | codefeedback |
Implement a function to rotate a list by k elements.
list = [1,2,3,4,5], k = 2 | codefeedback |
How does the Binary Search algorithm work? | codefeedback |
Write a PHP program to flatten a multi-dimensional array. | codefeedback |
Write a Rust program to find the lowest common ancestor in a given tree. | codefeedback |
Write code that adds two numbers using the unary operator. | codefeedback |
Write code to find the depth of a binary tree. | codefeedback |
Write a C# program to remove all characters in a given string except the 'Space'
Hello World | codefeedback |
Construct a SQL query to find the employees younger than age 35 from the table called 'employees' | codefeedback |
Generate a SQL command to update the salary by 5% for all the employees. | codefeedback |
Generate a query in SQL to find the difference between the maximum and minimum salary from the 'employees' table. | codefeedback |
What is the difference between a REST API and SOAP API? | codefeedback |
Write an Android application to detect the magnetic field of a device. | codefeedback |
What is the Big-O notation and why is it used? | codefeedback |
Create a program to remove all duplicate elements from a list and return a new list with the unique elements. | codefeedback |
Calculate the area of a circle whose radius is given by the value stored in the variable `radius`.
radius = 5 | codefeedback |
Using the given input, generate a code to print in reverse order.
a_list = ['a', 'b', 'c', 'd', 'e'] | codefeedback |
Parse the following HTML code and store the data in a Python dictionary.
<div><h2>Header</h2><p>Text</p></div> | codefeedback |
Write a JavaScript function that returns the first 50 prime numbers. | codefeedback |
Calculate the determinant of the following matrix.
[1, 3, 4],
[5, 6, 7],
[9, 8, 2] | codefeedback |
Write a Python code to generate a random password of 12 characters containing a mix of numbers, alphabets, and special characters. | codefeedback |
In Java, write a method that wraps a given string into a paragraph with each line no longer than the given number of characters. | codefeedback |
Rewrite the following SQL query in C#.
SELECT * FROM products WHERE price > 10; | codefeedback |
Write a Bash script to print the sum of all even numbers between 0 and 100. | codefeedback |
Identify the specific type of this given object:
object = {
"name": "John",
"age": 27,
"sex": "male"
} | codefeedback |
Create a data frame in R with 3 columns and 10 rows of randomly generated numerical data. | codefeedback |
Create a content aggregator application in Python. | codefeedback |
Write a Python program that uses recursion to calculate the Fibonacci sequence up to the 25th number. | codefeedback |
Compose a python function to find the maximum element in a 2-dimensional array.
array = [[2, 4, 7, 1], [8, 12, 9, 5]] | codefeedback |
Implement the bubble sort algorithm for a linked list.
link_list = [10->9->8->7->6] | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.