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. |
What role does Distributed Cache play in Apache Hadoop? |
|
Answer» Hadoop offers a valuable utility feature called Distributed Cache that boosts job performance by caching files used by applications. Read-only files, zips, and jar files can all be distributed using Distributed Cache. Using JobConf settings, an APPLICATION can designate a FILE for the cache. The Hadoop framework copies these files to the nodes where a task must be COMPLETED. This is done before the task execution begins. Useful Interview Preparation Resources: Java Interview Power BI Interview Automation Testing Interview Salesforce Interview Data Scientist Interview Hadoop Interview Online Coding PLATFORM |
|
| 2. |
What is Heartbeat in Hadoop? |
|
Answer» Because the Namenode and Datanode in Hadoop are two physically SEPARATE machines, Heartbeat is the signal transmitted by the Datanode to the Namenode at regular intervals to confirm its existence, i.e. that it is alive. If Namenode does not receive a heartbeat from a Datanode within a specific timeframe (usually 10 minutes), Namenode CONSIDERS the Datanode to be DEAD. Along with the heartbeat, the Datanode also TRANSMITS the block report to Namenode, which normally contains a list of all the blocks on the Datanode. |
|
| 3. |
What is YARN in Hadoop? |
|
Answer» Yet Another Resource Negotiator is abbreviated as yarn. It is Hadoop's resource management layer. YARN was first RELEASED in Hadoop 2.x. To execute and process data saved in the Hadoop Distributed File System, Yarn includes a number of data processing engines, including graph processing, BATCH processing, interactive processing, and stream processing. Yarn ALSO provides employment scheduling services. It extends Hadoop's capabilities to other emerging technologies, allowing them to benefit from HDFS and cost-effective clusters. Hadoop 2.x's data operating technique is Apache Yarn. It comprises a "Resource Manager" master daemon, a "Node Manager" slave daemon, and APPLICATION Master. |
|
| 4. |
Discuss honeypots in context to Cyber Security. |
|
Answer» Honeypots are attack targets put up to study how DIFFERENT attackers try to EXPLOIT vulnerabilities. Honeypot is a spoof computer system that keeps track of all user transactions, interactions, and behaviours. The same idea, which is extensively utilised in academic settings, can be employed by private companies and governments to assess their risks. Production Honeypots and research Honeypots are the two types of Honeypots available.
|
|
| 5. |
What is the Man-in-the-Middle Attack in context to Cyber Security? |
|
Answer» A man-in-the-middle attack is a cyber threat (a form of eavesdropping assault) in which a cybercriminal wiretaps a conversation or data transmission involving two people. When a cybercriminal joins a two-way chat, they appear to be authentic participants, giving them the ability to gather SENSITIVE information and RESPOND in a number of ways. The main purpose of this type of attack is to gain access to personal information about our ENTERPRISE or consumers. A cybercriminal could, for example, intercept data flowing between the target device and the network on an unprotected Wi-Fi network. As we can understand from the image, a man-in-the-middle attack is a form of eavesdropping attack in which an attacker INTERCEPTS a conversation or data TRANSFER in progress. The attackers pose as both genuine participants after inserting themselves in the "middle" of the transfer. This allows an attacker to intercept data and information from both parties while also providing malicious links or other information to both genuine participants in a way that may not be detected until it is too late. |
|
| 6. |
List the differences between Echo and Print in PHP. |
|
Answer» The functions of echo and print are nearly identical. Both are used to display info on the screen. The differences are MINOR:
Example: <!DOCTYPE html><html><body><?phpprint "PHP is fun!<br>";echo "PHP is fun.<br>";echo "PHP ", "is ", "fun.";?> </body></html>Output: PHP is fun!PHP is fun.PHP is fun.The above example SHOWS that echo can take many parameters whereas print cannot. We obtain a syntax error if we try to pass multiple parameters into print. |
|
| 7. |
What is a session in PHP? |
|
Answer» In PHP, a session is a means to save data that can be utilized across various pages of a website. Unlike cookies, the information is not saved on the user's machine. The session will generate a file in a TEMPORARY directory on the server to hold registered session variables and their values. During that visit, this information will be available on all pages of the site. When working with an application, you open it, make changes to it, and then close it. The computer is aware of when you start and stop the application. However, because the HTTP address does not RETAIN a state on the internet, the webserver has no idea who you are or what you do. Session variables are used to SOLVE this problem by saving user information that can be used across many pages (e.g. username, favourite colour, etc). Session variables are lasting until the user closes the browser. Session variables, on the other hand, store information about a single user and are accessible from all pages in a single application. |
|
| 8. |
Given a two-dimensional boolean array with each row sorted. There are m rows and n columns in the matrix. Find the row that has the most 1s in it. |
Answer»
Here, the variable maximum is first initialized by using the values of the first row. We then check to see if the row has more 1s than the maximum number of 1s. Only count the 1s if there are any more in the row. To count 1s in a row, we don't run a binary search across the full row; instead, we search before the index of the last maximum. |
|
| 9. |
We need to reverse the order of the first k members of a queue of numbers, leaving the other elements in the same relative order, given an integer k and a queue of integers. Only the standard operations like enqueue, dequeue, size and front are allowed. |
|
Answer» Using an auxiliary stack is the strategy.
Here is the C++ implementation of the algorithm discussed: // C++void reverseFirstKElements(int k, queue<int>& Q){ if (Q.empty() || k > Q.size()) return; if (k <= 0) return; stack<int> S; int i = 1; /* PUSH the first k elements of the Queue into the Stack*/ while (i <= k) { S.push(Q.front()); Q.pop(); i++; } /* ENQUEUE the elements of the stack at the end of the queue*/ while (S.empty() == false) { Q.push(S.top()); S.pop(); } /* the remaining elements to be enqueued at the end of the Queue*/ for (int i = 0; i < Q.size() - k; i++) { Q.push(Q.front()); Q.pop(); }}We dequeue the first k elements from the queue Q and push them into the stack S. We then insert the elements from S to Q. Then (size-k) elements are removed from the front and ADDED to Q one by one. |
|
| 10. |
What are access specifiers in C++? |
|
Answer» Access specifiers specify the accessibility of the members of a class (attributes and methods). That is, it imposes some limitations on class members, preventing them from being DIRECTLY accessed by external functions. In C++, there are three types of access modifiers:
|
|
| 11. |
What Is generational garbage collection in context to Java? What makes it so popular? |
|
Answer» Generational garbage collection can simply be described as the garbage collector's approach of dividing the heap into a number of generations, each of which will HOLD objects based on their "age" on the heap. Marking is the initial stage in the waste collection process WHENEVER the garbage collector is turned on. The garbage collector uses this information to determine which memory blocks are in use and which are not. If all objects in a system must be scanned, this can be a lengthy operation. As more objects are allocated, the list of objects grows longer and longer, causing garbage collection to take longer and longer. However, empirical application study has revealed that the majority of objects are transient. Objects are categorized according to their "age" in terms of how many garbage collection cycles they have SURVIVED with generational garbage collection. As a result, the majority of the effort was SPREAD out over several minor and major collection cycles. Almost all garbage collectors today are multi-generational. This METHOD has become so popular because it has consistently proven to be the best option. |
|
| 12. |
What are the different storage classes in C? |
|
Answer» Storage Classes are used to specify a variable or function's characteristics. These characteristics include SCOPE, visibility, and lifetime, which allow us to track the presence of a variable during the course of a program's execution. The C programming language has four storage classes:
|
|
| 13. |
What is the difference between declaration and definition for a variable or a function in C? |
|
Answer» The declaration of a variable or function simply STATES that it EXISTS at some place in the program but that no memory has been allocated for it. The declaration of a variable or function is crucial because it INFORMS the program about the type of the variable or function. It also tells the program the arguments, their data types, the order of those arguments, and the function's return type in the case of function declarations. That concludes the declaration. In relation to the definition, defining a variable or function does more than just DECLARE it; it also allocates memory for that variable or function. As a result, we can consider declaration to be a subset of definition (or declaration as a SUPERSET of definition). Variable: A variable is defined and declared at the same time in the C programming language. There is no distinction between declaration and definition for a variable in C, in other words. Example: int x;The information, such as the variable name: x and the data type: int, is passed to the compiler and is saved in the symbol table data structure. A memory of size 2 bytes will also be allocated (depending on the type of compiler). If we merely want to declare variables and not define them, i.e. we don't want to allocate memory space, we can use the following declaration: extern int x;Only the information about the variable is sent in this example, and no memory is allocated. The above information informs the compiler that variable an is declared now, but memory for it will be defined later, either in the same file or in a separate file. Function: The function declaration provides to the compiler, the name of the function, the number and type of arguments it accepts, and the return type. Consider the following code, for example: int sum (int, int);A function named sum is declared with two int arguments and an int return type. At this time, no memory will be allocated. Allocating memory for the function is based on the function's definition. Consider the following function definition, for example: int sum (int x, int y) { return (x+y); }The memory for the function add will be allocated during this function definition. A variable or function can be declared as many times as needed, but it can only be defined once. |
|
| 14. |
Explain transaction atomicity in context to OS. |
|
Answer» The transaction process can be thought of as a series of read and write activities on data, followed by a commit operation. Transaction atomicity means that if a transaction fails to finish successfully, the transaction must be aborted, and all modifications made during execution must be rolled back. It indicates that a transaction must seem LIKE a SINGLE, non-divisible process. This guarantees that the integrity of the data being updated is preserved. If the concept of atomicity is not applied in transactions, every transaction that is CANCELLED in the middle may RESULT in data inconsistency because two transactions may be sharing the same data value. |
|
| 15. |
Why is it that a single serial port is controlled by a single interrupt-driven I/O (input/ output), but a front-end processor, such as a terminal concentrator, is managed by a polling I/O? Answer this in context to OS. |
|
Answer» Interrupt is a hardware method by which a device alerts the CPU that it NEEDS its ATTENTION. Interruptions might happen at any time. As a result, when the CPU receives an interrupt signal over the indicator interrupt-request line, it suspends the current process and responds to the interrupt by giving control to the interrupt HANDLER, which serves the device. Polling is a PROCEDURE in which the CPU checks if the device requires attention on a regular basis. When a device tells the process unit that it wants hardware processing, the process unit polls the I/O device to see if it wants CPU processing. The CPU is constantly checking each and every device connected to it to see if any of them requires hardware attention. A serial port may have a tiny NUMBER of I/O requests, and therefore, interrupts should be used whenever possible. Serial ports in a terminal concentrator are a different matter. A terminal concentrator has several serial ports, which can result in the formation of multiple brief I/O instances, which can increase the system's burden unnecessarily if interrupts are used. Instead, by looping through without the need for I/O, a polling loop can dramatically reduce the amount of burden on the system. Hence, polling is believed to be more efficient than interrupt-driven I/O when the I/O is frequent and of extremely short duration. Therefore, we may conclude that interrupts are used for single ports because the frequency of I/O on such a port is low and can be managed successfully, whereas polling is used for many ports because the frequency of I/O grows and the duration is short, which suits polling. |
|
| 16. |
How does reference counting deal with objects that are memory allocated in context to OS? When does it fail to reclaim objects? |
|
Answer» Every object GAINS a count of how many times it has been referred to in the context of reference counting. Every TIME a reference to that item is made, the count is increased. A reference's value is also decremented every time it is deleted. This operation continues until the reference count reaches zero. When an object's reference count reaches 0, the object can be RECOVERED. By preserving a count in each object, reference counting systems may do AUTONOMOUS memory management. Any object without a reference count can be regarded as "dead," and its memory can be recovered. In the situation of cyclic references, the reference counting method may fail to reclaim objects. There are no concrete solutions to this problem, therefore it is usually recommended to design architecture without circular references. |
|
| 17. |
What are the advantages and the disadvantages of using threads in context to OS? |
|
Answer» Within a process, a thread is a path of execution. Multiple threads can exist in a process. It's an independent control flow within a process. It is made up of a context and a set of instructions to be carried out. Shared memory space is used by threads in the same process. Threads aren't really independent of one another, hence they share their code section, data section, and OS resources with other threads (like open files and signals). The following are the KEY benefits of EMPLOYING threads:
The following are the main drawbacks of employing threads:
|
|
| 18. |
What is a Kernel in OS? |
|
Answer» Kernel is a component of an operating system that manages computer and hardware functions. It primarily oversees memory and CPU functions. It's a crucial PART of any operating system. Kernel serves as a LINK between applications and hardware-based data processing via inter-process communication and system calls. When an operating system is loaded, the kernel is loaded initially and remains in memory until the operating system is shut down. It's in charge of things like disk utility, task management, and memory management. It determines which processes should be ASSIGNED to the CPU and which should be kept in the main memory for execution. It basically serves as an interface between USER software and hardware. The kernel's primary goal is to manage communication between software, such as user-level applications, and hardware, such as the CPU and disc memory. |
|
| 19. |
Explain the DDL (Data Definition Language), DML (Data Manipulation Language) and DCL (Data Control Language) statements in SQL. |
Answer»
|
|
| 20. |
Differentiate between hierarchical database models and network in DBMS. |
||||||||||
|
Answer» Data are grouped into nodes in a tree-like structure in a hierarchical database model. A node can only have ONE parent node above it. As a result, the data nodes in this model have one-to-many relationships. The Document Object Model (DOM), which is often used in web browsers, is an example of this model. The NETWORK database model is a more sophisticated variation of the hierarchical database architecture. Data is organised in a graph-like structure here as well. One child node, on the other HAND, can be connected to several parent nodes. A many-to-many relationship between data nodes is an outcome of this. Network databases include IDMS (Integrated Database Management System) and IDS (Integrated Data Store).
|
|||||||||||
| 21. |
Differentiate between Hash join, Sort Merge join and Nested Loop join in DBMS. |
Answer»
|
|
| 22. |
Discuss the physical layer of the OSI (Open Systems Interconnection) Model in context of Computer Networks. |
|
Answer» The physical layer is the lowest layer in the OSI reference model. It is in charge of establishing a physical connection between the devices. BITS of information are stored in the physical layer. It is in charge of sending individual bits from one node to another. When this layer receives data, it converts the signal received into 0s and 1s and sends them to the Data Link layer, which reassembles the frame. The physical layer's FUNCTIONS are as follows:
|
|
| 23. |
What are the pros and cons of star topology in Computer Networks? |
|
Answer» In COMPUTER networks, a star network is an application of the spoke–hub distribution model. EVERY host in a star network is linked to a central hub. One central hub serves as a channel for messages in its most basic form. One of the most popular computer network topologies is the star network. The advantages of star topology are:
The disadvantages of star topology are:
|
|
| 24. |
What do you understand about tunneling protocol in Computer Networks? |
|
Answer» A tunneling protocol is a communications protocol that allows data to be moved from one network to another. Through a TECHNIQUE known as encapsulation, private network communications can be SENT via a public network (such as the Internet). Because tunnelling entails repackaging traffic data into a different format, possibly with encryption as a standard, the nature of communication that passes via a tunnel can be hidden. The data component of a packet (the payload) is used by the tunnelling protocol to carry the packets that actually provide the service. Tunneling FOLLOWS a layered protocol model, such as the OSI or TCP/IP protocol suites, but frequently BREAKS the layering by using the payload to convey a service that the network does not normally provide. In the layered approach, the delivery protocol is usually equal to or higher than the payload protocol. |
|
| 25. |
List the differences between CSMA/CD (Carrier Sense Multiple Access / Collision Detection) and CSMA/CA (Carrier Sense Multiple Access / Collision Avoidance) in Computer Networks. |
||||||||||
|
Answer» Carrier Sense Multiple Access / Collision Detection (CSMA/CD) is a carrier transmission network protocol. It is USED in the medium access control layer (the layer that monitors the hardware which is responsible for the interaction with the wired, optical or wireless transmission medium). It detects if the shared channel for broadcasting is busy and interrupts the broadcast till the channel becomes available. Collisions in CSMA/CD are identified via broadcast SENSING from other STATIONS. In CSMA/CD, when a collision is detected, the transmission is halted and the stations send a jam signal, after which the station waits for a RANDOM time CONTEXT before retransmission. Carrier Sense Multiple Access / Collision Avoidance (CSMA/CA) is a carrier transmission network protocol. It operates in the same media access control layer as CSMA/CD. Unlike CSMA/CD, which only works after a collision, CSMA/CA works before a collision.
|
|||||||||||
| 26. |
What is SMTP (Simple Mail Transfer Protocol) in Computer Networks? |
|
Answer» Email is quickly becoming one of the most VALUABLE SERVICES available on the internet. SMTP is the most used technique for transferring mail from one user to ANOTHER over the internet. SMTP is a push protocol that is used to transmit mail. It is an application layer protocol. The client who wants to send the email establishes a TCP connection with the SMTP server and then sends the email VIA it. The SMTP server is always set to listen. The SMTP process establishes a connection as soon as it detects a TCP connection from any client. The client process sends the letter immediately after SUCCESSFULLY establishing a TCP connection. |
|
| 27. |
What are the differences between stored procedure and triggers in SQL? |
||||||||||||
|
Answer» Stored procedures are small pieces of PL/SQL code that PERFORM a specific task. The USER can call stored procedures directly. It's similar to a program in that it can take some input as a PARAMETER, process it, and return values. Trigger, on the other hand, is a stored process that executes automatically when certain events occur (eg update, insert, delete in a database). Triggers are similar to event handlers in that they operate in response to a specified event. Triggers are unable to accept input or return values.
|
|||||||||||||