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 is the use of a CSS preprocessor? When should a pre-processor be utilised in a project, according to you? |
|
Answer» CSS preprocessors are scripting languages that augment CSS's STANDARD functionality. They allow us to employ variables, nesting, inheritance, mixins, functions, and mathematical operations in our CSS CODE. CSS preprocessors make it simple to automate repetitive activities, eliminate code bloat and errors, DEVELOP reusable code snippets, and maintain backward compatibility. The benefits and drawbacks of using a preprocessor vary depending on the type of project, but the following are some of the benefits and drawbacks. Advantages:
Disadvantages:
Choosing a preprocessor comes down to personal choice, and it MIGHT be instructive to see how a developer could choose one over the other for your project. Useful Preparation Resources:OOPs OS SQL Practice Problems |
|
| 2. |
Describe the main differences between the LocalStorage and SessionStorage objects in context to HTML. |
|
Answer» The following are the main distinctions between LOCALSTORAGE and sessionStorage objects:
|
|
| 3. |
What makes a block-level element different from an inline element in HTML? |
||||
Answer»
|
|||||
| 4. |
What do you understand about RAID in context to Project Management? |
|
Answer» RAID stands for RISK, Actions, Issues, and Dependencies in PROJECT management. These are extremely crucial aspects for a project manager to understand.
|
|
| 5. |
Explain the Project Management Life Cycle method in context to Project Management. |
|
Answer» The Project Management LIFE Cycle is a set of activities/tasks that must be COMPLETED in order for project objectives or targets to be met. This assists in organizing and streamlining the efforts required to complete the project into a sequence of logical and doable actions. The Project Management Life Cycle is divided into four SIMPLE phases, as follows:
|
|
| 6. |
What is EUCALYPTUS in cloud computing? List some of its functionalities. |
|
Answer» Eucalyptus is commercial and open-source computer software for creating private and hybrid CLOUD computing environments that are compatible with Amazon Web Services (AWS). It was created by the company Eucalyptus Systems. Eucalyptus stands for Elastic Utility Computing Architecture for Linking Your Programs To Useful Systems. Eucalyptus enables application workloads to be flexibly scaled up or down by pooling compute, storage, and network resources. Some of its functionalities are:
|
|
| 7. |
What are the benefits of Hybrid Clouds in Cloud Computing? |
|
Answer» A hybrid cloud is computing, storage, and service environment that combines on-premises infrastructure, private cloud services, and a public cloud (such as Amazon Web Services (AWS) or Microsoft Azure) with orchestration among the platforms. Hybrid cloud infrastructure is one that combines public clouds, on-premises computing, and private clouds in your cloud server. The real value of cloud services comes from their ability to enable a fast-paced digital company to change. There are TWO agendas in every technology management organization: the IT AGENDA and the BUSINESS transformation agenda. Traditionally, the IT agenda has been concentrated on cost-cutting. Digital business transformation plans, on the other hand, are concentrated on making money through investments. The main advantage of a hybrid cloud is its FLEXIBILITY. To acquire the agility it requires for a competitive advantage, your company may desire (or need) to INTEGRATE public clouds, private clouds, and on-premises resources. |
|
| 8. |
How do the commands DROP, TRUNCATE, and DELETE differ in SQL? |
|||||||||||||||
Answer»
|
||||||||||||||||
| 9. |
What are the advantages and disadvantages of indexing in DBMS? |
|
Answer» Indexing is a technique for improving the database PERFORMANCE by reducing the number of disc accesses needed when a query is run. It's a data structure strategy for finding and accessing data in a database rapidly. The following are some of the benefits of indexes:
The cons of indexing are:
|
|
| 10. |
What are the different types of Shells in Linux? |
|
Answer» SHELL is a PROGRAM that acts as the interface between the user and the operating system. It is a command-line interface to the Unix operating system. It collects data from you and runs programs depending on that data. The output of the program is displayed once it has completed its execution. Shell allows us to run commands, programs, and shell SCRIPTS. Kernel maintains resources between processes and regulates all-important computer operations. It also restricts hardware access, organizes all performing utilities, and manages resources between processes. Only kernel users have access to the operating system's utilities. Types of SHELLS:
|
|
| 11. |
What are the advantages and disadvantages of time slicing in CPU Scheduling in OS? |
|
Answer» Time slicing allows a task to run for a set amount of time before returning to the pool of ready TASKS. The scheduler then determines the executable job depending on the priority and a variety of other factors. A task in a time-slicing method runs for a predetermined amount of time. If there is another task with a higher priority after that task is completed, the scheduler runs the priority task next, BASED on priority and other considerations. The advantages of time slicing in CPU Scheduling are:
The disadvantages of time slicing in CPU Scheduling are:
|
|
| 12. |
List the important functionalities/features of an operating system. |
|
Answer» The following are some of the most important features of an operating system:
|
|
| 13. |
Get the nth Fibonacci number in O(n) time and O(1) space complexity. |
|
Answer» //Javascriptfunction fib(n){ let [x, y] = [0, 1] while (n > 0){ [x, y] = [y, x + y] n -= 1 } return x} This SOLUTION has a linear time complexity of O(n) and a constant space complexity of O(1). The number of loops required to determine the nth fib number will STILL increase linearly as n increases, but as we extend the sequence out, we are OVERRIDING the previous NUMBERS in the sequence, KEEPING the space complexity constant for any input n. It is often referred to as the Iterative Top-Down Approach. |
|
| 14. |
Write the code to find the LCM of an array of numbers. |
|
Answer» We know that LCM (x, y) = (x * y) / GCD (x, y). We have to extend this idea to an array of numbers. Let's imagine we have an array arr[] with n members for which the LCM must be calculated. Our algorithm's major steps are as FOLLOWS:
Output: 2772 |
|
| 15. |
Explain copy constructor vs assignment operator in C++. |
|
Answer» A copy CONSTRUCTOR is a member function that uses another object of the same class to initialise an object. Assignment operators are used to giving a variable a value. The assignment operator's left side OPERAND is a variable, while the assignment operator's right side operand is a value. // C++#include<iostream> #include<stdio.h> using namespace STD; class IB{ public: IB() {} IB(const IB &b) { cout<<"Copy constructor is called "<<endl; } IB& operator = (const IB &b) { cout<<"Assignment operator is called "<<endl; return *this; } }; // Driver codeint main() { IB b1, b2; b2 = b1; IB b3 = b1; getchar(); return 0; }Output: Assignment operator is calledCopy constructor is calledWhen a new object is GENERATED from an existing object as a copy of the old object, the copy constructor is called. When an already initialised object is given a new value from another object, the assignment operator is used. |
|
| 16. |
Explain free() vs delete () in C++. |
|
Answer» Both delete() and free() are USED to dynamically deallocate memory.
|
|
| 17. |
What do you understand about Stack Unwinding in C++? |
|
Answer» Stack Unwinding is the process of eliminating function ENTRIES from the function CALL stack at runtime. EXCEPTION Handling is often ASSOCIATED with Stack Unwinding. When an exception occurs in C++, the function call stack is searched linearly for the exception handler, and any entries before the function with the exception handler are deleted from the function call stack. If the exception is not handled in the same code, stack unwinding is REQUIRED (where it is thrown). |
|
| 18. |
Explain precondition and postcondition to a member function in the context of C++ programming language. |
|
Answer» A precondition is a condition that must be met before a member FUNCTION may be called. If PRECONDITIONS are never false, a CLASS is appropriately used. If a precondition fails to hold, the following function is not executed. For EXAMPLE, before inserting an element into a stack, we call the isfull() to check if the stack is full or not. Here, the isfull() is an example of a precondition. A post-condition is a condition that must be true when a member function is exited if the precondition was true when the function was entered. For a code to be correctly implemented, the post-conditions must never be false For example, we know that isempty() must always hold after placing an element ONTO the stack. This is a push operation post-condition. |
|
| 19. |
Differentiate between strings and char arrays in Java. |
||||||||||||||||||
Answer»
|
|||||||||||||||||||
| 20. |
What are the differences between error and exception in Java? |
||||||||||||||
|
Answer» An error occurs when a user performs an unauthorised action that causes the code to behave abnormally. Errors in programming are frequently UNNOTICED until the code is compiled or run. Some of the errors make it impossible to compile or run a program. As a result, errors should be removed before COMPILING and running a program. Out of memory and system crash are two examples of errors. In Java, an exception is an unwelcome or unexpected occurrence that occurs during the program execution, or during run time, and disturbs the usual flow of the program's instructions. Exceptions are circumstances that arise during the program execution and may result in its termination. However, try, catch, and throw keywords can be USED to recover them. Unchecked exceptions (exceptions which are not checked at compile time), such as ArrayIndexOutOfBoundException, are KNOWN to the compiler at runtime, whereas checked exceptions (exceptions which are checked at compile time), such as IOException, are known to the compiler at compile time.
|
|||||||||||||||
| 21. |
Explain Aggregation vs Composition in Java. |
|
Answer» An association is a relationship that exists between two distinct classes and is established through their Objects. One-to-one, one-to-many, many-to-one, and many-to-many associations are all possible. An Object communicates with other Objects to leverage the capabilities and services provided by that object in Object-Oriented programming. Association has two forms and they are composition and aggregation. Aggregation is a unique type of association in which:
In the above image, we can clearly see that each teacher is associated with a college, and each student is also associated with a college. Thus, both the entities, the student and the teacher can exist independently. Composition is a type of Aggregation in which two entities are extremely reliant on one another.
In the above image, we can clearly see that both TYRE and Engine form an integral part of a vehicle. Both are reliant on each other. Without either of them, the Vehicle entity is useless. |
|
| 22. |
How can you make a request for garbage collection in Java? |
|
Answer» There are two ways to ask the JVM to run the Garbage Collection.
Output: Garbage collector has been calledThe Object whose garbage has been collected is : Sample@4251f172Garbage collector has been calledThe Object whose garbage has been collected is : Sample@481e8172Explanation: In the above code, we create two instances of a class and then re-initialize it to null. Then we call for the garbage collection using the two methods specified above. Thus, we get the above output. |
|
| 23. |
What do you understand about order of precedence and associativity in Java, and how do you use them? |
|||||||||||||||||||||||||||||||||||||||||||||
|
Answer» Order of precedence: The operators are arranged in order of precedence. When a number of operators are employed in an expression, the priorities of the operators determine how the expression is evaluated. In an expression CONTAINING multiple operators with various PRECEDENCES, operator precedence decides which one is executed first. Order of precedence example: (4 > 2 + 8 && 3)The following expression is the same as: ((4 > (2 + 8)) && 3)The expression (2 + 8) will be executed first, yielding a value of 10. After the first HALF of the equation (4 > 10) executes, the output is 0 (false). Finally, (0 && 3) runs and returns 0. (false). Associativity: Associativity example: 12 * 2 / 4Operators * and / have the same precedence in this case. "*" and "/" are both left to right associative, which means that the expression on the left is executed first and then moves to the right. As a result, the preceding expression is identical to: ((12 * 2) / 4) i.e., (12 * 2) executes first and the result will be 24 (true) then, (24 / 4) executes and the final output will be 6 (true)
|
||||||||||||||||||||||||||||||||||||||||||||||
| 24. |
What are the differences between an object-oriented programming language and object-based programming language? |
|
Answer» The FOLLOWING are the main differences between object-oriented and object-based LANGUAGES.
Java, C#, Smalltalk, and others are examples of object-oriented programming languages while JavaScript, VBSCRIPT, and others are examples of object-based languages. |
|
| 25. |
What makes a macro faster than a function in the C programming language? |
|
Answer» Macros are sections of code in a programme that have been given a name. The compiler substitutes this name with the real piece of code whenever it encounters this name. To define a macro, use the '#define' directive. Macros can be defined either before or within the main method. Code 1: //C#include<stdio.h> #include<conio.h> #define HRS 24 //Macro int main() { printf("%d", HRS); return 0; }Output: 24Explanation: In the above code, we defined a macro NAMED HRS to have a VALUE of 24. Now, when we call the macro in the printf function, 24 GETS printed in the output terminal. The above code can be INFERRED to be the following code without the use of macros. Code 2: //C#include<stdio.h> int hrs() { return 24; } int main() { printf("%d", hrs()); //calling return 0; }Output : 24Explanation: Here, we defined a function named HRS. When we call the HRS function in the printf function, the function returns 24 and so 24 is printed on the output terminal. Macros are pre-processed, which implies that all macros are processed before the code is compiled, and functions are processed after the code is compiled. |
|