-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquestions.tsv
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 20.
88 lines (88 loc) · 16 KB
/
questions.tsv
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
1 Which of the following is NOT a type of computer memory? CPU ROM RAM Cache 1 2
2 Given the decimal number 15, how can we represent this number in binary form? 1111 1100 1010 1001 1 2
3 1) git add 2) git commit 3) git _______? pull push pullout clone 2 2
4 Which of the following is NOT a high-level programming language? Python Assembly Java C++ 2 2
5 How do you delete everything in a directory in Linux? rm -rf ./ rm -d ./ rm --all rm --all ./ 1 2
6 What is the process of converting plaintext into ciphertext called? Decryption Encryption Hashing Encoding 2 2
7 Which technology is used for wireless communication over *very* short distances? Bluetooth Wifi Cellular Satellite 1 2
8 What will be the output of the following Python code: ```print(15 // 4)``` 3 3.75 4 3.5 1 2
9 Which of these is not a searching algorithm? DFS A-Star Dijkstra Kadane's Algorithm 4 2
10 What is the core component of an Artificial Neural Network? Synapse Dendrite Neuron Axon 3 2
11 Which data structure is best suited for implementing a priority queue? Array Linked List Stack Heap 4 2
12 What is the purpose of a hash function in a hash table? To sort the data To map keys to indices To encrypt the data To compress the data 2 2
13 In a binary search tree, which traversal method produces a sorted output? Inorder Preorder Postorder Any one of the above 1 2
14 Which of these is a cloud computing service model? Infrastructure as a Service (IaaS) Platform as a Service (PaaS) Software as a Service (SaaS) All of the above 4 2
15 Which of the following is a divide-and-conquer algorithm? Bubble Sort Selection Sort Merge Sort Insertion Sort 3 2
16 What does the following list comprehension in Python yield: `[i for i in range(10)]` [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 3 2
17 Which of the following is not a feature of Object-Oriented Programming (OOP)? Encapsulation Inheritance Polymorphism Recursion 4 2
18 In SQL, which of the following commands is used to remove a table from a database? DELETE DROP REMOVE ERASE 2 2
19 The minimum number of stacks needed to implement a queue is 3 1 2 4 3 2
20 In the context of version control, what does "Git" primarily manage? Database transactions File versions Networking protocols Web sessions 2 2
1 What language did WhatsApp use in their launching phase to scale to millions of users with a small team of engineers? Erlang C++ Java Python 1 1
2 What is the output of this list comprehension? ```[char for char in "Python" if char.isupper()]``` ["P", "y", "t", "h", "o", "n"], ["P", "y", "t", "h"] ["P"] ["P", "n"] 3 1
3 Which of the following is a key characteristic of a relational database? Hierarchical data structure Data is organized in tables (relations) Network data model Data is stored as objects 2 1
4 Which of the following statements is true about Java? Java supports multiple inheritance using classes. Java uses pointers for memory management. Java is platform-independent due to the JVM. Java allows operator overloading. 3 1
5 In Java, which of the following is used to handle exceptions? if-else switch-case try-catch do while loop 3 1
6 Which of the following is an advantage of a linked list over an array? Random access of elements Fixed size Better cache locality Dynamic size 4 1
7 What is the purpose of exception handling in programming? To manage and respond to runtime errors. To optimize code performance. To log function calls and results. To predefine input values for functions. 1 1
8 In Python, which of the following is not a valid data type? List Tuple LinkedList Integer 3 1
9 VST stands for: Virtualisation Software Technology Visual SaaS Template Virtual Studio Technology Vacant Swapping Technique 3 1
10 What is a "data structure" in programming? A collection of functions for data transformation. Organizing and storing data for efficient access and modification. An algorithm for processing data. Syntax for declaring variables and constants. 2 1
11 Which of the following is a valid declaration of a pointer in C? int ptr; int *ptr; int &ptr; pointer int ptr; 2 1
12 In Java, which method is used to start a thread? run() start() init() execute() 2 1
13 Which of the following code has the fastest execution time? O(nlog n) O(n) O(n!) O(log n) 4 1
14 What is "recursion" in programming? Optimizing function execution through loops. Predefining input values for functions. A function calling itself to solve smaller sub-problems. Incrementing and Repeated execution of code until a condition is met. 3 1
15 What does ACID stand for in the context of databases? Atomicity, Consistency, Isolation, Durability Atomicity, Concurrency, Integrity, Durability Aggregation, Consistency, Isolation, Durability Abstraction, Consistency, Isolation, Data 1 1
16 How do you execute a python file? `run <filename>.py` in the terminal. `execute <filename>.py` in the shell. `python <filename>.py` in the command line. `python3 run <filename>.py` in the command line. 3 1
17 What is the time complexity of binary search in a sorted array? O(n) O(log n) O(n log n) O(n²) 2 1
18 What does BFS stand for? Binary-First Search Breadth-First Search Binary-Finding System Breadth-Finding Strategy 2 1
19 What does SQL stand for? Standard Query Language System Query Language Structured Query Language System Query Language 3 1
20 In a relational database, which constraint ensures that a column cannot have NULL values? FOREIGN KEY UNIQUE NOT NULL DEFAULT 3 1
1 How many pointers at max are necessarily changed for the insertion in a singly linked list? 1 3 0 2 4 3
2 The type of pointer used to point to the address of the next element in a singly linked list? Pointer to Char Pointer to Int Pointer to Node Pointer to String 3 3
3 Which of the following is not the application of stack? Data Transfer between two asynchronous process Compiler Syntax Analyzer Tracking of local variables at run time A parentheses balancing program 1 3
4 What is the value of the postfix expression 8 11 7 4 + – *? 0 -33 33 -9 1 3
5 What is the purpose of the SQL query shown in the snippet? `SELECT * FROM employees WHERE department = 'Sales';` Insert new employee records Update existing employee records Retrieve employee records from the 'Sales' department Delete employee records from the 'Sales' department 3 3
6 What is a null pointer reference? (Hint: CrowdStrike suffered a lot because of this) Pointer to a memory address that has been deallocated A default variable called "null" to initialise a constructor in C++. A pointer that has been declared but not initialised A pointer that could be used to reference more than one locations at the same time. 1 3
7 Which of these is a postfix expression? a+c-d ab+ cd- * ab(cd+)- * *ab-+cde 2 3
8 Which of These is **NOT** an AWS service? S3 ABS RDS EC2 2 3
9 Which of These is **NOT** a Page Replacement Algorithm FIFO LRU LIFO Optimal Page Replacement 3 3
10 Which of the following is a non-preemptive scheduling algorithm? Round Robin Shortest First Job (SFJ) Priority Scheduling First-Come, First-Served (FCFS) 4 3
11 What is the output of the following Java code? ``` public class Main{ public static void main(String []args){ int x = 10; int y = 5; int z = (x > y) ? x : y; System.out.println(z); } } ``` 10 5 15 syntax error 1 3
12 Which of the following algorithms is specifically used for finding the shortest path in a graph? Depth-First Search (DFS) Breadth-First Search (BFS) Dijkstra’s Algorithm Heuristic Search 3 3
13 Which of the following sorting algorithms is not stable? Merge Sort Bubble Sort Quick Sort Insertion Sort 3 3
14 Which SQL keyword is used to remove duplicate records in a query result? UNIQUE DELETE SELECT DISTINCT 4 3
15 Which of the following algorithms is NOT used for encryption? AES RSA SHA-256 Blowfish 3 3
16 What is the worst-case time complexity of quicksort? O(n) O(log n) O(n log n) O(n²) 4 3
17 What is Bob doing here in the 8th episode of the 2nd season of Stranger Things  Developing a web application for storing passwords Running away from Demogorgons and brute-forcing a 3-digit password Running away from Demogorgons and brute-forcing a 4-digit password Training a model for classifying Demogorgons 3 3
18 In object-oriented programming, what is the concept of polymorphism? Same Parameter Name, different Constructor Same Constructor Name, different Parameter Same Parameters Name, different function Same Function Name, different Parameters 4 3
19 What does the term "latency" refer to in networking? The amount of data that can be transferred in a given time The time taken for a data packet to travel from source to destination The number of errors per unit of time The frequency of data collisions 2 3
20 Which of the following algorithms is typically used in the TCP protocol to prevent network congestion? RSA Dijkstra's Algorithm Sliding Window Protocol Slow Start 4 3
1 What is the output of the following C++ code? ``` #include <iostream> using namespace std; int main() { int a = 10; int b = a++ + ++a; cout << b; return 0; }``` 21 20 22 19 3 4
2 You are tasked with optimizing the performance of a web application. Which technique involves storing frequently accessed data in a store, reducing the need to fetch it from the original source and potentially improving response times? Load Balancing Compression Minification Caching 4 4
3 In operating systems, what is the name of the memory management technique that divides memory into fixed-size blocks called pages? Segmentation Swapping Paging Thrashing 3 4
4 Consider a scenario where you need to design a fault-tolerant system that can continue operating even if some of its components fail. Which architectural pattern involves replicating critical components and distributing them across multiple nodes to ensure high availability and resilience? Microservices Architecture Monolithic Architecture Distributed Architecture Layered Architecture 3 4
5 Which of the following is a type of cyber attack that involves tricking users into revealing sensitive information? Malware Ransomware Phishing Denial of Service (DoS) 3 4
6 What is the output of the following Python code snippet? ``` x = [1, 2, 3, 4] y = x.copy() y.append(5) print(x, y) ``` `[1, 2, 3, 4] [1, 2, 3, 4, 5]` `[1, 2, 3, 4] [1, 2, 3, 4]` `[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]` Error: The `copy()` method is not valid for lists. 1 4
7 Which of these is **NOT** a method to exit the Vim text editor? :q! ZZ ZQ :w 4 4
8 What is the purpose of load balancing in system design? To encrypt data To compress data for faster transmission To cache frequently accessed data To distribute traffic across multiple servers 4 4
9 What programming concept is demonstrated in the provided code snippet? ``` def calculate_factorial(n): if n == 0: return 1 else: return n * calculate_factorial(n - 1) ``` Iterative Recursion Polymorphism Encapsulation 2 4
10 Which of these HTTP methods should not be used while sending a request body? PUT GET POST PATCH 2 4
11 Which of these is not a defining feature of Redis? Multithreading In-memory caching Pub/sub Support for linear data structures 1 4
12 What is the output of the following code snippet: ``` int x = 5; int y = x++ + ++x; std::cout << y; ``` 10 12 11 13 2 4
13 What would be the optimal time complexity for generating Fibonacci series? O(logn) O(n) O(2^n) O(n^2) 1 4
14 Which of the following HTTP status codes indicates that the request was successful and the server returned the requested data? 200 301 404 500 1 4
15 What will be the output of the following C++ code? ``` #include <iostream> using namespace std; int main() { int a = 5, b = 10, c = 15; int x = (a > b) ? (b > c) ? b : c : (a > c) ? a : c; cout << x; return 0; } ``` 5 10 15 Compilation error 3 4
16 What programming concept is demonstrated in the following Python code snippet? ``` class Animal: def make_sound(self): print("Animal sound") class Mammal(Animal): def has_fur(self): print("Has fur") class Dog(Mammal): def bark(self): print("Woof!") ``` Multilevel Inheritance Multiple Inheritance Hierarchical Inheritance Single Inheritance 1 4
17 In a relational database, what is the purpose of a primary key? define the data type of a table and order table sequentially Uniquely identify each record in a table, so that no two rows have the same primary key. Also primary keys can't be NULL A primary key is a special key that is used to group records together in a table, often used for sorting and filtering data efficiently. An optional field in a table used to create a relationship between two or more tables in the database. 2 4
18 What is a candidate key in relational databases? Any group of keys that can be a candidate for uniquely identifying the tuple It has information about the candidates in a table The minimal group of keys that can be candidate for uniquely identifying the tuple All the attributes in the table barring the primary key 3 4
19 Which of the following protocols is used for secure communication over an untrusted network like the Internet? HTTP FTP SSH Telnet 3 4
20 In Python, what will be the output of the following code snippet? ``` def func(x, y=[]): y.append(x) return y print(func(1)) print(func(2)) ``` [1] [2] [1] [1, 2] [1, 2] [1, 2] [1, 2] [2] 2 4
1 A Caesar Cipher is an encryption technique that was famously used by, you guessed it right, Julius Caesar! In this technique, you shift the input characters 3 places forward. "A" becomes "D" ("A"->"B"->"C"->"D"), "G" becomes "J" ("G"->"H"->"I"->"J") and "Z" becomes "C" ("Z"->"A"->"B"->"C") due to rotation. Thus, "TECH HUNT" would become "WHFK KXQW". Find the Caesar Cipher for the GFG motto. Make sure only Julius Caesar can decode the glorious motto of GFG! (Hint: You may search for the GFG motto!) OHDEQ, SUDFGLFH, NQG HKFRO OHDUQ, SUDFWLFH, DQG HAFHO YRNEA, CENPGVPR, NAQ RKPRY YHNUA, SEDPWVFR, DAG RAPHY 2 5
2 (2^2^2^2^2^2^2^2^2^2^2^2^2^2^2^2) mod 10 is? (a^b is read as "a raised to the power of b") 3 8 6 2 3 5
3 There are 23 people, labelled from 1 to 23, in a circle. '1' has a knife (chaku) and kills the person next to him (2) and passes the knife to 3, 3 kills 4 and gives the knife to 5. This carries on until there is only one person alive (by god's grace). 1 15 8 23 4 5
4 Given the numbers [999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020], find the maximum number of times you will have to remove sets of any 3 numbers such that their greatest common divisor is 1 until there are no such sets remaining. 3 4 5 6 3 5
5 You are given a list of integers where every element appears twice except for one. You need to find that single element in the most efficient way. Which of the following algorithms would you choose? Sort the array and compare adjacent elements. Use a hash map to count the frequency of each element. Use the XOR bitwise operation on all elements. Iterate through the list comparing each element with every other element. give answer 3 5
6 How many distinct 9-digit numbers can be formed using the digits 1, 1, 2, 2, 2, 3, 3, 4, 4 such that the two 1’s are never adjacent? 7560 45360 90720 15120 2 5
7 What is the output of the following C code? #include <stdio.h> ``` int fun(int a) { if(a > 100) return a - 10; else return fun(fun(a + 11)); } int main() { printf("%d\n", fun(95)); return 0; } ``` 91 100 105 Infinite Recursion 1 5
8 You are in a room with 3 light switches, each of which controls one of three bulbs in another room. You cannot see the bulbs from where the switches are. You can only enter the room with the bulbs once. How do you determine which switch controls which bulb? Turn on all the switches and then turn off one, check which bulb is still warm. Turn on one switch, wait, then turn it off. Turn on the second switch and enter the room. Turn on one switch for a few minutes, then turn it off. Turn on another and go into the room. Turn on two switches, and go to the other room to check the bulbs' positions. 3 5