question
string
choices
list
answer
int64
answer_label
string
split
string
subcategories
string
lang
string
second_lang
string
coding_lang
string
notes
string
id
string
set_id
float64
variation_id
string
What will this code output? #include <stdio.h> int main() { int x = 10; int *ptr = NULL; *ptr = *ptr + 5; printf("%d", x); return 0; }
[ "15", "10", "5", "Segmentation fault" ]
3
D
test
Buggy code
eng_Latn
C
Buggy code - null pointer
67-1.1
67
1.1
What will this code output? #include <stdio.h> int main() { int x = 10; /* outer comment /* inner comment */ still commenting */ int *ptr = &x; *ptr = *ptr + 5; printf("%d", x); return 0; }
[ "15", "10", "Compilation error", "5" ]
2
C
test
Buggy code
eng_Latn
C
Comments across languages - nested comments (error)
67-1.14
67
1.14
What will this code output? #include <stdio.h> int main() { int x = 10; int *ptr; *ptr = *ptr + 5; printf("%d", x); return 0; }
[ "15", "10", "5", "Segmentation fault" ]
3
D
test
Buggy code
eng_Latn
C
Buggy code - uninitialized pointer
67-1.2
67
1.2
What will this code output? using System; class Program { static void Main() { int x = 10; unsafe { int* ptr = &x; *ptr = *ptr + 5; } Console.WriteLine(x); } }
[ "15", "Compilation error", "10", "20" ]
1
B
test
Buggy code
eng_Latn
C#
69-1.1
69
1.1
What will this code output? using System; class Program { static void Main() { int x = 10; ref readonly int ptr = ref x; ptr = ptr + 5; Console.WriteLine(x); } }
[ "Compilation error", "15", "10", "5" ]
0
A
test
Buggy code
eng_Latn
C#
Buggy code - readonly reference
69-1.16
69
1.16
What will this code output? using System; class Program { static void Main() { int x = 10; ref int? ptr = ref x; ptr = ptr + 5; Console.WriteLine(x); } }
[ "15", "Compilation error", "10", "5" ]
1
B
test
Buggy code
eng_Latn
C#
Nullable reference
69-1.17
69
1.17
What will this code output? using System; class Program { static void Main() { int x = 10; int* ptr = &x; *ptr = *ptr + 5; Console.WriteLine(x); } }
[ "15", "Compilation error", "10", "20" ]
1
B
test
Buggy code
eng_Latn
C#
Buggy code - unsafe without keyword
69-1.2
69
1.2
What will this code output? using System; class Program { static void Main() { int? x = null; Console.WriteLine(x + 5); } }
[ "15", "10", "", "5" ]
2
C
test
Buggy code
eng_Latn
C#
Buggy code - null reference
69-1.3
69
1.3
What will this code output? #include <iostream> using namespace std; int main() { int x = 10; int *ptr = nullptr; *ptr = *ptr + 5; cout << x; return 0; }
[ "Segmentation fault", "15", "10", "5" ]
0
A
test
Buggy code
eng_Latn
C++
Buggy code - null pointer
68-1.1
68
1.1
What will this code output? #include <iostream> using namespace std; int main() { int x = 10; int &ref; ref = ref + 5; cout << x; return 0; }
[ "15", "10", "5", "Compilation error" ]
3
D
test
Buggy code
eng_Latn
C++
Buggy code - reference error
68-1.2
68
1.2
What will this code output? public class Test { public static void main(String[] args) { int[] arr = {3, 1, 4, 1, 5} int sum = 0; for (int i = 0; i < arr.length; i += 2) { sum += arr[i]; } System.out.println(sum); } }
[ "Compilation error", "12", "9", "5" ]
0
A
test
Buggy code
eng_Latn
java
Missing semicolon
66-1.17
66
1.17
What will this code output? public class Test { public static void main(String[] args) { int[] arr = {3, 1, 4, 1, 5}; int sum = 0; for (int i = 0; i < arr.length; i -= 2) { sum += arr[i]; } System.out.println(sum); } }
[ "12", "Never terminates", "9", "5" ]
1
B
test
Buggy code
eng_Latn
java
Infinite loop
66-1.7
66
1.7
What will this code output? public class Test { public static void main(String[] args) { int[] arr = {3, 1, 4, 1, 5}; int sum = 0; for (int i = 0; i < arr.length; i += 2) sum += arr[i]; System.out.println(sum); } }
[ "12", "Compilation error", "9", "5" ]
1
B
test
Buggy code
eng_Latn
java
Syntax error
66-1.8
66
1.8
What will this code output? public class Test { public static void main(String[] args) { int[] arr = {3, 1, 4, 1, 5}; int sum = 0; for (int i = 0; i <= arr.length; i += 2) { sum += arr[i]; } System.out.println(sum); } }
[ "12", "ArrayIndexOutOfBoundsException", "9", "5" ]
1
B
test
Buggy code
eng_Latn
java
Array bounds
66-1.9
66
1.9
What will this code output? def mystery(n): if n <= 0: return 0 if n == 2: return 1 return mystery(n-1) + mystery(n-2) print(mystery(6))
[ "5", "8", "6", "13" ]
0
A
test
Buggy code
eng_Latn
python
Fibonacci series, off by one
65-1.1
65
1.1
What will this code output? def mystery(n): return mystery(n-1) + mystery(n-2) print(mystery(6))
[ "RecursionError: maximum recursion depth exceeded", "8", "6", "13" ]
0
A
test
Buggy code
eng_Latn
python
Fibonacci series with infinite loop
65-1.12
65
1.12
What will this code output? def mystery(n): if n <= 0: return 0 if n == 1: return 1 return mystery(n-1) + mystery(n-2) print(mystery(6))
[ "SyntaxError: invalid syntax", "8", "6", "13" ]
0
A
test
Buggy code
eng_Latn
python
Fibonacci series with wrong syntax
65-1.13
65
1.13
What will this code output? def mystery(n): if n <= 0: return 0 if n == 1: return 1 return mystery(n-1) + mystery(n-2) print(mystery(6))
[ "IndentationError: unexpected indent", "8", "6", "13" ]
0
A
test
Buggy code
eng_Latn
python
Fibonacci series with wrong indentation
65-1.14
65
1.14
What will this code output? def mystery(n): if n <= 0: return 0, if n == 1: return 1 return mystery(n-1) + mystery(n-2) print(mystery(6))
[ "8", "6", "TypeError: unsupported operand type(s) for +: 'int' and 'tuple'", "13" ]
2
C
test
Buggy code
eng_Latn
python
Fibonacci series with bug in the base case
65-1.15
65
1.15
What will this code output? #include<iostream>using namespace std;int main(){int x=10;int*ptr=&x;*ptr=*ptr+5;cout<<x;return 0;}
[ "15", "10", "5", "Compilation error" ]
3
D
test
Buggy code, Whitespace variations
eng_Latn
C++
Whitespace variations, bug
68-1.6
68
1.6
What will this code output? public class Test { public static void main(String[] args) { /* Initialize array int[] arr = {3, 1, 4, 1, 5}; int sum = 0; for (int i = 0; i < arr.length; i += 2) { sum += arr[i]; } System.out.println(sum); } }
[ "12", "9", "5", "Compilation error" ]
3
D
test
Buggy code, Comments across languages
eng_Latn
java
Comments - mismatched block comment
66-1.13
66
1.13