
HackTrail

Quiz
•
Computers
•
University
•
Hard
Dheeraj Vishwakarma
Used 2+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following C code?
#include <stdio.h>
int main() {
int arr[] = {1, 3, 5, 7, 9};
int *p = arr;
printf("%d", *(p + 3));
return 0;
}
1
5
7
9
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this recursive function in Python?
def func(n):
if n == 0:
return 0
return n + func(n - 1)
print(func(5))
Infinite recursion
5
10
15
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this Python code?
def dfs(graph, v, visited=set()):
visited.add(v)
for neighbor in graph[v]:
if neighbor not in visited:
dfs(graph, neighbor, visited)
return visited
graph = {'A': ['B'], 'B': ['C'], 'C': ['A']}
print(dfs(graph, 'A'))
Error
{'A'}
{'A', 'C'}
{'A', 'B', 'C'}
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Time complexity of the following C function?
void fun(int n) {
for (int i = 1; i <= n; i *= 2)
printf("%d ", i);
}
O(n)
O(log n)
O(n log n)
O(1)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Output of the Python code:
a = [1, 2, 3]
b = a
b.append(4)
print(a)
[1, 2, 3]
[1, 2, 3, 4]
[1, 2, 4]
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which queue implementation allows insertion and deletion at both ends?
LinkedList
Queue
PriorityQueue
Dequeue
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following C code print?
char str[] = "HackTrail";
printf("%c", *(str + 4));
T
r
a
k
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
TECHFEST QUALIFYING ROUND

Quiz
•
University
10 questions
CIS1101-programming practice2

Quiz
•
University
10 questions
Rapid Round 1

Quiz
•
University
10 questions
IT Quiz Round 3

Quiz
•
University
10 questions
C++ Quiz

Quiz
•
University
19 questions
Capsule session 1

Quiz
•
University
10 questions
Python - Functions

Quiz
•
University
10 questions
Python-1st

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University