instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Write an HTML page which takes in user input and makes an AJAX request to a web server. | codefeedback |
Concatenate the strings in the given list using Java.
list = ["hello", "world", "!"] | codefeedback |
Parse a given HTML page to extract all <h1> tags.
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a heading 1</h1>
<h2>This is a heading 2</h2>
<h1>This is another heading 1</h1>
</body>
</html> | codefeedback |
Code a function in JavaScript to find the area of a triangle given the lengths of its three sides. | codefeedback |
Edit the given SQL query to return the number of employees from each team.
SELECT * FROM Employees | codefeedback |
Design an algorithm to detect whether two given strings are permutations of each other. | codefeedback |
Explain the difference between .push(), .pop(), .shift() and .unshift() methods in JavaScript arrays. | codefeedback |
Clone a given repository and create a pull request.
https://github.com/myusername/myrepo | codefeedback |
Calculate the difference between two given dates in terms of days.
date1 = "2020-5-15"
date2 = "2020-6-20" | codefeedback |
Write a SQL query to update all the records in the table with new values from another table. | codefeedback |
Write a PHP code to validate a date in the format MM/DD/YYYY. | codefeedback |
Create a MySQL query to list the authors and the number of books they wrote. | codefeedback |
Rewrite the following Python code to a Bash program.
v = [1, 2, 3, 4, 5]
for i in v:
print(i) | codefeedback |
Summarize the following article in one sentence.
The article is about the rise of artificial intelligence, and how it is impacting the job market and our lives in general. | codefeedback |
With the provided data, find the correlation coefficient between the two variables.
x: [4, 5, 7, 8]
y: [6, 7, 8, 10] | codefeedback |
Given two strings, s1 and s2, write a program to return the longest common substring between them.
s1 = 'abcdef'
s2 = 'fghijk' | codefeedback |
Given a linked list, write a program to delete a given node.
1 -> 2 -> 3 -> 4 -> 5 -> NULL
Node = 3 | codefeedback |
What is the difference between higher order functions and first class functions? | codefeedback |
Create a compiler in C++ to compile a given source code. | codefeedback |
What does the SELECT statement in SQL do? | codefeedback |
Write a piece of code that implements a 3-way merge sort in Java. | codefeedback |
Create a function in C to edit a string. The function should correct all occurrences of two or more consecutive spacets with a single space.
char str[] = "Hi everyone " | codefeedback |
Create a code to find the largest number from a list of given numbers in HTML. | codefeedback |
You need to sort an array of numbers in ascending order using JavaScript.
arr = [7, 4, 1, 10, 2] | codefeedback |
Write a bash command to view the amount of free disk space on your computer. | codefeedback |
Given a list of words and numbers, create a program to print out the unique words and unique numbers.
['cat', 'elephant', 'dog', '15', '20', 'elephant', '8'] | codefeedback |
Compare and contrast Java and Python for developing applications. | codefeedback |
Write a Python program to find the longest substring in a given string which has no repeating characters. | codefeedback |
Find all local maxima in the given list.
list_vals = [1, 2, 3, 4, 5, 2, 1] | codefeedback |
Create a script to find the longest palindrome in a given sentence.
This is a level sentence. | codefeedback |
Build a code to print out all permutations of the characters in a given string.
"ABC" | codefeedback |
Rearrange the following code segments to sort an array of integers in descending order.
array = [3, 5, 7, 1, 2];
A. for(let i=1; i<array.length; i++)
B. for(let j=i+1; j<array.length; j++)
C. if(array[i] < array[j])
D. [array[i], array[j]] = [array[j], array[i]]; | codefeedback |
Write an algorithm to find the longest sub string without repeating characters.
string = 'abcabcbb' | codefeedback |
Fill in the blank to generate a SHA-256 hash in JavaScript: | codefeedback |
Write a function in SQL to get the average salary of all engineers whose designation is "Senior Software Engineer". | codefeedback |
Implement a basic calculator using JavaScript. | codefeedback |
Write an SQL query to retrieve the top 3 scores in a table that contains scores for all players. | codefeedback |
Use Python to write a code that displays a multiplication table of a given number.
8 | codefeedback |
Using JavaScript, make a function to calculate the area of a circle with a given radius.
4 | codefeedback |
Write a function in Python which can generate a random string consisting of lowercase letters, numbers and symbols. | codefeedback |
Create a function in JavaScript for validating a given a string for all required special characters.
ExampleString: "This string should contain at least 1 digit, one special character and one capital letter." | codefeedback |
Create a database table to store student information such as id, name, gender etc. | codefeedback |
Implement a function that check if a number is prime. | codefeedback |
Implement the update function in Java for a queue data structure. | codefeedback |
Create a C++ Program to reverse the words of a string. | codefeedback |
How many lines of code does the following function contain?
def f(x):
s = 0
for j in range(1,x+1):
for k in range(1,x+2):
if j % k == 0:
s = s + 1
return s | codefeedback |
Write a code to extract data from a PDF document. | codefeedback |
Write a SQL query to find out all the cities that have the most expensive houses. | codefeedback |
Construct a query to find the 2nd highest salary from an employee table. | codefeedback |
Create an initialization script for a database. | codefeedback |
Create a program to generate random passwords of 8 characters consisting of letters, numbers and special characters. | codefeedback |
Compose a SQL query to display the highest minimum salary of the employees in each department. | codefeedback |
Create a C++ function to generate a binary tree with a breadth-first search algorithm.
Nodes: 5, 4, 8, 11, 13, 4, 7, 2, 5, 1 | codefeedback |
Write a SQL query to calculate the average age of customers who have purchased items from a store. | codefeedback |
Find the greatest number from an array.
arr = [41, 77, 56, 99] | codefeedback |
Deploy a Keras model to Google App Engine. | codefeedback |
Formulate a plan to automate a login process. | codefeedback |
Create a class for a basketball team. | codefeedback |
Write a regular expression pattern to find all the words which begin with a digit. | codefeedback |
Implement a queue data structure. | codefeedback |
Create a SQL query to retrieve the name, address and contact number of the customers with the highest spending record. | codefeedback |
Develop an API that returns a list of students and their ages. | codefeedback |
Write a MySQL query to find all the customers who have placed an order in the last 30 days. | codefeedback |
Generate permutations of the given array of numbers.
numbers = [1, 2, 3] | codefeedback |
Write the pseudo-code algorithm that implements the following polynomial equation
3x^3 + 4x - 2 | codefeedback |
Design the algorithm to perform a depth-first search on given binary tree | codefeedback |
Write the code to calculate a factorial recursively | codefeedback |
Create a sorting algorithm for an array that only needs 1 iteration | codefeedback |
Create a program to detect a loop in a linked list | codefeedback |
Debug the following code for finding the median of three numbers.
def find_median(a, b, c):
if a > b:
if b > c:
return b
elif a > c:
return c
else:
return a
elif b > c:
return b
elif a > c:
return a
else:
return c | codefeedback |
Given a string, return the length of the longest run of characters.
string = "aaaabbccdd" | codefeedback |
Create a function in JavaScript that takes a string as an argument and returns the number of times that string is repeated in the input string.
string = "HelloHello" | codefeedback |
Create a MongoDB query that returns all documents that contain the string "query". | codefeedback |
Create a valid regular expression that matches a valid U.S. phone number? | codefeedback |
Write a function that calculates the Fibonacci numbers to the nth number | codefeedback |
Write a code to identify the longest palindrome in a given string
String: kayakracecar | codefeedback |
Create a CSS rule to rotate a text 45 degrees | codefeedback |
Write a code to extract the length of the longest sentence in a given text
Text: The quick brown fox jumps over the lazy dog. The quick fox jumped over the lazy dog. | codefeedback |
Create a function that returns the sum of the Fibonacci sequence to the nth number | codefeedback |
Use recursion to construct a list of the first 10 powers of two (1, 2, 4, 8, ...). | codefeedback |
Design a class named Circle that can store information about a circle and perform calculations on it. | codefeedback |
Using Java, write a function to find the count of all odd numbers between a given range.
int start = 1;
int end = 10; | codefeedback |
Implement a recursive function to calculate the factorial of a number, given by the user as an argument. | codefeedback |
Create a code to display all unique pairs from the following list.
[1,2,3,4,5,6] | codefeedback |
Write a regular expression which can validate a given email address. | codefeedback |
How many distinct prime numbers are there less than 100? | codefeedback |
Find and list all the prime numbers between 0-100 | codefeedback |
Using Regular Expressions, search for all 3-digit occurrences in the given text.
text = "The ship had a 590 foot cargo hold, filled with 204 tons of goods." | codefeedback |
Create an algorithm to find out the longest common sub-sequence between two string inputs.
"AGGTAB"
"GXTXAYB" | codefeedback |
Create a Java method that takes a string and returns the same string with all vowels replaced by asterisks (ie. "Hello" should return "H*ll*").
String s = "Hello"; | codefeedback |
Create a test harness in C++ to verify the correctness of the following function
// A function to calculate the nth Fibonacci number
// Input: nth Fibonacci number
// Output: nth Fibonacci number
int calcFib(int n)
{
if (n<=1)
return n;
return calcFib(n-1) + calcFib(n-2);
} | codefeedback |
Create a function in Python to generate n permutations of a given array.
arr = [1, 2, 3]
n = 6 | codefeedback |
Implement a function in Python that takes a list of strings as parameter and prints out the longest string.
strings = ["Hello", "world", "Welcome","to", "my", "programming", "challenge"] | codefeedback |
Create a function that performs a bubble sort of an array in JavaScript.
arr = [4, 7, 1, 3, 6, 9, 8, 10, 2, 5] | codefeedback |
Write a function in Java that takes an integer and returns an array of all the prime numbers from 2 up to the number.
number = 10 | codefeedback |
Find the lowest common ancestor in a binary tree in C++. | codefeedback |
Generate a valid regular expression to catch URLs in strings. | codefeedback |
Output a list of each element in the input increase twice.
[1,10,20] | codefeedback |
Formulate a suitable machine learning model to perform topic clustering. | codefeedback |
Write a code to print out the list of the numbers from 0 to 10 in descending order. | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.