instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Generate a code to perform a Merge Sort on an unsorted array of numbers.
codefeedback
What are the components of a class in Java?
codefeedback
Name the four programming paradigms.
codefeedback
Using Java, write the code to calculate the sum of elements in a two-dimensional array. int[][] arr = { {2, 3, 8}, {4, 5, 1}, {7, 0, 6} };
codefeedback
Calculate the area of a square with side length 4.
codefeedback
Take the input list and transform it to a dictionary where the keys are the elements of the list and the values equal to True. my_list = ["apple", "banana", "strawberry"]
codefeedback
Using the given input, modify the code to remove all occurences of "abcd" string s = "abcd abcd abcd abcd";
codefeedback
What type of function is needed to solve the following problem Compute the average age of a given list of numbers
codefeedback
Generate a correct JavaScript program to convert a string into an array s = "hello world";
codefeedback
Generate an XOR function in C++.
codefeedback
Calculate how many distinct values can be inserted in a binary tree containing 2 nodes.
codefeedback
Write a JavaScript program to convert an array of objects into an object of objects. [ { id: '001', firstName: 'John' , lastName: 'Doe' }, { id: '002', firstName: 'Jim' , lastName: 'Smith' }, { id: '003', firstName: Joe , lastName: 'Mail' }, ]
codefeedback
Create a class in jQuery to handle user authentication.
codefeedback
Create a function in JavaScript to implement Newton's Method of Numerical Approximation.
codefeedback
Create an algorithm in JavaScript to find the closest pair of points from a given set of points. let points = [[2, 0], [4, 4], [-2, 2], [-3, -4], [4, -2]];
codefeedback
Translate the following SQL query into MongoDB syntax. SELECT * FROM properties WHERE bedrooms > 3 and price < 500
codefeedback
Create a Drupal 8 theme that implements a 3 column layout with a header, side bar, content and footer.
codefeedback
Implement a webhook endpoint in Java using Spring MVC to process a payment request.
codefeedback
Generate a regular expression to match a string of consecutive numbers with a minimum of 4 digits.
codefeedback
Can you code a solution to Bubble Sort an array of integers? [5, 4, 3, 2, 1]
codefeedback
Generate a random 5-element list of integers between 0 and 10.
codefeedback
Find the lowest integer that can not be represented as the sum of two prime numbers.
codefeedback
Design a method for reversing a string in Java
codefeedback
Convert a given XML document to JSON document
codefeedback
Sort the list using Quick Sort [2, 3, 5, 6, 1, 4]
codefeedback
Write a JavaScript function that returns that number of elements from an array of numbers which sum up to a given target. array = [2, 3, 7, 8, 10] target = 11
codefeedback
Write a Python function to check if a given string is a palindrome and has all the vowels in it.
codefeedback
Write a Python script to detect if two numbers have the same frequency of digits.
codefeedback
Explain how a min-heap works.
codefeedback
Suggest a type of join to use to find all customers with an order total greater than $100. Table: Customers Columns: customer_id, name Table: Orders Columns: order_id, customer_id, total
codefeedback
Design a data structure to store the details of a student (Name, Age, Course).
codefeedback
Write an algorithm to swap two elements a[i] and a[j] in a given array a.
codefeedback
Generate a correct c++ program to compute the YTM of a bond
codefeedback
Suggest a code snippet to detect a cycle in a linked list
codefeedback
Given a list of integers, write a function in Python to sort and reverse the list. input_list = [3, 8, 10, 1, 9]
codefeedback
Generate a list of all even numbers between 20 and 40.
codefeedback
How can you create a dictionary in Python with 3 key-value pairs?
codefeedback
Train a machine learning model without using any frameworks with the folowing input and output data. Input Data: A, B, C, D Output Data: 0, 1, 0, 1
codefeedback
Create a React component for a button that takes two props: an onClick event handler and an id.
codefeedback
Write an SQL query that returns all the students with their marks from the following table. Student ( id, name, marks) Marks (sub_id, marks)
codefeedback
Complete the following bash script with conditional statements. #!/bin/bash echo " Enter an integer " read num
codefeedback
Develop a web page that displays the current temperature in various cities.
codefeedback
Write a code that takes a list as input and returns a list of every permutation of that list [1, 2, 3]
codefeedback
Construct a regex statement to select all words starting with a capital letter.
codefeedback
Calculate the factorial of n using a recursive function.
codefeedback
How could Big data analysis be used to provide better services and products ?
codefeedback
Write a function to calculate all the possible paths for a N x N matrix.
codefeedback
Write a Python code to initialize a 10 x 10 matrix with random values.
codefeedback
Design a database schema for an online banking system.
codefeedback
Implement a quicksort algorithm in JavaScript that takes an array of numbers as input and returns a sorted array. input_array = [21, 4, 1, 3, 9, 20, 25]
codefeedback
Write a code snippet to loop over the characters in a string and add them to an array in Python.
codefeedback
Given an array of positive numbers, write a function to return the maximum number of adjacent numbers with the same sign. arr = [5, 2, 3, -2, 4, -5, 2, 3]
codefeedback
Print the longest palindrome from the given string s = "abbaba"
codefeedback
Which sorting algorithm is the best for linked lists?
codefeedback
Write a code to print out an array of the first ten positive even numbers.
codefeedback
Capitalize the letters A - Z in the given string. text = "We are learning natural language processing"
codefeedback
Write a Regex expression to extract all numbers larger than 0 in a string
codefeedback
Which boolean value will be returned if the expression 5 is not equal to 10 is evaluated?
codefeedback
Output a triangle shape using only asterisks (e.g. *) in Java.
codefeedback
Reverse this array in-place using Python. arr = [4, 2, 8, 6]
codefeedback
Design a data structure to model the evolution of a population.
codefeedback
Given a list of numbers, implement a quick sort algorithm. [7, 4, 5, 9, 1]
codefeedback
Write a SQL query that sums the values in the "Amount" column of a table called "Transactions".
codefeedback
Generate a unique 8 digit alphanumeric ID using Java.
codefeedback
Write a Python program that reads a list of words and prints the most frequently used one. ['apple', 'banana', 'orange', 'apple']
codefeedback
Output a string which is the reverse of the input string. "Hello World"
codefeedback
Output a code to edit the following HTML to add a new heading 'Introduction' before the existing heading 'About'. <h1>About</h1>
codefeedback
Write a SQL query to select all the customers who have an account balance of more than $1000.
codefeedback
Create a text classifier using supervised learning.
codefeedback
Create a machine learning model that predicts whether an email is spam or not.
codefeedback
Select what section of the code must be changed for the following C++ code snippet to compile correctly. int main() { std:cout << "Hello World!"; return 0; }
codefeedback
Write a pseudocode to compare two strings and determine which is longer.
codefeedback
Parse the given markup language to extract out the attributes and their corresponding values. <html> <head> <title>My Amazing Website</title> </head> </html>
codefeedback
Write code to times the number entered by the user by 3.
codefeedback
Find the square root of the given number using the Newton-Raphson method. Number: 100
codefeedback
What is deadlock in operating system?
codefeedback
Implement Merge Sort algorithm in C++
codefeedback
Generate a classification network in a deep learning framework.
codefeedback
Create a set of transformation rules to convert a valid XML document to a valid HTML document.
codefeedback
We need to write a program to generate all permutations of a given string.
codefeedback
Create a function that takes two strings's, two string length's and returns true if the second string is a rotation of the first. string1 = "Hello World" string2 = "WorldHello" length1 = 11 length2 = 11
codefeedback
Compute P(A | B) given that P(B | A) = 0.8, P(A) = 0.4, and P(B) = 0.7
codefeedback
Prompt a clarification from the user when the reply provided is unclear Input Reply: I don't know
codefeedback
Solve the quadratic equation 3x^2 + 8x + 4 = 0
codefeedback
Given an array of integers, write a recursive program to merge two sorted subarrays ar1 and ar2 ar1 = [1, 4, 7, 9] ar2 = [2, 5, 6, 8]
codefeedback
Implement an algorithm to generate the permutations of a string
codefeedback
Write a function to obtain the result of a given mathematical expression. 2 + 3 - 5
codefeedback
Suggest a solution to convert a given number from one base to another.
codefeedback
Create a SQL query to find all employees whose salary is greater than the average salary of their department. Table of Employees: ID | Name | Department | Salary
codefeedback
Develop a code to perform linear regression in R
codefeedback
Create an algorithm in Java that prints the prime numbers between 1 and 100.
codefeedback
Compute the sum of two integers without using the "+" operator. x = 5 y = 7
codefeedback
Write a Python code to classify the following sentence It's raining cats and dogs
codefeedback
Generate a regular expression that matches strings containing at least one digit and one uppercase letter.
codefeedback
Write a regex expression to match strings that start with "abc" and end with "xyz".
codefeedback
Design a ML algorithm to classify a given handwritten digit.
codefeedback
How would you create a MySQL table with the following columns? Person (id, first_name, last_name, birth_date, age)
codefeedback
Create a Ruby method to sum all numbers from 1 to the given number n.
codefeedback
How would you create a (scalable) database schema for a blog platform?
codefeedback
Write a function that takes an array and removes all duplicates in place, returning the length of the new array. [1, 2, 3, 2, 4, 3]
codefeedback