instruction_seed stringlengths 0 26.4k | source stringclasses 4
values |
|---|---|
Implement a function that takes in 2 strings and returns a new string consisting of alternating characters from the strings passed in.
"hello"
"world" | codefeedback |
Write a web scraping program to extract text from a given webpage | codefeedback |
Create a JavaScript program to calculate the Fibonacci number for a given integer n | codefeedback |
Implement an algorithm to print the steps of the Tower of Hanoi problem. | codefeedback |
Calculate the factorial of an integer using recursion. | codefeedback |
How do you create a new array of the same size as an existing array but with every element as 0 in Java? | codefeedback |
Write a function to create a new nested list with twice the length of the original.
original_list = [1, 2, [3, 4], 5] | codefeedback |
Find all the multiples of a number in between two given numbers. | codefeedback |
Write a function that takes a string and replaces all non-alphanumeric characters with the # symbol.
let str = "Hello* World!" | codefeedback |
Create a class in Java that creates a simple calculator which will add, subtract, multiply, divide and take square root of two numbers. | codefeedback |
Determine the maximum sum of a subarray within the given array.
[-2, 1, -3, 4, -1, 2, 1, -5, 4]. | codefeedback |
Build a JavaScript program to compute the largest prime number less than a given number N | codefeedback |
Create an algorithm to find the longest continuous increasing subarray. | codefeedback |
Implement an algorithm to select k elements from an array such that the sum of those elements is maximized | codefeedback |
Generate a random sample of size 10 using numpy | codefeedback |
Construct an API using Flask that returns an array of integers in response to a request | codefeedback |
Design a data visualization to show the average salary per gender | codefeedback |
Design a Python class structure for playing cards with two classes: Deck and Card. | codefeedback |
Write a SQL query to find the average number of 'likes' for each post in a table. | codefeedback |
Use TensorFlow to build a multi-layer perceptron to classify the MNIST digits. | codefeedback |
Use HTML and CSS to format a page with three columns, two of which contain two paragraphs each and the last containing a list of 10 items. | codefeedback |
Create a 4x4 matrix filled with random numbers between 0 and 9. | codefeedback |
Add a method called "printTitle" to the “Book” class defined above. | codefeedback |
Construct a query using MongoDB to find all the documents with a "city" field that equals "New York". | codefeedback |
Create a SQL query that returns the sum of all the numbers in the "num" column. | codefeedback |
Construct a query using MongoDB to find documents where the "user_id" field contains any number greater than 5. | codefeedback |
Write an SQL query to join two tables using an inner join.
TableA
id | name
1 | Joe
2 | Juan
TableB
id | age
1 | 25
2 | 30 | codefeedback |
Create a MySQL query to summarize total sales for each month.
Table name = Sales | codefeedback |
Write a script to display "Hello World" in the console twenty times | codefeedback |
Generate an HTML code to display the following speech bubble | codefeedback |
Create a function to calculate the number of different ways to climb n stairs | codefeedback |
Convert the following string from lower case to upper case
hello world | codefeedback |
Create an algorithm to determine the most common element in an array
[2, 3, 5, 3, 7, 2, 8, 1, 3] | codefeedback |
Compare the features of Mercurial and Git. | codefeedback |
Edit the following JavaScript code to add two functions, one to increase the number of elements in the array and another to remove the last element in the array.
let array = [1, 2, 3, 4]; | codefeedback |
Edit the following C code so that an infinite loop is created:
#include <stdio.h>
int main()
{
int i = 0;
while(i<10)
{
printf("%d\n",i);
i++;
}
return 0;
} | codefeedback |
Write a MySQL query to select all employees who are 30 years old or above. | codefeedback |
Using a try-except statement, write a program to check whether the input is an integer or not. | codefeedback |
Write a SQL query to find all the users that have been created within last 24 hours. | codefeedback |
How would you create a class in Java and add a field, constructor and method? | codefeedback |
Use the OpenGL API to create a vertex buffer object (VBO). | codefeedback |
Write a PHP script to display the system environment variables. | codefeedback |
Create a program that takes in an array of integers as input and returns a sorted array in ascending order.
[7, 3, 5, 9, 11, 10] | codefeedback |
Create a program which takes a given list and returns a list with only the unique elements.
[3, 5, 7, 9, 5, 3, 7] | codefeedback |
Design an algorithm in Python for reversing a linked list. | codefeedback |
Given a list of integers, write a function that takes the list and returns only the odd numbers in the list. | codefeedback |
Generate a C++ program that sorts the elements in an array using the quick sort algorithm. | codefeedback |
Generate a program that accepts an integer array and returns its median value | codefeedback |
Construct an SQL query to count the number of houses with four bedrooms. | codefeedback |
Create a Ruby program to generate a random 9-digit alphanumeric string. | codefeedback |
Create a function "getGrade" to get a grade based on a numeric score. | codefeedback |
Create a CSS class to make a <div> element have a width of 50%, a height of 75px, and a blue background color. | codefeedback |
Use a neural network to classify handwritten digits from the MNIST dataset. | codefeedback |
Generate code to rearrange a given array of integers.
[2, 4, 6, 8] | codefeedback |
What type of search algorithm is used to find the shortest path between two points? | codefeedback |
Given a string consisting of alphanumeric characters, separate it into left and right parts so that the left part contains only digits and the right part contains only letters.
String: Ab243rG | codefeedback |
Write a code to train a sentiment classification model on the IMDB sentiment analysis dataset. | codefeedback |
Write a code to print out all numbers between 1 and n divisible by 3 and 5 without using a loop. | codefeedback |
Create a function that takes a string and an integer as input and returns the string repeated n times. | codefeedback |
Write a MySQL query to select records that are older than 3 months and younger than 5 years. | codefeedback |
Construct an object in JavaScript where the key is an integer from 1 to 10 and the value is a boolean representing if it is an even number or not. | codefeedback |
Convert the following character stream into a number.
char_stream = “8kk573" | codefeedback |
Write an SQL query to calculate the maximum salary earned by each employee in the table "salary" which has columns "employee_name" and "salary". | codefeedback |
Write a function that expects a string as a parameter and returns all the words in the string with the length greater than three
This is a test string | codefeedback |
Write a code to generate a random password containing at least one symbol, one number, one lowercase letter and one uppercase letter | codefeedback |
Suggest a code to extract the first and last occuring characters from a string.
String: "Hello World!" | codefeedback |
Generate an algorithm that creates a Fibonacci sequence | codefeedback |
Generate a code to identify duplicate elements in a list | codefeedback |
Edit the following HTML form to validate an email address.
<form>
<input type="text" name="email">
<input type="submit" value="Submit">
</form> | codefeedback |
Format the following string according to the specified condition.
String: "first_name,last_name,age"
Condition: each word should have its first letter capitalized | codefeedback |
Design a data structure to store a list of numbers and the corresponding and their frequencies. | codefeedback |
Write a code to find the longest consecutive sequence inside of a given list of numbers.
[1, 3, 5, 7, 8, 2, 4, 9] | codefeedback |
Generate a random list containing 10 elements in the range of 0-20 | codefeedback |
Design a query in MongoDB to select documents based on a particular value in an array.
DB student {
id INT,
name VARCHAR(100),
marks_arr INT[],
total INT
} | codefeedback |
Rewrite the following PHP code to add a new item to the array.
$my_array = array('apple', 'orange'); | codefeedback |
Write a function in Python that takes a number n as its parameter and returns the sum of the squares of the first n natural numbers | codefeedback |
Write a function that takes an array of numbers and returns an array whose elements are the product of all the elements except the element at the current index.
arr = [2, 3, 4, 5] | codefeedback |
You are given a string and you need to write a function that splits the string at the mid point and switch the order of the two parts.
str = "Hello World!" | codefeedback |
Print the running total of numbers in the following list.
numbers = [2, 3, 4, 7] | codefeedback |
Given an array of numbers, provide a nested for loop to calculate the sum of elements in the array. | codefeedback |
Use TensorFlow to create a convolutional neural network to classify handwritten digits. | codefeedback |
Develop a program that prints all the prime numbers between 0 and n. | codefeedback |
Write a Python function that takes in one argument and prints out the Fibonacci number for that argument. | codefeedback |
Identify the vulnerabilities in the given program
def transferMoney(username,amount):
#read from db their current balance
curBalance=readDB("SELECT bankBalance from users where username=" + username)
#update the current balance
curBalance+=amount
#write to the db with the new balance
writeDB("UP... | codefeedback |
Create a HTML program to simulate a digital clock | codefeedback |
What should be the correct return statement for the following C++ function?
int findMinMax(int arr[], int n, bool min) | codefeedback |
Write a function that, given a binary tree, prints all of its element "level by level".
1
/ \
2 3
/ \ / \
4 5 6 7 | codefeedback |
Write an algorithm that finds the longest palindromic substring of a given input string.
"forgeeksskeegfor" | codefeedback |
Write a JavaScript function to flatten an array up to the given depth.
[1, [2, [3, [4, 5], 6], 7], 8], 3 | codefeedback |
Write an algorithm that finds the least common ancestor of two given nodes in a binary tree.
1
/ \
2 3
/ \ / \
4 5 6 7
Least Common Ancestor (LCA) of 4 and 5 | codefeedback |
Create a JavaScript code to represent a double-linked list | codefeedback |
How to sort an array of strings by length in JavaScript? | codefeedback |
What do you need to do in order to make an HTTP request using cURL? | codefeedback |
Write a Java method to swap of two integer values. | codefeedback |
Write a Ruby program to print out all the numbers between 1-100 which are divisible by 5. | codefeedback |
Implement an efficient algorithm for reversing a sentence in C.
"This is a sentence." | codefeedback |
Explain the recursive implementation of the binary search algorithm. | codefeedback |
Given a linked list, write a function to reverse it. | codefeedback |
Create a class in Java which computes the sum of squares of even numbers between k and n. | codefeedback |
Write a function to compress a string by counting the characters. | codefeedback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.