WorksheetsTechstars_Hub Third Quarter Coding Examination
Total questions: 100
Worksheet time: 17mins
What is an array?
A collection of elements stored at random locations
A collection of elements stored at contiguous memory locations
A single Variable
A function
What is the time complexity of accessing an element in an array by index?
0(n)
0(log n)
0(1)
0(n^2)
In a stack, which operations adds an element?
Pop
Push
Peek
Dequeue
What does LIFO stand for in stacks?
Last in first out
Last in final out
Linear in first out
List in firstfirst out
In a queue, which end do you add elements?
Front
Rear
Middle
Any end
What is the root of a binary tree?
The last node
The middle node
The topmost node
The leftmost node
How many children can a node in a binary tree have at most?
1
2
3
Unlimited
What is linear search?
Searching in a sorted array only
Searching each element one by one
Searching using recursion
Searching in trees only
What is the best case case time complexity of linear search?
O(n)
O(log n)
O(1)
O(n2)
In a bubble sort, what happens in each pass?
One element reaches its correct position
All elements are sorted
Nothing happens
Elements are randomly shuffled
What is a linked list?
An array with fixed size
A collection of nodes connected by pointers
A sorting algorithm
A search technique
What does each node in a singly linked list contains?
Only data
Only pointer
Data and pointer to next node
Multiple data values
What is the space complexity of an algorithm that uses a fixed amount of space?
O(n)
O(log n)
O(1)
O(n2)
What is recursion?
A loop
A function calling itself
A data structure
A sorting method
What is the base case in recursion?
The first call
The Condition to stop recursion
A data structure
A sorting method
What is the time complexity of a binary search?
O(n)
O(log n)
O(n2)
O(1)
Binary search works only on......??
Unsorted arrays
Sorted arrays
Linked list
Stacks
What is the worst case time complexity of quicksort?
O(n log n)
O(log n)
O(n2)
0(1)
Which sorting algorithm has the best worst case time complexity?
Bubble sort
Selection sort
Merge sort
Quick sort
What is a hash table?
A sorted array
A data structure using key-value pairs
A tree structure
A stack implementation
What is collision in hashing?
When two keys map to the same index
When the hash table is full
When a key is not found
When hash function fails
In a binary search tree, the left child is
Greater than parent
Less than parent
Equal to parent
Random value
What is the height of a balanced binary tree with n nodes?
O(n)
O(log n)
O(1)
O(n^2)
Which traversal visits root first in a binary tree?
Inorder
Postorder
Preorder
Level order
What is a graph?
A tree with cycles
A collection of vertices and edges
A linear data structure
A sorting algorithm
What is BFS in graphs?
Binary First Search
Breadth First Search
Best First Search
Backward First Search
Which data structure is used in BFS?
Stack
Queue
Array
Tree
What is DFS in graphs?
Data First Search
Depth First Search
Direct First Search
Double First Search
Which data structure is used in DFS?
Stack
Queue
Array
Hash table
What is dynamic programming?
Writing dynamic code
Solving problems by breaking into sub problems
Programming in runtime
Object oriented programming
What is memorization?
Memory allocation
Storing results of expensive function calls
Creating memory leaks
Memory deallocation
What is the principle behind greedy algorithms?
Always choose the globally optimal solutions
Always choose the locally optimal solution
Choose random solutions
Try all possible solutions
What is a heap?
A complete binary tree with heap property
A sorting algorithm
A searching technique
A hash table
In a max heap, the parent node is:
Smaller than children
Greater than or equal to children
Equal to children
Random compared to children
What is the time complexity of insertion in a binary heap?
O(n)
O(log n)
O(1)
O(n2)
What is the space complexity of merge sort?
O(1)
O(log n)
O(n)
O(n2)
Which algorithm is used to find shortest path in weighted graphs?
BFS
DFS
Dijkstra's algorithm
Linear Search
What is the time complexity of Dijkstra's algorithm using binary heap?
O(V2)
O((V+E)log V)
O(VE)
O(V log V)
What is a Trie data structure used for?
Sorting numbers
String matching and prefix searches
Graph traversal
Mathematical Calculations
What is the worst-case time complexity of searching in a hash table?
O(1)
O(log n)
O(n)
O(n2)
Which of the following is NOT a stable sorting algorithm?
Merge Sort
Insertion Sort
Quick sort
Bubble sort
What is the minimum number of comparisons needed to sort n elements?
O(n)
O(n log n)
O(n2)
O(log n)
In Red-Black trees, what is the maximum height?
O(n)
O(2 log n)
O(log n)
O(n2)
What is Floyd - Marshall algorithm used for?
Sorting
All pairs shortest paths
Minimum spanning tree
Maximum flow
What is the time complexity of Floyd-Warshall algorithm?
O(V2)
O(V3)
O(V+E)
O(VE)
What data structure is used to implement LRU cache efficiently?
Array
Hash table + Doubly linked
Stack
Queue
What is the amortized time complexity of dynamic array resize?
O(1)
O(log n)
O(n)
O(n2)
What is the segment tree used for?
Sorting
Graph traversal
String matching
Range queries and updates
What is the space complexity of iterative deepening search?
O(b^m)
O(bd)
O(b2d)
O(d^2)
What is the principle of Divide and conquer?
Solve problem iteratively
Use greedy search approach
Break problem into smaller sub problems, solve recursively combine solutions
Store all possible solutions
What does SaaS stand for?
System as a service
Storage as a service
Security as a service
Software as a service
Which is an example of IaaS ?
Amazon EC2
Gmail
Microsoft Office 365
Dropbox
What is the main benefit of Cloud Computing?
Higher costs
Limited access
Scalability and cost efficiency
More hardware needed
What does PaaS stand for?
Only hardware
Platform for developing applications
Only software
Only networking
Which cloud deployment model is most secure for sensitive data?
Public cloud
Hybrid cloud
Community cloud
Private cloud
What is serverless computing?
Computing where server management is abstracted
Computer without servers
Using only physical servers
Free computing services
What is auto-scaling in cloud?
Manual server management
Automatic adjustment of resources based on demand
Fixed resource allocation
Turning off servers automatically
What is a virtual machine?
A physical computer
A programming language
A database system
Software emulation of a physical computer
What is Containerization?
Packaging applications with their dependencies
Storing data in containers
Physical shipping
Database management
What is the main advantage of microservice architecture?
Single point of failure
Independent deployment and scaling
More complex management
Higher costs
What is machine learning?
Programming computers manually
Algorithms that improve through experience
Building physical machines
Learning to use machines
What type of learning uses labelled data?
Supervised learning
Unsupervised learning
Reinforcement learning
Semi supervised learning
What is overfitting in ML?
Model performs well on training but poorly on test data
Model performs poorly on all data
Model is too simple
Model has no errors
What is neural network inspired by?
Computer circuits
Human Brain
Internet structure
Mathematical equation
What is the purpose of training data?
To test the final model
To reach the algorithm
To deploy the model
To visualize results
What is classification in ML?
Predicting Continuous values
Predicting discrete categories
Clustering data points
Reducing data dimensions
What is regression in ML?
Predicting categories
Predicting continuous values
Clustering data
Data cleaning
What is Cross validation used for?
Training the model
Collecting data
Visualizing results
Evaluating model performance
What is feature engineering?
Building ML models
Selecting and transforming input variables
Testing models
Deploying models
What is Deep Learning?
Learning deeply about topics
ML using neural networks with many layers
Underground learning
Slow learning process
What is a lambda function?
a named function
A class method
A module function
An anonymous function
What is event bubbling?
Creating events
Removing events
Events propagating from child to parent
Event validation
What does async/await do?
Makes code run faster
Handles asynchronous operations
Creates loops
Validates data
What is the difference between === and ==?
No difference
== is faster
=== is deprecated
=== checks type and value, == only value
What is a closure in JavaScript?
A closed function
An anonymous function
A function with access to outer functions variable
A callback function
What is phishing?
Fishing for data in databases?
Network monitoring
Data backup
Fraudulent attempts to obtain sensitive information
What does SSL/TLS Provide?
Faster internet
Encrypted communication
More storage
Better graphics
What is two-factor authentication?
Using two passwords
Two security guards
Additional security layer beyond password
Dual monitors
What is malware?
Hardware problems
Malicious software
Network errors
System updates
What is social engineering in cyber security?
Building social networks
Manipulating people to divulge information
Engineering social media
Team Building
CPU means
(a)
RAM means
(a)
What is the difference between hardware and software?
No difference
Software is faster
Hardware is newer
Hardware is physical, software is programs
What is an operating system?
A hardware component
Software that manages computer hardware and software
A programming language
A database system
What is the purpose of a hard drive?
Processing data
Storing data permanently
Displaying information
Network communication
What will be the output of the "print(result)" statement?
[1, 3, 5, 7, 9]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
[2, 4, 6, 8, 10]
[]
What would be the output of the two print statements?
True and True
True and False
False and True
False and False
What will be the output of the "print(squared_numbers) statement?
[2, 3, 4, 5]
[4, 9, 16, 25]
[2, 9, 4, 25]
[1, 2, 3, 4, 5]
What will be the final output of the two print statements:
Execution completed. 5.0. And Error: Cannot divide by zero. Execution completed. None
5.0 Execution completed And. None Execution completed
Execution completed. 5.0 And. Error: cannot divide by zero none Execution completed
5.0 and None
What will be the output of the "print(fruit_counts)" statement?
{'apple': 3, 'orange': 2. 'banana': 1.}
{'apple': 1, 'orange': 1, 'banana': 1}
{'apple', 'apple', 'apple', 'orange', 'orange', 'banana']
{'apple': '3', 'orange': '2', ' banana': '1'}
What will be the output of the "print(factorial(4))" statement?
16
24
12
4
What will be the final output of the three print statements?
True False True
True False False
False False False
True True False
What will be the output of " print(unique_elements) statement?
[1, 2, 3, 4, 5, 6]
[1, 2, 2, 3, 4, 4, 4, 5,6, 6]
[1, 5, 2, 6, 3,4]
[1, 2, 3, 4, 5, 6, 7, 8]
If the get_user_data function is called "octocat", and the API call is successful z which of the following is most likely to be part of the output?
Name: octocat\nPublic Repos: 8
The Octocat\nPublic Repos: 8
Error fetching user data: .....
Undefined
If the "data.csv" file contains the content as described in the code comments, what will be the output?
Name, Age, City
Alice, 30, New york
Name, Age, City\nAlice, 30, New york\nBob, 25, London \nCharlie, 35, Paris
Name, Age, City, Alice, 30, New York, Bob, 25, London Charlie, 35, Paris
What is the primary function of a "for loop" in programming
To execute a block of code only if a certain condition is true
To repeatedly execute a block of code a specific number of times
To define a reusable block of code that performs a specific task
To handle errors and unexpected events during program execution
Which of the following data types is used to store a collection of unique, unordered items?
List
Tuple
Dictionary
Set
In object oriented programming, what is the concept of "inheritance"?
The process of creating a new object from an existing class
The ability of a class to acquire the properties and behaviors of another
The bundling of data and methods that operate on that data into a single unit
The ability of an object to take on many forms
What is the purpose of a while loop?
To execute a block of code q predetermined number of times.
To break a program into smaller, manageable units
To execute a block of code as long as specified condition is true
To define a set of instructions that can be called by name
What is a 'syntax error' in programming?
An error that occurs due to incorrect logic, causing the program to produce unexpected results.
An error that occurs when the program tries to access a resource that does not exist
An error that violates the rules of the programming language's grammar
An error that causes the program to crash or stop executing unexpectedly
