instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Design a data structure for a deck of cards
codefeedback
Write a code to generate a random float between -5 and 5.
codefeedback
Write a code to find the most frequently occurring item in the list. [17, 25, 6, 30, 14, 28, 6, 20, 13, 25]
codefeedback
Create a function that takes two strings as parameters, compares them, and returns 0 if they are equal, 1 if the first string is greater, and -1 if the second string is greater.
codefeedback
Write code to calculate the cosine similarity between the two given sentences Sentences: "this is a great day" and "this is a superb day"
codefeedback
How do you develop a software application through agile?
codefeedback
How can you use recurrent neural networks for sequence prediction?
codefeedback
Sort a given array of integers using Quick Sort
codefeedback
Write a code snippet to find all the Pythagorean triplets which sum up to the given number.
codefeedback
Design a program to find all prime numbers up to a given limit n.
codefeedback
Modify the following code to swap the values of two variables without using a third variable. a = 5 b = 3
codefeedback
Write a Java class to define a student object that includes a name and a grade.
codefeedback
Write an Iterative program in Java to print the first n terms of the Fibonacci sequence.
codefeedback
Create a bar chart in Python, plotting the following integer data set. [1, 2, 4, 8, 16, 32]
codefeedback
Create a python script to determine whether a number is odd or even. 15
codefeedback
Make a prediction using the following machine learning model in Python.
codefeedback
Write a regex pattern to check if the given string is a US phone number.
codefeedback
Identify the wrong code in this JavaScript snippet. let a = "Hello World!"; console 'log(a);
codefeedback
Convert the string "Hello World" to upper case using a Java program.
codefeedback
Create a C++ program for printing a pyramid pattern up to a given number. //n = 5
codefeedback
Compute the maximum amount of money X which can be obtained using two given coins of denomination A and B. A = 5 B = 7 X = 31
codefeedback
Create a function to group a given set of numbers into a continuous range Set of numbers: [1, 3, 4, 6, 7, 8, 10]
codefeedback
Write an SQL query to identify the most frequently occurring value in a given column
codefeedback
Create classes and interfaces to represent an online news system.
codefeedback
Design a data structure that will store name, phone number and address of a person.
codefeedback
Create a function that converts an arbitrary number from any base between 2 and 16 to its decimal representation. int value = 0xFE;
codefeedback
Create an SQL query that returns the top five most expensive items in the table.
codefeedback
You need to write a function that validates a given password. It should only be valid if it contains at least one lowercase letter, one uppercase letter, one number, and one special character.
codefeedback
Reverse a given array without using a loop. arr = [1,2,3,4]
codefeedback
Write a CSS class that will make the font size of all elements 2 times larger.
codefeedback
Convert the given list of integers to a string of comma separated values. [1, 2, 3, 4, 5]
codefeedback
Write an algorithm to calculate the average of a list of integers given as input.
codefeedback
Write a JavaScript function to convert a given number to its Roman numeral equivalent.
codefeedback
Design an algorithm to check if a given string can be converted to a palindrome.
codefeedback
You are given an array of integers and you need to find the maximum sum of any subarray of the given array.
codefeedback
Suggest a way to search for a target element in a binary search tree in less than O(n) time.
codefeedback
Design an algorithm to check if two given binary trees are identical.
codefeedback
Format the strings given in the list so that only the first letter of each word is in upper case. ["Hello world", "Wonderful DAY"]
codefeedback
Use Java to generate a string containing 1000 random characters of length 10.
codefeedback
Write a JavaScript function to check whether a string contains all the vowels in alphabetical order.
codefeedback
Generate a correct Java program to swap two given numbers.
codefeedback
Write a Python program to convert a given binary string to its equivalent hexadecimal representation.
codefeedback
Find the largest integer in this list? [1, 4, 9, 3, 5]
codefeedback
Program a binary search algorithm. data: [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] target: 16
codefeedback
Perform a selection sort on the given array [4, 1, 10, 8, 5]
codefeedback
What will be the ouptut of below operation? print(4 >> 2)
codefeedback
Write a script to scrape wikipedia page's html.
codefeedback
Compare and contrast AJAX and XMLHttpRequest.
codefeedback
Write a long-running Python script with a while loop?
codefeedback
Calculate the sum of angles in an octagon.
codefeedback
Generate a regular expression that can detect if the length of given strings is above 10.
codefeedback
Edit the following code so that it prints the given value to the console. System.out.println("Hello World"); 5
codefeedback
Modify the following code so that it prints out the characters from the given string one at a time. String str = "Hello World";
codefeedback
Using the heapsort algorithm, sort the following array of numbers in ascending order. [97,54,67,8,2,22,5,47]
codefeedback
Compute the probability of each string from the below list. ['apple', 'banana', 'watermelon', 'mango']
codefeedback
Calculate the value of "x" in the equation "5x - 12 = 8".
codefeedback
Generate code that implements a method to compare two strings.
codefeedback
Categorize the following string as either a palindrome or not. Input: "racecar"
codefeedback
What is the fifth prime number?
codefeedback
Write a code that returns the longest substring of the given string without repeating characters. string = "abcabcbb"
codefeedback
Write an SQL query that displays a table of the ten most commonly used words in the given article. Today, I climbed the tallest mountain in the world. It was an incredible experience with stunning views and a sense of accomplishment at the top.
codefeedback
Translate the following JavaScript code into Python. let x = 10; if(x > 0){ console.log("x is positive"); }
codefeedback
Write a function to reverse a linked list in O(n) time complexity.
codefeedback
Create a MySQL trigger to store the times for insertion and updating a row in a table.
codefeedback
Write a Python program to parse a text string given a regular expression and return the matches.
codefeedback
Create a TensorFlow neural network model to classify animals into 4 categories.
codefeedback
Create a MongoDB query to find all the documents containing the string "Apple" in the field "Company".
codefeedback
Edit the following code to add a sharing feature that posts to Facebook. def share(message): #code here
codefeedback
Create a function that takes an array of numbers, calculates the sum of the numbers across all the arrays, and returns the average of those sums. arr = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
codefeedback
Given the following code, find the output. def f(x): if x == 0 or x == 1: return 1 return f(x-1) + f(x-2) print(f(4))
codefeedback
Edit the given code to use dynamic programming to solve the problem. def rod_cutting(arr, n): if n <= 0: return 0 max_val = 0 for i in range(0, n): max_val = max(max_val, arr[i] + rod_cutting(arr, n-i-1)) return max_val
codefeedback
Create an algorithm in JavaScript to sort an array of numbers. [5, 2, 4, 6, 1]
codefeedback
Design an algorithm in JavaScript to check if a given string consists of only unique characters. Hello
codefeedback
Write the SQL query to select the last element of a table table_name: users
codefeedback
Use Predicate logic for representing the following statement. "An elephant only lives in an African safari."
codefeedback
Convert the given context free grammar to Chomsky Normal Form. S --> AaBb A --> aA | b B --> bB | a
codefeedback
Explain how to use trapezoidal approach for numerical integration.
codefeedback
Write a Java method to remove all whitespaces from a string
codefeedback
Write a C++ program to find the sum of all the perfect numbers between two given inputs.
codefeedback
Explain how inheritance works in programming.
codefeedback
Design a class for a user profile.
codefeedback
Implement a JavaScript function to find all distinct prime factors of a given number.
codefeedback
Design a HTML page to display a table of students’ grades for a specific subject.
codefeedback
Create a PHP script to print out Fibonacci numbers up to 50.
codefeedback
Reverse this sentence: "I can do coding."
codefeedback
Using the given object, create a function to print out the value of the property "age" within the object. let obj = { name: 'John', age: 20, printDetails: () => { console.log(`The name is ${name} and age is ${age}`); } }
codefeedback
Implement a method in Java to generate a random float within the given range. min = 0.3 max = 0.7
codefeedback
Let's try a different sort algorithm. Generate a Python code snippet to implement merge sort.
codefeedback
Create a MySQL query to select the records whose name fields begins with an "A".
codefeedback
Develop a CSS/HTML page with a 3-column layout and a sticky navigation bar.
codefeedback
Create a function to encrypt a string using the XOR operator. key = 'ABCDEFG'
codefeedback
What algorithm should be used for predicting the output for a given input?
codefeedback
List the layers of an artificial neural network.
codefeedback
How do the following Java methods work? public static void main(String[] args) { int[] arr = {2,4,6,8,10}; int n = 2; int result = binarySearch(arr, 0, arr.length-1, n); if (result == -1) System.out.println("Element is not present"); else System.out.println("Element is present...
codefeedback
Suggest a way to solve the following problem in Python: extracting the last element from a given list.
codefeedback
Create a HTML page that takes your name as input and welcomes you on page load.
codefeedback
Parse the given XML code and extract the value of the first attribute of the first element. <root> <item attr1="value1" attr2="value2"> <value>Logged</value> </item> </root>
codefeedback
Create a script to convert JSON to an array. {"name": "John Doe", "age": 30}
codefeedback
Create a function which converts a string representation of number in English to a numerical value. "one thousand two hundred and thirty four"
codefeedback
Create an algorithm to find the optimal sum from a set of given numbers such that the sum is equal to a given target. Target: 10 Numbers: [1,4,5,3,6]
codefeedback