-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode.csv
More file actions
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 2.
70 lines (70 loc) · 10.4 KB
/
Copy pathCode.csv
File metadata and controls
70 lines (70 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ID;Type;Prompt with Ambiguities;List of Ambiguities;Example of Prompt without Ambiguities1;Code;"""Find all orders placed last month by high-spending customers.""";"¥ What does Òlast monthÓ refer to (calendar month vs. last 30 days)?
¥ What qualifies as a Òhigh-spending customerÓ (a fixed spending threshold, VIP flag, etc.)?";"""Retrieve all orders placed between January 1 and January 31, 2025 by customers whose total spending exceeds $1000."""2;Code;"""Translate the following request into SQL: Show me the orders that weren't canceled exactly two times.""";"¥ What does ""exactly two times"" refer to (orders per customer, per month, etc.)?
¥ Does ""weren't canceled"" mean at least one order must have a non-canceled status, or that both orders should be non-canceled?";"""Translate the following request into SQL: Retrieve customers who have exactly two orders, where at least one of the orders has a status other than 'canceled'."""3;Code;"""Generate a Python function that sorts a list of numbers and filters out negatives.""";"¥ Should the function remove negative numbers before sorting or sort them separately?
¥ What should be the sorting order (ascending/descending)?
¥ Should the function use a specific sorting algorithm or the built-in sort?";"""Generate a Python function that, given a list of integers, first removes all negative numbers and then sorts the remaining numbers in ascending order using Python's built-in sort() method."""4;Code;"""Develop a function to calculate the factorial of a number recursively.""";"¥ Should the function handle negative numbers or non-integer inputs?
¥ What should be the base case?
¥ Should error handling be included?";"""Develop a Python function that recursively calculates the factorial of a non-negative integer, returning 1 for an input of 0 and raising a ValueError for negative inputs."""5;Code;"""Develop a JavaScript function that merges two arrays.""";"¥ Should the function simply concatenate the arrays or merge them by eliminating duplicates?
¥ What order should the merged array follow?";"""Develop a JavaScript function that takes two arrays as input and returns a new array that is the concatenation of the first and second arrays, preserving the original order of elements."""6;Code;"""Write a C++ function to find the maximum element in an array.""";"¥ Is the array size provided?
¥ Should the function return a pointer or a value?
¥ What should be done if the array is empty?";"""Write a C++ function that takes an array of integers and its size as input, and returns the maximum integer, assuming that the array is non-empty."""7;Code;"""Create a Java method to reverse a string.""";"¥ Should spaces and punctuation be reversed?
¥ Should the reversal be character by character or word by word?";"""Create a Java method that takes a string as input and returns the string reversed character by character, including spaces and punctuation."""8;Code;"""Develop a Ruby script that filters out odd numbers from an array.""";¥ Should the script modify the original array or return a new one?;"""Develop a Ruby script that takes an array of integers and returns a new array containing only the even numbers."""9;Code;"""Create a PHP function to check if a given number is prime.""";"¥ What is the expected behavior for numbers less than 2?
¥ What algorithm should be used (e.g., trial division, Sieve)?";"""Create a PHP function that takes an integer and returns true if it is prime (considering numbers greater than 1) and false otherwise, using a simple iterative trial division algorithm."""10;Code;"""Write a Python function to generate the Fibonacci sequence up to n terms.""";"¥ Should the sequence start with 0 or 1?
¥ Should n include the zeroth term?
¥ Should the function return a list or print the sequence?";"""Write a Python function that takes an integer n and returns a list containing the first n terms of the Fibonacci sequence, starting with 0 and 1."""11;Code;"""Implement a Swift function to calculate the area of a circle given the radius.""";"¥ Which value of ¹ should be used?
¥ Should the function handle negative or zero radii?";"""Implement a Swift function that takes a positive Double representing the radius and returns the area of the circle using ¹=3.14159. The function should raise an error for non-positive radii."""12;Code;"""Create a C# function to sort an array of strings.""";"¥ Should the sorting be case-sensitive?
¥ What order should the strings be sorted in?";"""Create a C# function that takes an array of strings and returns a new array with the strings sorted in ascending, case-insensitive order."""13;Code;"""Write a Go function to remove duplicate integers from a slice.""";"¥ Should the original order be preserved?
¥ What is the expected behavior if the slice is empty?";"""Write a Go function that takes a slice of integers and returns a new slice with duplicate values removed, preserving the original order of first occurrences."""14;Code;"""Implement a Kotlin function to check if a string is a palindrome.""";"¥ Should the function ignore case, spaces, and punctuation?
¥ What is the expected behavior for empty strings?";"""Implement a Kotlin function that takes a string and returns true if it is a palindrome, ignoring case and spaces, and false otherwise."""15;Code;"""Develop a SQL query to join two tables: Customers and Orders.""";"¥ What type of join is required (inner, left, right, full)?
¥ Which columns should be used to join the tables?";"""Develop a SQL query that performs an inner join between the Customers and Orders tables using the CustomerID column."""16;Code;"""Write a Python script to read data from a CSV file.""";"¥ Should the script use the built-in csv module or pandas?
¥ What format should the output be (list of dictionaries, DataFrame, etc.)?";"""Write a Python script that reads a CSV file using the csv module and prints each row as a dictionary, assuming the first row contains column headers."""17;Code;"""Create a Bash script to backup a directory.""";"¥ Which directory should be backed up?
¥ Where should the backup be stored?
¥ Should the script compress the backup?";"""Create a Bash script that takes two arguments: a source directory and a destination directory, and creates a compressed backup (tar.gz) of the source directory in the destination directory."""18;Code;"""Develop a Perl script to count the frequency of each word in a text file.""";"¥ Should punctuation be removed?
¥ Should word matching be case-insensitive?";"""Develop a Perl script that reads a text file, counts the frequency of each word (ignoring punctuation and case), and prints the results."""19;Code;"""Implement a TypeScript function to validate an email address.""";"¥ What validation criteria should be applied?
¥ Should it use a regular expression?";"""Implement a TypeScript function that takes a string and returns true if it matches a standard email format using a regular expression, and false otherwise."""20;Code;"""Write a Rust function to compute the factorial of a number.""";"¥ Should the function use recursion or iteration?
¥ How should negative inputs be handled?";"""Write a Rust function that computes the factorial of a non-negative integer using recursion, returning 1 for an input of 0 and panicking for negative inputs."""21;Code;"""Write a Java function that merges two sorted arrays into one sorted array.""";"- Are duplicates allowed or removed?
- Are we merging in ascending or descending order?
- Should we handle different lengths for the arrays?
- Should the merge happen in place or in a new array?
- How should the function handle empty arrays?";"""Write a Java function that takes two sorted arrays of integers, merges them into a new array in ascending order, preserves duplicates, and handles arrays of different lengths. If either array is empty, the function simply returns the other array without modification."""22;Code;"""Develop a Python script that compares two text files and outputs the differences.""";"- Are we ignoring whitespace differences?
- Are we ignoring case differences?
- Should we display lines that match or only lines that differ?
- How should the differences be displayed (unified diff, side-by-side, etc.)?
- Should the script stop at the first difference or continue through the entire file?";"""Develop a Python script that takes two file paths as input, compares their contents line by line, and prints only the differing lines in a unified diff format. Ignore trailing whitespace differences, preserve case differences, and continue comparing through the entire file even after the first difference."""23;Code;"""Implement a JavaScript function that validates passwords.""";"- Is there a minimum or maximum length requirement?
- Should the password include uppercase, lowercase, digits, special characters?
- Which special characters are allowed?
- Should whitespace be permitted?
- Should the function provide specific error messages or just return a boolean?";"""Implement a JavaScript function that validates a password to ensure it is at least 8 characters long, includes uppercase, lowercase, digits, and at least one of the following special characters: !@#$%^&*, and disallows whitespace. The function should return true if valid or false otherwise."""24;Code;"""Create a C++ program to read and parse a configuration file.""";"- Which file format should be supported (INI, JSON, custom)?
- Should the program ignore comment lines or parse them?
- Does the program need to handle nested sections or just top-level key-value pairs?
- Should the program validate data types (e.g., integers, booleans) or treat everything as strings?
- How should invalid lines be handled?";"""Create a C++ program that reads a simple INI-style configuration file, ignores lines starting with '#', supports only top-level key-value pairs, and treats all values as strings without additional validation. Invalid lines are skipped with a warning message."""25;Code;"""Develop a Ruby on Rails controller action that handles user registration.""";"- Should it allow social logins or just email/password?
- Should the email format be validated?
- Should the user confirm the password by entering it twice?
- Should the action send a confirmation email?
- What happens if the email Is already taken?";Develop a Ruby on Rails controller action that handles email/password signups, validates the email format, requires password confirmation, and sends a confirmation email upon registration. If the email is already taken, the action should return an appropriate err