instruction_seed
stringlengths
0
26.4k
source
stringclasses
4 values
Suggest an appropriate data structure and implementation to store employee details Employee details like name, title and contact number
codefeedback
Suggest an algorithm to find the longest common sub-string in two strings Two strings of length n and m
codefeedback
Create a function that takes a single argument and returns a string describing the type of argument.
codefeedback
Write a SQL query to output the name, id, and address of each customer who has an address in a specified zip code. zipcode = 39911
codefeedback
Design a code snippet to sort a hashtable by its keys. {8: "hello", 3: "goodbye", 2: "aloha", 4: "bonjour", 6: "ni hao"}
codefeedback
Count the number of leaf nodes in a binary tree. tree = { "data": 10, "left": { "data": 20, "left": { "data": 40 }, "right": { "data": 50 } }, "right": { "data": 30, "left": { "data": 60 }...
codefeedback
List all the prime numbers less than a specified number ‘n’ n = 10
codefeedback
Create an AI chatbot using JavaScript and Natural Language Processing.
codefeedback
Write an assembly language program to print "Hello, World!"
codefeedback
Train an AI model to predict whether an email is spam or not.
codefeedback
Modify the following Java program to print "Hello world!" without using a System.out.print statement. class HelloWorld { public static void main(String args[]) { System.out.print("Hello world!"); } }
codefeedback
Create a script to generate a random password using uppercase, lowercase and numerics.
codefeedback
Generate a function in python that takes two lists and returns the product of their longest common substrings. list1 = [1, 2, 3, 4, 5] list2 = [2, 3, 5, 7]
codefeedback
Suggest a code in Python that will calculate the area of any given shape.
codefeedback
Explain the functional programming paradigm.
codefeedback
Generate an algorithm in any language that can find the sum of the numbers in a given array
codefeedback
Implement a Java code to print the first 10 multiples of a given number
codefeedback
Write a code in Go that will reverse all the words in a sentence. sentence: "GPT is a powerful tool"
codefeedback
Design a function that takes a string of HTML tags in an input and removes the tags from the string
codefeedback
Write an algorithm to traverse a binary tree.
codefeedback
Create a program in C to calculate the average of nodes in the given linked list.
codefeedback
Create a program in Ruby to print out all prime numbers up to a given positive integer m.
codefeedback
Write a lambda expression to find the maximum value of two numbers.
codefeedback
Write a JavaScript code to find all the elements with class 'myclass' in a given HTML page and alert their inner HTML.
codefeedback
Convert a given three-digit number to its binary equivalent 456
codefeedback
Write a regular expression to detect phone numbers with country code in a string +918327886067
codefeedback
Generate a working React component to parse GEDCOM data.
codefeedback
Print the array elements in reverse order using a recursive function in JavaScript [1,2,3,4]
codefeedback
Write a code to construct the following rectangle pattern 6
codefeedback
Generate a SQL query to update the job title for all the employees with name 'John'
codefeedback
Create a process to sort an array of numbers from least to greatest. arr = [3, 4, 12, 1, 5, 85]
codefeedback
Write a function to identify the most frequent letter in a string. string = "Hello Universe"
codefeedback
Design an SQL query to select the top 10 most popular movies from a given movie table.
codefeedback
Create a React component which shows a list of items with a delete button for each item.
codefeedback
Use linear regression to predict the price of a car based on its make and model. make = ['Mazda', 'Volkswagen', 'Chevrolet'] model = ['3', 'PASSAT', 'Malibu']
codefeedback
Write an instruction for a GPT model to generate a response when it is given a given an English sentence as input. "How are you today?"
codefeedback
Check the human readable date and convert it to the ISO 8601 format. Monday, April 7th, 2020
codefeedback
Write a Java class to implement a priority queue data structure.
codefeedback
What is deadlock and how to prevent it?
codefeedback
Construct a factorial function in JavaScript that takes in two inputs x and y as parameters.
codefeedback
Modify the following code so that it takes a list of numbers and calculates their median. def median(data):
codefeedback
Design a JavaScript program to find the factorial of an integer. 5
codefeedback
Write a method in Python which takes a positive integer and returns the sum of squares of all numbers smaller than the given number. 5
codefeedback
Generate a MySQL query to fetch a specified number of records starting from a given ID. 5 10
codefeedback
Given a collection of email addresses, group them by the domain emails = ["test@example.com", "example@example.org", "test@test.co.uk"]
codefeedback
Given a 2D array, return the sums of all columns arr = [[1,2,3], [4,5,6], [7,8,9]]
codefeedback
Create a web service to convert a given list of temperatures from Celsius to Fahrenheit. [50, 51, 52, 53, 54]
codefeedback
Write a code to implement a round-robin scheduling algorithm. processes = [10, 5, 7] time_slice = 2
codefeedback
Sort an array using bubble sort technique. arr = [4, 3, 6, 7, 5, 1, 8]
codefeedback
Implement a function to solve the following equation: x2+y2=z2
codefeedback
Write a function to generate an array of all possible permutations of N numbers.
codefeedback
Write a function to convert an array of strings to an array of floats. string_arr=['1.1', '2.3', '3.4']
codefeedback
Compute the number of ways for a host to select 3 items from a list of 8 options.
codefeedback
Given an array of integers, remove all the duplicated elements from the array and return the distinct array. nums=[3, 4, 5, 5, 6, 6, 6, 7]
codefeedback
You are given a list of numbers. Find the maximum sum of any subsequence in the list.
codefeedback
Find all the possible permutations in a string without using any built-in functions. string = "ABC"
codefeedback
Create a function which detects overlapping dates from a given list. dates_list = [ (2018,1,1,2018,3,1), (2018,12,1,2018,9,30), (2018,2,15,2018,5,10) ]
codefeedback
Construct a 3 level hierarchical tree data structure in PHP.
codefeedback
Display the results from a MySQL query in HTML table format. MySQL query: SELECT * FROM employees WHERE name LIKE '%john%'
codefeedback
Using the given list, write a code to get a list of all the words starting with "T" words_list = ['Meteor', 'Timeline', 'Tablet', 'Timeframe', 'Trophy']
codefeedback
Write a Java program to generate a schedule for students with a given set of available IDs. IDs to be scheduled [1, 2, 3]
codefeedback
Train a machine learning algorithm from a given dataset. Dataset: The data contains information about students' results in an exam.
codefeedback
What is the purpose of a join operation in a relational database?
codefeedback
Write a function in C that takes two float numbers as input and returns their average.
codefeedback
Escalate privileges in a Windows system using PowerShell.
codefeedback
Write a function to parse a string and return a dictionary where each character in the string is mapped to its frequency. "hello world"
codefeedback
Write a SQL query to find information about books in a library
codefeedback
Evaluate an expression written in reverse Polish notation 5 1 2 + 4 * + 3 -
codefeedback
Construct a tree which follows the pre-order traversal 50, 30, 10, 20, 40, 70, 60, 80
codefeedback
Implement a neural network from scratch
codefeedback
Given the parameter 'word', what JavaScript code should be written to check whether it is a palindrome or not?
codefeedback
Write Python code to store odd numbers from the given list in a separate list. list = [1, 2, 3, 4, 5, 6, 7]
codefeedback
Write a SQL statement to update the 'salary' of an employee with the id value of '100' by 100.
codefeedback
Modify the given code snippet to add a new entry in the users table of a MySQL database. conn = mysql.connector.connect( host="localhost", user="root", passwd="12345" database="test" )
codefeedback
What code should be used to generate 5 random numbers in Java?
codefeedback
Explain the effect of using recursion as a programming technique
codefeedback
Create a new Python class called Area to calculate the area of different shapes.
codefeedback
Extract the phone numbers from a string of text text = "My number is (202) 555-0123 and my friend's number is (703) 555-9876"
codefeedback
Implement a in-order traversal of a binary tree in Python.
codefeedback
Find the minimum number of coins required to make a given amount amount = 93
codefeedback
Write a C code snippet to check if an input number is prime or not. The number is 17
codefeedback
Create an algorithm to check if a binary tree is univalued.
codefeedback
Create a class in Python named 'Rectangle' which can compute the area of a rectangle.
codefeedback
Write a function that exchanges the first and last elements of a list.
codefeedback
Generate an algorithm to multiply two numbers without using multiplication operator
codefeedback
Write a code to convert a given date string into a timestamp. date_string = "2020-07-24 14:50:00"
codefeedback
Create a regular expression which will match numbers divisible by 3.
codefeedback
In the given string, split the words and remove empty strings. string = " Hello World "
codefeedback
Give a function to get an array of n-dimensional vectors.
codefeedback
How can you convert a number from one base to another?
codefeedback
Answer this logic programming question: What is the transitive closure of the binary relation "less than" on the set of integers?
codefeedback
Write a procedure in SQL that takes two tables as parameters and returns the intersection of the two. table1, table2
codefeedback
Create a Python function which takes in a list and returns the length of the longest common subsequence of consecutive elements in the list. [1, 3, 5, 8, 9, 10, 11, 15]
codefeedback
Create a function to check whether a number is a prime number using the Sieve of Eratosthenes algorithm.
codefeedback
How would you reverse a singly linked list without using any additional data structures?
codefeedback
Given a dictionary of words and a set of characters, how would you find the longest word which can be constructed from the given set of characters?
codefeedback
Generate a list of length n containing all numbers from 1 to n.
codefeedback
Using an existing function, update the given array of numbers to contain elements which are the square of each original element. array = [1,2,3,4,5]
codefeedback
Print all permutations of an input array. array = [1,2,3]
codefeedback
Compose a SQL query that returns the total number of employees for each department in a given company.
codefeedback