WorksheetsHACKATHON HUSTLE(ROUND 2)
Total questions: 20
Worksheet time: 14mins
What is the best way to debug a Python program?
What does "yield" keyword in python imply?
Expand PEP in python?
Python Extension Protocol
Python Enhancement Proposal
which of the following function can be used to generate random numbers?
random( )
randint( )
uniform( )
range( )
Which of the following sorting algorithms has the best average-case time complexity?
Quick Sort
who created python?
(a)
what is the output of the following code
def myfunc(n):
for i in range(0, n):
for j in range(0, i+1):
print(" * ",end="")
print("\r")
which of the following pair of words are anagrams?
night and thing
Which algorithm is used for finding the strongly connected components in a graph?
Bellman-Ford algorithm
What is the space complexity of the iterative implementation of the Fibonacci sequence?
O(n)
O(1)
O(log n)
O(n^2)
What does AVL tree guarantee?
O(log n) time complexity for insert, delete, and search operations
O(n) time complexity for insert, delete, and search operations
O(n log n) time complexity for insert, delete, and search operations
O(n^2) time complexity for insert, delete, and search operations
out put of the following code?
#include <stdio.h>
enum week { Mon, Tue, Wed, Thur, Fri, Sat, Sun };
int main()
{
enum week day;
day = Wed;
printf("%d", day);
return 0;
}
2
3
It gives error
None
output of the following code?
#include <stdio.h>
int main(){
if (printf(“Hello - World”)) {
}return 0;
}
It gives Error
Hello - World
Neither 1 or 2
None
what is the correct way to declare pointer in c?
int var(*ptr);
int **ptr;
what is the output of the code given below?
#include "stdio.h"
int main()
{
char a[] = { 'A', 'B', 'C', 'D' };
char* ppp = &a[0];
*ppp++;
printf("%c %c ", ++ppp, --ppp);
}
C B
B A
B C
C A
What will be the output of the following program?
#include <stdio.h>
int main(void)
{
int i = 40 >> 5 << 3 >> 2 << 1;
printf("%d", i);
return 0;
}
0
4
1
40
C supports multithreading?
True
False
Predict the output of below C program?
#include<stdio.h>
int main(void){
int a = 1;
int b = 0;
b = ++a + ++a;
printf("%d %d",a,b);
getchar();
return 0;
}
3 6
3 0
3 5
3 4
who is he?
(a)
