InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How will you delete a node in a doubly-linked list (DLL)? |
|
Answer» The following is the process to delete a node in a doubly-linked list (DLL):
Code to delete a node in a doubly-linked list: import gc # Node of the doubly linked listclass Node: def __init__(self, data): self.data = data self.next = NONE self.prev = None class DoublyLinkedList: def __init__(self): self.head = None # A function to delete a node in a Doubly Linked List. def deleteNode(self, todelete): if self.head is None or todelete is None: return # If node to be deleted is the head node if self.head == todelete: self.head = todelete.next # Change next only if node to be deleted is NOT # the last node if todelete.next is not None: todelete.next.prev = todelete.prev # Change prev only if node to be deleted is NOT # the first node if todelete.prev is not None: todelete.prev.next = todelete.next gc.collect() # Given a reference to the head of a list and an # integer, inserts a new node on the front of list def push(self, new_data): # Allocates node and inserts the data in it new_node = Node(new_data) # MAKE next of new node as head and previous as None new_node.next = self.head # Change prev of head node to new_node if self.head is not None: self.head.prev = new_node # Move the head to point to the new node self.head = new_node def printList(self, node): while(node is not None): print(node.data,end=' ') node = node.next # Start with an empty listdll = DoublyLinkedList()dll.push(2);dll.push(4);dll.push(8);dll.push(10); print ("\n The original linked list",end=' ')dll.printList(dll.head) # delete nodes from doubly linked listdll.deleteNode(dll.head)dll.deleteNode(dll.head.next)dll.deleteNode(dll.head.next)# Updated linked list will be NULL<-8->NULLprint("\n The updated linked list",end=' ')dll.printList(dll.head)Useful Resources:
|
|
| 2. |
What are pragma directives? |
|
Answer» This is a special-purpose directive that is used to enable or disable certain functionality. This type of directive is COMPILER-specific, meaning it differs from one compiler to the next. The following are some of the #pragma directives:
|
|
| 3. |
What is the difference between Manual and Automation Testing. |
||||||||
|
Answer» There are some significant distinctions between automated and manual testing. Manual testing involves a human performing tests STEP by step without the use of test scripts. Test automation frameworks, as well as other tools and technologies, are used to automate the execution of tests in automated testing. Learn More.
|
|||||||||
| 4. |
Describe how you would reverse a singly linked list. |
|
Answer» The TASK is to reverse a linked list given a pointer to the HEAD node. By modifying the linkages between nodes, we can reverse the list. Iterative method:
|
|
| 5. |
What daemon is responsible for tracking events on your system? |
|
Answer» The DAEMON 'syslogd' is in CHARGE of keeping TRACK of system data and storing it in PARTICULAR LOG files. |
|
| 6. |
What is marshalling? |
|
Answer» Marshalling is the process of converting an object's MEMORY representation into a format that can be stored or transmitted to other software applications. Marshalling converts an object into serialised form, allowing communication between remote objects. SERIALIZATION and marshalling are TWO terms that are often used interchangeably. The objective of marshalling is to have the same object that is present in one operating programme, to be present in another running programme, i.e. object on a client to be transmitted to and present on the server. For EXAMPLE, serialization does not always have this intention because it is simply concerned with translating data into a stream of bytes. |
|
| 7. |
What is the difference between array and hash table? |
|
Answer» An array has a SET NUMBER of memory regions at first. It should store a preset type at each site (e.g. an integer). It could have repeated values or not. Hash is implemented as a set, on the other HAND. It's built around an array. A hash function determines the position of an item in an array. There should be no duplicates in a hash. A collision occurs when duplicates occur, and there are several techniques for RESOLVING this (e.g. chain duplicates, rehash and so on). |
|
| 8. |
Explain the Unix kernel. |
|
Answer» The operating system's central core is the UNIX kernel. It CONNECTS to the hardware DEVICES, as WELL as to the processor, memory, and I/O management. Users' requests are managed by the kernel using system CALLS that move the process from user space to kernel space. A context switch occurs every time a user process performs a system call, such as read(), fork(), exec(), open(), and so on. A context switch is a mechanism that allows a process to change its state. The process can either be blocked until the system call is completed, or it can continue and be told of the COMPLETION of the system call via a signal (nonblocking). |
|
| 9. |
What is a parent/child selector? |
|
Answer» <P>All ELEMENTS that are a direct child of the specified ELEMENT are SELECTED using the ("parent > child") selection. Parameters:
It chooses and returns all of the parent element's direct children. Here is an example of how to use the jQuery parent > child selector: <html><body><h2>Sample Demo</h2><div><p>First line.</p><span>Middle line. (span outside of p element.) </span><p>LAST line. </p></div><br><div><p>First line.</p><p>Middle line. <span>span inside p element.</span></p><p>Last line. </p></div></body></html> |
|
| 10. |
What is a virtual memory? |
|
Answer» A segment of memory that is produced MOMENTARILY on the storage device is referred to as virtual memory. It occurs when a computer's RAM gets depleted as a result of multiple processes executing at the same time. A part of the storage disc is made accessible for usage as RAM by the operating system. Because processor power is consumed by moving data around rather than performing instructions, virtual memory is substantially slower than main memory. The operating systems guide shows how the operating system handles memory. When the computer needs to use virtual memory, latency increases. The operating system employs SWAPPING to transport data between RAM and virtual memory. Data from processes that aren't in use right now is moved out of RAM and STORED in virtual memory by the operating system. When the PROCESS is needed again, it copies the data back into RAM. As transferring to a HARD disc takes far longer than reading and writing RAM, using virtual memory slows down the machine. |
|
| 11. |
What is the default port for the MySQL server? |
|
Answer» The MySQL client, MySQL CONNECTORS, and utilities like mysqldump and mysqlpump all use PORT 3306 as the default port for the old MySQL PROTOCOL (port). |
|
| 12. |
What are the different types of OSI layers? |
|
Answer» Open Systems Interconnection (OSI) is an acronym for Open Systems Interconnection. It was created in 1984 by ISO or the International Organization for Standardization. It is a seven-layer ARCHITECTURE, with each layer performing distinct functions. These seven layers work together to send data from one person to another across the globe.
|
|
| 13. |
What is meant by stack and queue? |
Answer»
|
|
| 14. |
What is the use of pointers? |
|
Answer» POINTERS are USED to store and maintain the addresses of memory blocks that are dynamically allocated. Data objects or arrays of objects are stored in these blocks. The heap or free store is a memory space in most structured and object-oriented languages from which objects are dynamically allocated. Example in C: #include <stdio.h>void printpointer(){ int var = 10; int *pt; pt = &var; printf("The address is: %p \n",pt); printf("The value is: %d \n", *pt); }int main(){ printpointer();} |
|
| 15. |
What are the types of kernel objects? |
|
Answer» The FOLLOWING are the several types of kernel objects:
|
|
| 16. |
What are SDLC phases? |
|
Answer» The SDLC (system development life cycle) is a project management MODEL. It specifies the several stages that must be completed in order to take a project from conception to deployment and afterwards maintenance. The 7 Stages of the System Development Life Cycle:
|
|
| 17. |
What are the advantages and disadvantages of DHCP? |
|
Answer» DHCP stands for Dynamic Host Configuration PROTOCOL, and it is a client-server architecture. The following are the advantages or benefits of DHCP:
The following are DHCP's drawbacks or downsides:
|
|