Explore Courses
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Birla Institute of Management Technology Birla Institute of Management Technology Post Graduate Diploma in Management (BIMTECH)
  • 24 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Popular
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science & AI (Executive)
  • 12 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
University of MarylandIIIT BangalorePost Graduate Certificate in Data Science & AI (Executive)
  • 8-8.5 Months
upGradupGradData Science Bootcamp with AI
  • 6 months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
OP Jindal Global UniversityOP Jindal Global UniversityMaster of Design in User Experience Design
  • 12 Months
Popular
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Rushford, GenevaRushford Business SchoolDBA Doctorate in Technology (Computer Science)
  • 36 Months
IIIT BangaloreIIIT BangaloreCloud Computing and DevOps Program (Executive)
  • 8 Months
New
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Popular
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
Golden Gate University Golden Gate University Doctor of Business Administration in Digital Leadership
  • 36 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
Popular
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
Bestseller
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
IIIT BangaloreIIIT BangalorePost Graduate Certificate in Machine Learning & Deep Learning (Executive)
  • 8 Months
Bestseller
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in AI and Emerging Technologies (Blended Learning Program)
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
ESGCI, ParisESGCI, ParisDoctorate of Business Administration (DBA) from ESGCI, Paris
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration From Golden Gate University, San Francisco
  • 36 Months
Rushford Business SchoolRushford Business SchoolDoctor of Business Administration from Rushford Business School, Switzerland)
  • 36 Months
Edgewood CollegeEdgewood CollegeDoctorate of Business Administration from Edgewood College
  • 24 Months
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with Concentration in Generative AI
  • 36 Months
Golden Gate University Golden Gate University DBA in Digital Leadership from Golden Gate University, San Francisco
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Deakin Business School and Institute of Management Technology, GhaziabadDeakin Business School and IMT, GhaziabadMBA (Master of Business Administration)
  • 12 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science (Executive)
  • 12 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityO.P.Jindal Global University
  • 12 Months
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (AI/ML)
  • 36 Months
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDBA Specialisation in AI & ML
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
New
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGrad KnowledgeHutupGrad KnowledgeHutAzure Administrator Certification (AZ-104)
  • 24 Hours
KnowledgeHut upGradKnowledgeHut upGradAWS Cloud Practioner Essentials Certification
  • 1 Week
KnowledgeHut upGradKnowledgeHut upGradAzure Data Engineering Training (DP-203)
  • 1 Week
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
Loyola Institute of Business Administration (LIBA)Loyola Institute of Business Administration (LIBA)Executive PG Programme in Human Resource Management
  • 11 Months
Popular
Goa Institute of ManagementGoa Institute of ManagementExecutive PG Program in Healthcare Management
  • 11 Months
IMT GhaziabadIMT GhaziabadAdvanced General Management Program
  • 11 Months
Golden Gate UniversityGolden Gate UniversityProfessional Certificate in Global Business Management
  • 6-8 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
IU, GermanyIU, GermanyMaster of Business Administration (90 ECTS)
  • 18 Months
Bestseller
IU, GermanyIU, GermanyMaster in International Management (120 ECTS)
  • 24 Months
Popular
IU, GermanyIU, GermanyB.Sc. Computer Science (180 ECTS)
  • 36 Months
Clark UniversityClark UniversityMaster of Business Administration
  • 23 Months
New
Golden Gate UniversityGolden Gate UniversityMaster of Business Administration
  • 20 Months
Clark University, USClark University, USMS in Project Management
  • 20 Months
New
Edgewood CollegeEdgewood CollegeMaster of Business Administration
  • 23 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
KnowledgeHut upGradKnowledgeHut upGradBackend Development Bootcamp
  • Self-Paced
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 5 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
upGradupGradUI/UX Bootcamp
  • 3 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
upGradupGradDigital Marketing Accelerator Program
  • 05 Months

Top 32 Exception Handling Interview Questions and Answers in 2024 [For Freshers & Experienced]

Updated on 27 June, 2024

38.84K+ views
25 min read

Exception handling is a concept that is implemented in algorithms to handle possible runtime errors, which may disrupt the normal flow of a program. Some of the errors which can be handled using this concept are:

  • ClassNotFoundException
  • IOException
  • SQLException
  • RemoteException
  • RuntimeException:
    • ArithmeticException 
    • NullPointerException
    • NumberFormatException
    • IndexOutOfBoundsException
      • ArrayIndexOutOfBoundsException
      • StringIndexOutOfBoundsException

The merit of this implementation is to prevent a crash of the program if there is an exception while executing the program. Without Exception Handling, the program will throw an error when it encounters an exception, and the rest of the program will not be executed. However, implementing this concept will give a workaround in which the rest of the program is executed if they are independent with respect to the exception incurred. To learn more, check out our data science courses.

Check out our free courses to get an edge over the competition.

In order to understand the regularity of interview questions on exception handling interview questions in Java, one has to understand the importance the topic carries.

Check Out upGrad’s Full Stack Development Bootcamp

Minute errors from the developer’s side can significantly hamper the flow of data. For example, if there are 8 statements in a row, and the fourth statement has any error, all the statements after that will not be executed. However, if exception handling is implemented, all the other statements will be executed except for the one with an error. This is why knowing and using exception handling is so important. 

Check Out upGrad’s Python Bootcamp

Some of the main keywords that are important in learning exception handling in Java include:

Keyword Description
TRY This keyword is implemented when specifying a block, therefore, where should one place an exception code. This keyword can not be implemented alone and needs to be followed by either FINALLY or CATCH.
CATCH This keyword is used to determine what to do with the exception. Before this, the TRY block must be used. 
THROW This keyword is used to throw an exception
FINALLY This block is used to execute the necessary code for the program.

There are multiple reasons behind the occurrence of exceptions, some of which are: invalid user input, losing network connection, coding errors, disk running out of memory, any kind of device failure, etc. therefore, the chances of occurring errors or exceptions are quite high, which is why Java exception handling interview questions are pretty common in any developer job. So, make sure to prepare for these Java exception handling interview questions by clarifying concepts.

As a topic, getting exception handling in java interview questions is quite common, which makes it even more important to prepare. The exception handling in java interview questions helps the recruiter to understand the depth of knowledge of a candidate and see whether or not they can prevent and handle any undesired situation, such as crashing a program or failing requests. 

Below is a list of interview questions on exception handling in Java that can help anyone crack their dream interview. 

Read: Must Read 30 Selenium Interview Questions & Answers: Ultimate Guide

Exception Handling Interview Questions and Answers For Freshers & Beginners
1. What do you mean by an exception?

It is an abnormal condition that is sometimes encountered when a program is executed. It disrupts the normal flow of the program. It is necessary to handle this exception; otherwise,it can cause the program to be terminated abruptly.

When an error or unusual condition is detected in a code section, Python will raise an exception that can then be handled with try/except blocks. This allows the program to continue running or shut down gracefully rather than just crashing mid-execution. Handling exceptions properly is vital for writing robust programs. There’s a diverse range of built-in exception types covering everything from simple program logic errors to lower-level issues like attempting to access files that don’t exist. 

2. Explain how exceptions can be handled in Java. What is the exception handling mechanism behind the process?

There are three parts to the exception handling mechanism. These are called:

  • Try block: The section of the code which is first attempted to be executed and monitored for any exception that might occur.The try block contains the code endeavoured for execution first but is also actively monitored for any exceptions that end up being raised. Control gets immediately transferred to the associated catch block if an error or unexpected scenario occurs within that code.
  • Catch block: If any exception is thrown by the ‘try’ block, it is caught by this code section.Inside the catch block is where the just-raised exception can actually be handled. Things like logging the issue, displaying an error message to the user, or attempting corrective measures are common here before resuming application flow. Multiple catch blocks can selectively handle different types of exceptions separately.
  • Finally block: Code under this section is always executed irrespective of exceptions caught in ‘try’ block, if any. Even if there is no exception, the code under this block will be executed.The final block provides a way to execute important cleanup code, whether exceptions happened or not. For instance, it’s useful for uniform resource closing, like files or connections. The code here is guaranteed to run after the try/catch sections finish, ensuring vital post steps even after handling an issue initially.

3. Is it possible to keep other statements in between ‘try’, ‘catch’, and ‘finally’ blocks?

It is not recommended to include any statements between the sections of  ‘try’, ‘catch’, and ‘finally’ blocks, since they form one whole unit of the exception handling mechanism. 

try
{
    //Code which is monitored for exceptions.
}
//You can’t keep statements here
catch(Exception ex)
{
    //Catch the exceptions thrown by try block, if any.
}
//You can’t keep statements here
finally
{
    //This block is always executed irrespective of exceptions.
}

4. Will it be possible to only include a ‘try’ block without the ‘catch’ and ‘finally’ blocks?

This would give a compilation error. It is necessary for the ‘try’ block to be followed with either a ‘catch’ block or a ‘finally’ block, if not both. Either one of ‘catch’ or ‘finally’ blocks is needed so that the flow of exception handling is undisrupted.

The reason catch, and finally, sections are required complements the very purpose of exceptions in the first place – to handle and respond to anomalous conditions by diverting control flow away from the typical happy path. So just watching for exceptions via try without defining mitigation steps makes little sense in isolation.

Either a catch block needs to be defined for actively handling the raised exception in some chosen way – logging it, displaying an error message, etc. Or, a final block should be specified for any cleanup routines that must execute regardless of specific exceptions. Without one of these recovery blocks present, any raised exception would go entirely unaddressed.

5. Will it be possible to keep the statements after the ‘finally’ block if the control is returning from the finally block itself?

This will result in an unreachable catch block error. This is because the control will be returning from the ‘finally’ block itself. The compiler will fail to execute the code after the line with the exception. That is why the execution will show an unreachable code error. 

Dreaming to Study Abroad? Here is the Right program for you

6. Explain an unreachable catch block error.

In the case of multiple catch blocks, the order in which catch blocks are placed is from the most specific to the most general ones. That is, the sub classes of an exception should come first, and then the super classes will follow. In case that the super classes are kept first, followed by the sub classes after it, the compiler will show an unreachable catch block error.

public class ExceptionHandling
{
    public static void main(String[] args)
    {
        try
        {
            int i = Integer.parseInt(“test”);   
//This statement will throw a NumberFormatException //because the given input is string, while the //specified format is integer. 
        }
        catch(Exception ex)
        {
System.out.println(“This block handles all exception types”);
//All kinds of exceptions can be handled in this //block since it is a super class of exceptions.
        }
        catch(NumberFormatException ex)
        {
            //This will give compile time error
            //This block will become unreachable as the
//exception would be already caught by the above //catch block
        }
    }
}

 

7. Consider three statements in a ‘try’ block: statement1, statement2, and statement3. It is followed by a ‘catch’ block to catch the exceptions that occurred during the execution of the ‘try’ block. Assume that the exception is thrown at statement2. Do you think the statement3 will be executed?  

Statement3 will not be executed. If an exception is thrown by the ‘try’ block at any point, the remaining code after the exception will not be executed. Instead, the flow control will directly come to the ‘catch’ block. 

8. Differentiate error and exception in Java.

The key difference between error and exception is that while the error is caused by the environment in which the JVM(Java Virtual Machine) is running, exceptions are caused by the program itself. For example, OutOfMemory is an error that occurs when the JVM exhausts its memory.

But, NullPointerException is an exception that is encountered when the program tries to access a null object. Recovering from an error is not possible. Hence, the only solution to an error is to terminate the execution. However, it is possible to workaround exceptions using try and catch blocks or by throwing exceptions back to the caller function.

Must Read: Java Interview Questions & Answers

9. What are the types of exceptions? Explain them.

There are two types of exceptions: 

Checked Exceptions

The type of exceptions that are known and recognized by the compiler. These exceptions can be checked in compile time only. Therefore, they are also called compile time exceptions. These can be handled by either using try and catch blocks or by using a throw clause. If these exceptions are not handled appropriately, they will produce compile time errors. Examples include the subclasses of java.lang.Exception except for the RunTimeException.

Unchecked Exceptions

The type of exceptions that are not recognized by the compiler. They occur at run time only. Hence, they are also called run time exceptions. They are not checked at compile time. Hence, even after a successful compilation, they can cause the program to terminate prematurely if not handled appropriately. Examples include the subclasses of java.lang.RunTimeException and java.lang.Error.

Learn Software Engineering Courses online from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs, or Masters Programs to fast-track your career.

10. What is the hierarchy of exceptions in Java?

The java.lang.Throwable is a super class of all errors and exceptions in Java. This class extends the java.lang.Object class. The argument of catch block should be its type or its sub class type only. The Throwable class includes two sub classes:

  1. java.lang.Error : This is a super class for all error types in Java. Common errors included under this are – 
    1. java.lang.VirtualMachineError: Under this –
      1. StackOverFlowError
      2. OutOfMemoryError
    2. java.lang.AssertionError
    3. java.lang.LinkageError: Under this – 
      1. NoClassDefFoundError
      2. IncompatibleClassChangeError
  2. java.lang.Exception: This is a super class of all exception types in Java. Common exceptions under this are – 
    1. RunTimeException
      1. ArithmeticException
      2. NumberFormatException
      3. NullPointerException
      4. ArrayIndexOutOfBoundsException
      5. ClassCastException
    2. java.lang.InterruptedException
    3. java.lang.IOException
    4. java.lang.SQLException
    5. java.lang.ParseException

11. What are runtime exceptions in Java? Give a few examples. 

The exceptions that occur at run time are called run time exceptions. The compiler cannot recognise these exceptions, like unchecked exceptions. It includes all sub classes of java.lang.RunTimeException and java.lang.Error. Examples include, NumberFormatException, NullPointerException, ClassCastException, ArrayIndexOutOfBoundException, StackOverflowError etc.

upGrad’s Exclusive Software and Tech Webinar for you –

SAAS Business – What is So Different?

12. Define OutOfMemoryError in Java.

It is the sub class of java.lang.Error which is encountered when the JVM runs out of memory.

When methods in Java try to request additional memory areas like for creating large arrays or loading more application components and classes, checks occur to verify there is still sufficient unused memory for fulfilling that request based on what’s currently available to Java. If the request would exceed preset limits or usage thresholds, then the OutOfMemoryError gets thrown to indicate the request cannot succeed until more memory is freed up from existing allocations. One scenario where this occurs frequently is loading up a very large dataset that gets parsed into some in-memory data structure all at once, rather than handling it in chunks or streams.

13. Differentiate between NoClassDefFoundError and ClassNotFoundException in Java.

Both NoClassDefFoundError and ClassNotFoundException occur when a particular class is not found in run time. However, they occur under different scenarios. NoClassDefFoundError is when an error occurs because a particular class was present at compile time but it was missing at run time. ClassNotFoundException occurs when an exception is encountered for an application trying to load a class at run time which is not updated in the classpath.

Exception handling Tricky Interview Questions for Experienced
Apart from straightforward Java exception handeling interview questions one might also have to deal with a number of exception handling tricky questions. Below are examples of such.  

14. Does the ‘finally’ block get executed if either of ‘try’ or ‘catch’ blocks return the control?

The ‘finally’ block is always executed irrespective of whether try or catch blocks are returning the control or not.

Whether the try block executes fully or has an early return statement halfway through, the final steps still proceed. And whether exceptions get raised that transfer control straight to various catch blocks or even if no exceptions occur, the final logic kicks off immediately after. Any manner of early control transfer or return calls cannot override or bypass invoking the final tasks.

This unconditional guarantee ensures things like releasing external resources locked during the try block or saving data get completed reliably.

15. Is it possible to throw an exception manually? If yes, explain how.

It is possible to throw an exception manually. It is done using the ‘throw’ keyword. The syntax for throwing an exception manually is

throw InstanceOfThrowableType;

Here is an example of using the ‘throw’ keyword to throw an exception manually.

try
{
    NumberFormatException ex = new NumberFormatException(); //Here we create an object for NumberFormatException explicitly
    throw ex; //throwing NumberFormatException object explicitly using throw keyword
}
catch(NumberFormatException ex)
{
    System.out.println(“In this block, the explicitly thrown NumberFormatException object can be caught.”);
}

Read: Top 35 Spring Interview Questions & Answers: Ultimate Guide

16. What do you mean by rethrowing an exception in Java?

The exceptions which are raised in the ‘try’ block are handled in the ‘catch’ block. If the ‘catch’ block is unable to handle that exception, it is possible that it can rethrow the same exception using the ‘throw’ keyword. This mechanism is called rethrowing an exception. The implementation is as follows: 

try
{
    String s = null;
    System.out.println(s.length()); //This statement throws a NullPointerException
}
catch(NullPointerException ex)
{
    System.out.println(“Here the NullPointerException is caught”);
    throw ex; //Rethrowing the NullPointerException
}

17. Why do you use the ‘throws’ keyword in Java?

If it is possible for a method to throw an exception if it could not be handled, it should specify that exception using the ‘throws’ keyword. It will be helpful to the caller functions of that method in handling that exception. The syntax for using the ‘throws’ keyword is,

return_type method_name(parameter_list) throws exception_list
{
     //code
}
Here, exception_list is the list of exceptions which may be thrown by the method. These exceptions should be separated by commas. An example of the code : 
public class ExceptionHandling
{
    public static void main(String[] args)
    {
        try
        {
            methodWithThrows();
        }
        catch(NullPointerException ex)
        {
            System.out.println("NullPointerException thrown by methodWithThrows() method will be caught here");
        }
    }
 
    static void methodWithThrows() throws NullPointerException
    {
        String s = null;
        System.out.println(s.length()); //This statement throws NullPointerException
    }
}

18. It is often recommended to keep clean up operations like closing the DB resources inside the ‘finally’ block. Why is it necessary? 

The ‘finally’ block is always executed irrespective of the fact if exceptions are raised in the ‘try’ block or if the raised exceptions are caught in the ‘catch’ block or not. Keeping the clean up operations in ‘finally’ block ensures the operation of these operations in any case, and will not be affected by exceptions, which may or may not rise. 

19. How would you differentiate between final, finally and finalize in Java?

First, ‘final’ is a keyword that can be used to make a variable or a method or a class as unchangeable. To put it simply, if a variable is declared as final, once it is initialized, its value can not be altered. If a method is declared as final, it cannot be overridden or modified in the sub class. If a class is declared as final, it cannot be extended into further classes. 

Second, ‘finally’ is a block which is used in exception handling along with the ‘try’ and ‘catch’ blocks. This block is always executed irrespective of a raised exception or if the raised exception is handled. Usually, this block is used to perform clean up operations to close the resources like database connection, I/O resources, etc.

Third, the finalize() method is a protected method. It belongs to java.lang.Object class. Every class created in Java inherits this method. The garbage collector thread calls this method before an object is removed from the memory. Before an object is removed from the memory, this method is used to perform some of the clean-up operations.

protected void finalize() throws Throwable
{
    //Clean up operations
}

20. What are customized exceptions in java?

Exception classes can be thrown in Java as per the requirements of the program flow. These exceptions are called user-defined exceptions. They are also called customized exceptions. These exceptions must extend any one of the classes in the exceptions’ hierarchy. 

For example, this exception handling in python interview questions or exception handling java interview questions an e-commerce system may define custom OrderValueException or ProductInventoryException classes tailored to handle its unique business constraints gracefully. The custom hierarchy gives more readable context around domain issues versus general exceptions like IllegalArgumentException, which could originate from anywhere internally.

Defining these domain-specific subclasses follows a similar process to building any class in Java. One simply extends an Exception or a child-like RuntimeException, assigns suitable class properties, and implements constructors and methods for capturing details around the exceptional event.

21. How would you explain a ClassCastException in Java?

A ClassCastException in Java occurs when the code attempts to convert or cast an object of one class type to an incompatible other class type. Because objects in Java have a defined class/type that dictates their structure and available methods, arbitrary casts between two unrelated class types has the potential to fail based on those mismatches. When the JVM is unable to cast an object of one type to another type, this exception is raised. It is a RunTimeException.

To avoid this exception, awareness of assignable types and checking via instanceof statements helps validate true object compatibility rather than relying on looser reference compatibility. Additionally, minimising unnecessary casts by leveraging polymorphism or creating clean extension hierarchies prevents potential mismatches.

22. Differentiate between throw, throws and throwable in Java.

First, the keyword ‘throw’ is used to throw an exception manually in Java. Using this keyword, it is possible to throw an exception from any method or block. However, it is essential that the exception must be of type java.lang.Throwable class or it belongs to one of the sub classes of java.lang.Throwable class. 

Second, the keyword ‘throws’ is used in the method signature in Java. If the method is capable of throwing exceptions, it is indicated by this method. The mentioned exceptions are handled by their respective caller functions. It is done either by using try and catch blocks or by using the throws keyword. 

Third, the super class for all types of errors and exceptions in Java is called Throwable. It is a member of the java.lang package. The JVM or the throw statement raises only instances of this class or its subclasses. The catch block should contain only one argument and it should be of this type or its subclasses. In case customized exceptions are created, they should extend this class too. 

23. Explain the StackOverflowError in Java.

This is an error that is thrown by the JVM when the stack overflows in runtime. The stack essentially keeps track of method invocations and local variables as code gets deeper and deeper into nested method calls. As more methods run, more stack space gets consumed until it fills up completely.

This most commonly happens with recursive logic that perpetually invokes itself repeatedly without an adequate termination condition. With each stacked call added, the total footprint grows until hitting enviable capacity limits. Infinitely, recursing code is a prime offender. The error can also occasionally happen in very long-running processes that chain an extremely deep sequence of method calls through various layers to pipeline execution. Hundreds of activations pile up, draining stack reserves.

24. Is it possible to override a super class method that throws an unchecked exception with checked exceptions in the sub class?

It is not possible because if a super class method throws an unchecked exception, it will be overridden in the sub class with the same exception or any other unchecked exceptions. But, it can not be overridden with checked exceptions. There is a rule that overridden methods must conform to the same throws clause as their parent implementations when dealing with exceptions.

The reason lies in avoiding confusion for code that leverages polymorphism. If a superclass method could throw, say, an ArithmeticException, but the subclass changed it to throw IOException, any client code catching ArithmeticException would suddenly face issues with the child class breakage. Stimulating unexpected errors violates overriden method principles.

However, the inverse scenario of narrowing down broader exemptions is completely permissible. A superclass method declaring throwing Exception generally could be safely overridden to just throw an Illegal Argument Exception since that reduces the assumed risk for callers.

25. Define chained exceptions in Java.

In a program, one exception can throw many exceptions by inducing a domino effect. This causes a chain of exceptions. It is beneficial to know the location of the actual cause of the exception. This is possible with the chained exceptions feature in Java. This has been introduced since JDK 1.4. For implementation of chained exceptions in Java, two new constructors and two new methods are included in the Throwable class. These are,

Constructors Of Throwable class:

a.Throwable(Throwable cause): The cause is the exception that raises the current exception.

b.Throwable(String msg, Throwable cause): The msg string is the exception message. The exception that raises the current exception is the cause here.

Methods Of Throwable class:

a.getCause() method : The real cause of a raised exception is returned by this method.

b.initCause(Throwable cause) method : The cause of the calling exception is set by this method.  

26. Which class is defined as a super class for all types of errors and exceptions in Java?

The super class for all types of errors and exceptions is java.lang.Throwable in Java. This umbrella superclass encapsulates the core properties and behaviours shared across the hierarchy descending from it, such as traceability through stack traces and mechanics for programmatic capture/propagation. At the highest level, if anything can be “thrown” via semantics like throw new Exception() then inheritance begins from Throwable.

Its children subclasses Error and Exception exception handling interview questions in java that diverge to model two key scenarios – Errors denoting typically hardware or system failures beyond programmatic control vs recoverable Exceptions representing anomalies in application logic or user input validation. This fork separates more uncontrollable low-level problems from flow defects that are tuneable within software design.

27. What can classify as a correct combination of try, catch and finally blocks?

A combination of try and catch block.

try
{
    //try block
}
catch(Exception ex)
{
    //catch block
}
A combination of try and finally block. 
try
{
    //try block
}
finally
{
    //finally block
}
A combination of all three: try, block, finally blocks. 
try
{
    //try block
}
catch(Exception ex)
{
    //catch block
}
finally
{
    //finally block
}

28. Why do you use printStackTrace() method?

This method is used to print detailed information about the exceptions that occurred. Rather than just throwing an exception and possibly showing a high-level exception type or message, printStackTrace() outputs the full stack trace leading up to the exception being raised at runtime.

This visibility into the successive method invocations on the call stack that led to the crash proves extremely useful for tracing back to the ultimate line of code responsible for reaching the exceptional state. Developers can examine the class, method, line number and exact executable statement responsible across all stack frames involved in the exception pipeline.

Without printStackTrace() equivalent debugging information might require manual logging statements interspersed at different layers of architecture just to narrow down origins of errors.

29. What are some examples of checked exceptions?

Some examples of checked exceptions include ClassNotFoundException, SQLException, and IOException. Declaring these exception types in method signatures indicates consumers must prepare for those plausible failures with proper recovery handling through catches. Omitting declaration handling risks abrupt terminations so annotation promotes resilience. That’s why checked exceptions instil defensive coding habits accounting for fallibilities in broader environmental integrations crossing runtime boundaries. They notify callers that vigilance is advised when leveraging volatile external services. Handling ensures graceful degredation when instability inevitably arises.

30. What are some examples of unchecked exceptions?

Some examples of unchecked exceptions include NullPointerException, ArrayIndexOutOfBoundsException and NumberFormatException. Overall unchecked exceptions tend to reflect oversights in code itself rather than environmental issues. Letting these exceptions bubble up instantly exposes where added null checking, data validation or defensive input handling would prevent problems early during development. Damage control uses try/catch blocks only around call sites requiring continuity after raising exceptions.

Also Read: Must Read 47 OOPS Interview Questions & Answers For Freshers & Experienced

31.What are the two ways to handle exception?

Exception handling in Java manages runtime errors to ensure the normal flow of the program. It involves using try, catch, finally, and throw keywords. There are two ways to handle exceptions: using try-catch blocks to catch and manage exceptions directly, or using the throws keyword to pass the responsibility of handling exceptions to the calling method.

32. What are the three blocks to handle exception?

Exception handling in Java involves three blocks: the try block, which contains the code that might throw an exception; the catch block, which catches and handles the exception if it occurs; and the finally block, which contains code that is always executed after the try block, regardless of whether an exception was thrown or caught.

How to prepare for the interview?

In order to maximize your chances of being shortlisted, you need to prepare well beforehand for the interviews. Often times candidates even get rejected in their final interview round, so preparing for them will be a wiser choice. Here are some tips and advice you can make use of to better your interview preparations. 

  1. Get information regarding the interview format. There are a handful of formats that a recruiter can use in their interview process. It can be quizzes, online coding assignments,  take-home assignments or even telephonic or video-called interviews. Quizzes and assignments are often thrown at the very early stage of the interview to test the candidate’s basic technical knowledge. Interviews over call and video calls are most common and usually are held for the shortlisted candidates where the interviewer would give a problem to the candidate to solve live on various apps like CoderPad, CodePen or even Google docs. Therefore getting familiar with these platforms beforehand can be advantageous and less chaotic. 
  2. Picking a programming language and mastering it. It is not beneficial to be a jack of all trends and a master of none. Hence, choosing a specific programming language and gaining in-depth knowledge of it is always a better choice. In this manner, one can always master programming languages one by one as well. 

The most popular programming languages for coding interviews are Python, Java and C++. Try and contribute a few weeks at least to each of the languages one by one. However, if the interview is knocking on the door, focusing on the one language in which the candidate has the highest proficiency, would be better rather than learning an entirely new language at the last moment. 

3. Go through coding interviews and look for the pattern. There are some generic questions that are asked in the majority of the coding interviews. Do not skip them. There are a handful of platforms that can be used for interview preparations such as LeetCode, CodeForces etc.Finally, maintain spoken explanations expressing thoughts clearly. Frame questions for clarification gracefully. Talk through examples mapping concepts together. Use cases guide design decisions. Discuss tradeoffs conveying understanding. Essentially, practising both sound technical execution and explanation goes hand-in-hand. Interview coding resembles teaching peers just as writing good software requires conveying structure and purpose to future readers. Preparing accordingly unlocks confidence on all fronts to solve and illuminate solutions fluidly.

4.Make a study plan. As tedious as it may sound but it is the truth. Staying consistent is crucial for reaching any goal. Try and make a study plan where at least 2-3 hours daily are kept aside for repairing for the interview.Schedule out daily blocks in calendars, dedicating undivided focus to consistently practising. Vary reviews high-level architectures, studying APIs for fluency and drilling problems targeting growth areas. Trading breaths on wider fundamentals before diving deep provides structure. Sustain momentum, solving a mix of familiar and unfamiliar challenges. Review blindspots exposed; research misunderstood topics. Debrief regularly assesses growth, knowledge gaps and lingering weaknesses. Iteratively expand mastery through repetition, not intensity alone. Stay the course.

Read: Must Read Top 58 Coding Interview Questions & Answers

Wrapping up

If you’re interested to learn more about big data, check out upGrad & IIIT-B’s PG Diploma in Full-stack Software Development which is designed for working professionals and offers 500+ hours of rigorous training, 9+ projects, and assignments, IIIT-B Alumni status, practical hands-on capstone projects & job assistance with top firms.

If you are interested in learning Data Science and opt for a career in this field, check out IIIT-B & upGrad’s Executive PG Programme in Data Science which is created for working professionals and offers 10+ case studies & projects, practical hands-on workshops, mentorship with industry experts, 1-on-1 with industry mentors, 400+ hours of learning and job assistance with top firms.

Frequently Asked Questions (FAQs)

1. What is exception handling in Java?

Exception handling in Java is a mechanism that allows the program to handle runtime errors, ensuring the normal flow of the program. It involves using try, catch, finally, and throw keywords to manage and respond to different error conditions effectively.

2. Which is the best programming language for database management?

There is no conclusive answer to this topic because it depends on your organization's specific demands. SQL, Java, and Python are some of the most common database management languages. SQL is a database management language that is simple to learn and use. It also offers a lot of features that let you several different things. Java is a sophisticated programming language that can be used to build database management systems that are both robust and dependable. It has a vast user base and a large developer community that may assist you with your development efforts. Python is a flexible programming language that can be used for a wide range of tasks, including database management. It has a variety of characteristics that make it ideal for this job, including ease of use, readability, and adaptability. Python also has a big community of users and developers who can help with database management by providing support and resources.

3. Should I Become an A.I. developer or a web developer?

There is no one-size-fits-all solution to this question because the optimal choice for you will be determined by your unique abilities and interests. If you love to work with complex algorithms, though, you should work as an A.I. developer. If you want to build websites and web apps, on the other hand, you should become a web developer.

4. How can I use Ruby for A.I. development?

Ruby is a programming language that allows programmers to write clean, concise code for a wide range of applications. It has an easy-to-read and grasp syntax, making it a popular choice for both novices and experienced programmers. Ruby also has a wealth of features and capabilities, making it a versatile platform for developing complex applications. Depending on the project, the optimal technique to use Ruby for A.I. development may differ. However, popular uses of Ruby for A.I. development include natural language processing, machine learning, and data analysis.

Did you find this article helpful?

Rohan Vats

Software Engineering Manager @ upGrad. Passionate about building large scale web apps with delightful experiences. In pursuit of transforming engineers into leaders.

See More

Get Free Consultation

+91
Phone number

By clicking "Submit" you Agree toupGrad's Terms & Conditions

RELATED PROGRAMS



SUGGESTED BLOGS

How to Become a Full Stack Developer: Part 1

7.32K+

How to Become a Full Stack Developer: Part 1

It is the 21st century and the geek has inherited Earth. A Full Stack Developer has never been in greater demand. Under such circumstances, learning to build software is one of the most pragmatic things you could do to magnify your job prospects. The pay for a  full stack developer is extremely competitive. Be it in tech giants (like Google, Amazon and Facebook) or internet companies (like Flipkart, Ola and PayTm) or even IT powerhouses (like Infosys, Accenture and Wipro); they are known to occupy the top spots in the lists of best companies to work for. In short, if you’re good at what you do, there will never be a shortage of jobs or money. But financial motivation aside, there are certain unassailable benefits attached to programming. For one, as Steve Jobs had stated, it teaches you how to think. A computer is a machine with Zero IQ. Telling it what to do to ensure it acts the way you want it to, under varying circumstances, will shoot up your reasoning and analytical skills by a non-trivial amount. Check out our free courses to get an edge over the competition. Motivation To me, the most potent benefit has to be power. Programming makes you feel powerful. It gives you the ability to create anything imaginable on a computer: Music Players, Social Networking Sites, Blogs, Search Engines, Workout Assistants; you name it and you can build it. Converting design mocks into real, working apps is a euphoria I wouldn’t trade anything in the world for. Once you’ve taught yourself to program, your imagination is the only thing stopping you from creating the next big thing. Some of the greatest minds explain why you should learn to program, no matter who you are: I’m going to tell you how to go about acquiring these full stack development skills. It doesn’t matter what your college major was or the field you’re currently working in. Neither does your age or your self-perceived intellectual capability matter. Contrary to what most people think, literally anybody can program. All you need is a computer and an internet connection. Check out upGrad’s Advanced Certification in Cyber Security  That said, let’s begin our full stack journey! Step 1: Fundamentals of Computer Science Before you venture into full stack development or any of the various fields of computer science, it is imperative that you get your basics straight. Online education has been one of the biggest boons to the field of education and the art of self-learning. With the advent of universities putting up their courses online, there isn’t a dearth of quality content on any subject you could imagine yourself studying. Computer Science is no exception. I’d suggest signing up for Harvard University’s CS50: Introduction to Computer Science on edX. David Malan is one of the best instructors on the planet and his enthusiasm for the subject is sure to rub off on you by the time you’re done with the course. To give you a sort of a teaser as to what is in store, you will learn up to 5 programming languages and technologies (including C, Python and Javascript), build a stock exchange and trade stocks, build a version of Pong and program with Google Earth to take a virtual tour of Harvard’s campus, etc. Another option I’d suggest taking is the Pre-Course of IIIT-B & UpGrad PG Diploma program in Software Development. The entire program spans over 11 months, but I really like the way they have structured content to start off from the basics of computer science and then help you build your skillset when it comes to advanced concepts of full stack development. Explore our Popular Software Engineering Courses Master of Science in Computer Science from LJMU & IIITB Caltech CTME Cybersecurity Certificate Program Full Stack Development Bootcamp PG Program in Blockchain Executive PG Program in Full Stack Development View All our Courses Below Software Engineering Courses Check out upGrad’s Advanced Certification in Cloud Computing  Once you’re done with them, you’ll have a pretty good idea as to what the field of Computer Science has to offer. From here, you can dive deeper into the many branches of CS: AI and Machine Learning, Data Science, Full Stack Development, Information Security, etc. In this series of posts, however, I will only be covering a suggested path towards teaching yourself Full Stack Development. Interview with Ankit Tomar, Co-Founder & CTO, Bizongo Step 2: Data Structures and Algorithms When you become a full stack developer, it is extremely important you understand how to store a particular piece of data and how to implement a certain task in the most efficient and logical way possible. This is where Data Structures and Algorithms come in. They are the lifeblood of every branch of Computer Science in existence. How does Google Maps calculate the shortest distance to our destination? What’s behind Netflix recommending movies? How does Facebook store and render the data of its billion-plus users? The answers lie in powerful data structures and algorithms. No wonder they are the topic of choice in almost every technical interview you will ever sit in. For this step, I’d recommend going through Princeton University’s Algorithms I & II. They are taught by Robert Sedgewick, a renowned Computer Science professor. For our purposes, these courses should suffice to give us a strong understanding of how logic and structuring work in Computer Science. However, if you’d prefer to go a little deeper into the subject, I’d suggest going through Stanford’s Design and Analysis of Algorithms series of courses. Keep in mind though that the course is considerably more mathematically intensive and lays immense emphasis on proofs. But should you be able to graduate, you can consider yourself an expert on the subject. Finally, any list of resources for Algorithms would be incomplete without CLRS. Titled Introduction to Algorithms, it is the bible on the subject of algorithms. Anything that you could possibly want to know is in this book. Again, like the Stanford courses, the book is mathematically heavy and language agnostic and for our purposes, optional. Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript Step 3: User Experience and Design The final ‘prerequisite’ before we delve into full-stack web development technologies is UI and UX. Now, unless you want to be a unicorn, you will not be designing apps yourself. Rather, you will be converting design mock-ups and product descriptions into code. Nevertheless, I believe that every developer must have a rudimentary knowledge of UX/UI principles and the world of design, in general. For this, I’m going to suggest two books which are of monumental importance to the world of full stack development. The first is Steve Krug’s Don’t Make Me Think. This book will teach you the basics of UX/UI and the ability to differentiate good design from bad. The other one, The Design of Everyday Things is a book almost every designer I know swears by. It is often called the bible of design and rightly so. You will find yourself looking at the world in an entirely different way after reading this book. These two books should be enough for our purposes. The book will arm you with tools that will let you identify good design(er)s from bad. It will also help you build decent looking websites without the help of a mockup from a professional. How to Become a Full Stack Developer: Part 2 Step 4: HTML and CSS HTML and CSS are the technologies that run every single website on the internet. The HTML provides the structure. The CSS provides style. If you’ve followed the path suggested so far, you may have already been introduced and gained a basic understanding of these technologies. HTML and CSS aren’t programming languages. Their syntax is incredibly simple to grasp. However, when used incorrectly, they can wreak all sorts of havoc. It is imperative you learn how to structure and style your websites well. UpGrad & IIIT-B’s Software Development program would be mighty helpful for those who wish to learn these technologies to create engaging and responsive user interfaces. Supplement the course by going through Head First’s HTML and CSS and HTML5 Programming. The latter book will help you familiarise yourself with the HTML5 standard. In parallel, I would suggest learning about Twitter’s Bootstrap library through scores of online material available on the subject. As you progress as a developer, you will gradually realise that CSS can be complicated. Bootstrap helps us alleviate a considerable amount of that pain and helps in making the website responsive and mobile friendly. That said, always keep a CSS Reference Guide close to you. I’d recommend CSS3: The Missing Manual by David McFarland. Also, create an account on StackOverflow if you haven’t already. A considerable amount of your stylesheet code is going to be copy-pasted from this God-sent website. In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses Step 5: JS and jQuery You now know how to add structure and style to your web pages. Now, it is time to add responsiveness. Enter Javascript. Javascript, or JS, is the language of the web and the only language that every browser can parse. Its monopoly on the web makes it a mandatory skill for every full stack web developer. Even if you grow to hate it, you will have to put up with it and all its idiosyncrasies. A good place to start would be Head First’s Javascript Programming. The book provides a gentle introduction to the subject. Follow this up with Douglas Crockford’s Javascript: The Good Parts. This book will teach you to treat Javascript with the caution it deserves and the best practices while programming in it. Javascript is a tough language to master. Often, it is incredibly counterintuitive and annoying to deal with. To alleviate the world’s front-end developer’s pains, John Resig built the jQuery library. jQuery does things in a line where vanilla Javascript would have required a dozen. To maintain your sanity, it is absolutely essential that you get a strong grasp of jQuery. For this, go through Head First jQuery. To obtain mastery over the library, give jQuery: Novice to Ninja a thorough read. Congratulations! You are now a Front-end Developer. Theoretically speaking, you now have the tools to build the front-end of every website in existence. And I strongly suggest you do so in order to convince yourself of your newly found powers. Which brings me to the next step…s Step 6: Build a Website You now have the skills to build static websites. This is a good time to take on a few projects and build a website from scratch. There are many ways you could do this: If you’re in college, volunteer to build the website for a student group. Build your personal website. Put up samples of your work, social links, resume, articles, blog, etc. Apply for a freelancing job to build the frontend of a website. It can be anything, really. For instance, once I was done learning these technologies, I built a website for my college’s Dramatic Section. The website, in retrospect, was poorly structured and didn’t work on mobiles. But I learnt much more by doing that than from all the courses and books I’d gone through. Step 7: Front-end Javascript Frameworks With the advent of Single Page Applications, there has been a sudden surge in demand for front-end Javascript Frameworks. These frameworks aim at providing an MVC type of structuring on the front-end and delegate more and more backend tasks to the front-end. It is also incredibly useful in mocking the endpoints before the actual backend of the application is built. The usage of front-end frameworks like Angular and React has increased exponentially and almost every other startup uses it. So, I believe it is important you gain a rudimentary grasp of the major frontend frameworks. The most popular ones are Google’s Angular and Facebook’s React. The best place to get started with Angular would be the tutorial hosted on the official website. To gain mastery of the framework, go through Ng book 2. It’s highly recommended. As far as React is concerned, it is rapidly becoming the most popular frontend platform in the world, with a 300% rise in React developer jobs. UpGrad & IIIT-B’s Software Development program is a great platform for you to build expertise over this framework. Through the program, you would get valuable hands-on experience on React working on cool projects like creating an Instagram-lookalike or a Quora-like website on your own. Interview with Farooq Adam, Co-Founder, Fynd Conclusion So far, we’ve gone through curated lists to introduce ourselves to Computer Science, learn Data Structures and Algorithms, Design Principles and the technology stack of a front-end developer. In the next posts, I shall be covering the following: Back-end Development Mobile App Development I hope you’ve found this article useful. If there are resources or technologies I’ve left out that you feel are important, please do mention them in the comments!
Read More

by Rounak Banik

01 Dec'17
How to Become a Full-Stack Developer: Part 2

5.27K+

How to Become a Full-Stack Developer: Part 2

This is the second in a series of posts on teaching yourself programming and full-stack development. If you haven’t checked out the first part, on learning CS Fundamentals, Algorithms, Design Principles and Front-end Development, you can do so here. Check out our free courses to get an edge over the competition Motivation You now know how to build static websites using HTML, CSS, and Javascript. Although the Internet was originally designed to share static web pages, the capabilities (and expectations) of a modern web app have increased gigantically. Almost every app requires that you authenticate users, respond to them and replicate real-world scenarios as closely as possible. To do the aforementioned, you need to get data from a user (or an API), process it and produce an output. You also need to save this data and have a mechanism to identify the user the next time s/he returns to use your app. To perform these functions, our present stack isn’t enough. Interview with Ankit Tomar, Co-Founder & CTO, Bizongo Check out upGrad’s Advanced Certification in Blockchain Servers are required to process user data, store files, convert it into HTML/CSS/JS. Then, these servers serve it to the browser in a form that can be presented to the user. A database is required to store data important to your app. To program the server, we require a server-side scripting language and for the database, we require a database (duh) and a language to communicate with it. This is exactly what we’re going to do in the next steps. For the first seven, refer to the earlier post!  Learn Software Development Courses online from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs or Masters Programs to fast-track your career. Step 8: Server Side Scripting Languages As mentioned before, to program and communicate with your server, you will need to know a language it understands. Unlike front-end where Javascript is the only choice, there are a plethora of options available for you to program on the backend. The most popular ones are Java, PHP, Python, JavaScript and Ruby. PHP has its shortcomings, but it has the gentlest learning curve out of all the languages and frameworks I’ve used so far. And PHP is about coding quick (and dirty) solutions. So, in an extremely short period of time, you can build a web app to be extremely proud of. Java is a general-purpose programming language and probably the most popular language of all time. It is extremely popular for building mobile apps (on the Android platform) and used extensively in most major tech companies. Head First Java is an excellent place to learn this ubiquitous language. Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript Check out upGrad’s Advanced Certification in DevOps  To learn Python, I’d strongly recommend Zed Shaw’s Learn Python the Hard Way and Albert Sweigart’s Automate the Boring Stuff with Python. If you’ve decided to go with PHP, you can learn the basics of the language on Codecademy. You already know enough JavaScript syntax to get your hands dirty with the Node and backend JS frameworks (such as Express). I’ll cover Ruby later in conjunction with Rails as it is rarely used as a standalone language. Step 9: Learn SQL For the next step, you should probably pick up a little SQL (Structured Query Language). It is the language databases communicate with. And although you might not use it directly when you switch to using frameworks, it still helps to know how to directly communicate with your database. The good news is that SQL is incredibly easy to learn. You should be able to get a good grasp of it in a matter of hours. Head First SQL is a great resource for this purpose. How to Become a Full Stack Developer: Part 1 upGrad’s Exclusive Software Development Webinar for you – SAAS Business – What is So Different? document.createElement('video'); https://cdn.upgrad.com/blog/mausmi-ambastha.mp4   Step 10: Learn a ‘Conventional’ Full-Stack Web Framework Now is a good time to experiment with web frameworks that can do most of the lower level work for you. There isn’t a shortage of great frameworks that could cater to every purpose imaginable. Rails (written in Ruby), Spring (written in Java) and Django (written in Python) are among the popularly used frameworks today. You could take a look at Michael Hartl’s The Rails Tutorial – available for free. As far as Django is concerned, the tutorial on the official website is a good place to start. Once you feel you’re comfortable with the basics of the framework, do give Two Scoops of Django a read. It’s one of the best technology books ever. If you’ve decided to go the Spring route, I’d strongly suggest signing up for UpGrad & IIIT-B’s Software Development program. The program gives you a very holistic overview of the framework and helps you build a robust and scalable backend. Explore our Popular Software Engineering Courses Master of Science in Computer Science from LJMU & IIITB Caltech CTME Cybersecurity Certificate Program Full Stack Development Bootcamp PG Program in Blockchain Executive PG Program in Full Stack Development View All our Courses Below Software Engineering Courses Step 11: Javascript Full-Stack Frameworks and the MEAN Stack Not very long ago, Backend Development used to be based on the concept of the request-response cycle. For example, the browser sent a request and the server responded by spitting out a webpage in HTML. However, since early 2010, more and more applications have become real time. The structure of an entire web page changes without refreshing and behaves dynamically based on user input and interaction (Think chat, liking, commenting, live videos and reactions, etc.). In such a scenario, a simple request-response cycle simply isn’t enough. Therefore, there has been a recent surge of interest towards asynchronous programming and making AJAX requests the norm. Javascript Frameworks tend to excel at this. So, it makes sense to get acquainted with one of the major JS frameworks available in the market. The two most popular ones are the MEAN Stack and MeteorJS. Interview with Farooq Adam, Co-Founder, Fynd Learning MEAN is slightly more complicated due to its asynchronous nature and the callback hell Node usually tends to unleash. But now that you’re a seasoned developer, you are mature enough to deal with its idiosyncrasies. Meteor is a full-stack JS framework I’m currently experimenting with. The concept of Meteor is absolutely delightful – one framework in one language that takes care of all the components of an application (front-end, back-end, and database). However, this comes at the cost of customisation freedom. Once you’ve built something in Meteor, it is virtually impossible to change the database or the backend framework should you choose to do so. Though, I still think this is a worthwhile technology to learn. Meteor is known to be extremely powerful. It’s capable of doing things in hundreds of lines of code where other conventional frameworks would’ve required a thousand. In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses Conclusion This is the end of part 2. In this post, we’ve covered resources concerning backend development and the various full-stack technologies available. You can now proudly call yourself a full-stack developer. Congratulations! But the story of full-stack web development doesn’t end here. With the introduction of the iPhone, there has been a smartphone revolution around the globe. More and more people are shifting towards using smartphones in place of desktops. In such a scenario, it is imperative that you learn to build apps for two of the most popular platforms out there: Android and iOS. We shall be covering this in the next and final part of this series. Additionally, we shall also look into frameworks that allow us to build native apps using Javascript (Ionic, React Native, etc.). Until then, it’s goodbye. 🙂 Your comments and suggestions are welcome! Read our Popular Articles related to Software Development Why Learn to Code? How Learn to Code? How to Install Specific Version of NPM Package? Types of Inheritance in C++ What Should You Know?
Read More

by Rounak Banik

01 Dec'17
How to Become a Full-Stack Developer: Part 3

5.3K+

How to Become a Full-Stack Developer: Part 3

This post is the third and final in the series on becoming a full-stack developer. This article talks specifically about mobile app development. Read here for more on frontend and backend development. When Steve Jobs introduced the iPhone in 2007, it ushered the biggest revolution the world had witnessed since the printing press. Smartphones have managed to penetrate almost every country on the globe. Even the most impoverished seem to be in possession of one so much so that life without them seems inconceivable. Check out our free courses to get an edge over the competition Motivation There are certain apps which make sense only when running on a phone. Take Uber, for instance. Uber needs to know your exact location through GPS. An Uber app for desktop wouldn’t make much sense. Another issue is that a majority of your audience will open your app through a phone, even if it is one that has been built for browsers. In such cases, it is imperative that you ensure the experience is seamless and too much data isn’t consumed. Finally, there are subtle differences between interacting using mouse-clicks and touch. Your app must ensure that it behaves well in both scenarios. Keeping all these considerations in mind, it makes good sense to venture out of the browser and build mobile apps. This ensures that you make maximum use of the functionalities a typical smartphone has to offer while at the same time making the user experience a delight. Below are the steps to acing mobile app development. For the first part to become a full stack developer on frontend and backend development. Check out upGrad’s Advanced Certification in Blockchain Learn Software Development Courses online from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs or Masters Programs to fast-track your career. Interview with Ankit Tomar, Co-Founder & CTO, Bizongo Step 12: Choose a Platform The first step would be to choose a platform where you would like to build your application. Unless you’re part of a reasonably big team, it is extremely unlikely that you will build apps from scratch on all major platforms. The more likely scenario is that you will be coding on your favourite platform and will then simply port it over to the others. The major smartphone platforms today are iOS, Android, and Windows. They use drastically different languages and IDEs. For instance, iOS uses Swift and XCode, Android uses Java and the Android Studio and Microsoft operate with C# and Visual Studio. upGrad’s Exclusive Software Development Webinar for you – SAAS Business – What is So Different? document.createElement('video'); https://cdn.upgrad.com/blog/mausmi-ambastha.mp4   Check out upGrad’s Advanced Certification in DevOps  The market today is dominated by Android and iOS, so the choice really comes down to these two. Some things you may need to consider before making a choice is the audience share for your app. I believe it makes good business sense to build iOS apps if you’re in a First World country as Apple Devices are extremely popular there. In contrast, in a country like India, Android would be a more obvious choice as the market share for iPhones is extremely small owing to its exorbitant price. If you plan on making money from your app, keep in mind that iOS users are more likely to open their wallets for in-app purchases than their Android counterparts. This may be because iOS users usually tend to have more disposable income as compared to third world markets where Android dominates. iOS development requires you to have a Mac Development machine. Also, Apple App Store licenses retail at $99/year compared to Google Play’s one time $25 fee. In other words, iOS development is considerably more expensive. In this post, I shall cover how mobile app development is done today: Native Android Apps, Native iOS Apps and Hybrid Mobile Apps. Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript Step 13: Java and XML Java is the most popular language for Android Development (Google has recently introduced support for the Kotlin Programming language too). The founders of Android thought Java to be an appropriate choice and they have stuck to it since its inception. And if their trajectory is anything to go by, it has been nothing short of an amazing decision. The best resource to learn Java would be Head First Java. Reading this book will give you a thorough introduction to the language as well as Object Oriented Programming Principles. As far as XML is concerned, I do not think you need a concentrated tutorial on the subject. You’ve already worked extensively with a subset of XML (HTML) and you will be able to figure it out pretty quickly, even if you were to jump directly into Android development. I cannot say the same for Java. Ensure you have a good grasp of the language before venturing into Android. Step 14: Android You now have the technical know-how to build Android apps. It is time to dive deep into this revolutionary OS. Be wary though that certain Android practices differ from what you usually see on the web. The resources I’ve suggested below will ensure that your learning is not hindered by these differences. Android Programming- The Big Nerd Ranch Guide 2nd Edition is a good place to start if you know Java already. Make sure you pick up the second edition as that is the one that uses Android Studio, which is the industry standard now. The practice of building apps in Eclipse is largely outdated. Interview with Farooq Adam, Co-Founder, Fynd Explore our Popular Software Engineering Courses Master of Science in Computer Science from LJMU & IIITB Caltech CTME Cybersecurity Certificate Program Full Stack Development Bootcamp PG Program in Blockchain Executive PG Program in Full Stack Development View All our Courses Below Software Engineering Courses Step 15: iOS If you are more of an Apple aficionado and/or have decided that iOS apps make more sense to your business/career aspirations. The first step would be to acquire a Mac. XCode works only on Mac and in order to publish on the app store, you need a Mac. Sorry, VMWare. The resource I’m going to suggest for iOS is exactly the same as that for Android. Nerd Ranch has its own publication – iOS Programming: The Big Nerd Ranch Guide which deals with Swift and XCode, so that is a good place to start. Step 16: Hybrid Mobile Apps If you’re a solo developer or are working in a small team, you probably do not have the time or the resources to separately build and maintain Android and iOS Apps. To alleviate the developer’s pain of building for multiple platforms, the concept of Hybrid Mobile Apps was introduced. The concept is extremely simple and revolutionary. If you know Javascript, you already know how to build web apps. Therefore, should you have an app in JS, there must exist a framework that automatically ports your application into Android, iOS, and Windows. Incredible but true. Most hybrid frameworks achieve this using Cordova or React Native. You can think of Cordova as the bridge between browsers and the smartphone’s native hardware. It establishes a connection between the two solely using JS and helps in creating the build scripts in the native languages of each platform. Cordova based frameworks, however, are rapidly being overshadowed by Facebook’s powerhouse, React Native. The power of React Native lies in the fact that while Cordova constructs WebViews, React Native lets you build native apps that you’d build using either Java (for Android) or Swift (for iOS). In other words, Cordova is a website disguised as a mobile app, but React Native lets you build the real thing. In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses In my opinion, you can give Cordova a miss and learn React Native instead. It is an extremely great career investment to make. UpGrad & IIIT-B’s Software Development program is a great place to start your journey with this revolutionary library which has already been used by companies like Facebook, Netflix and AirBnB to design their apps. Interview with Farooq Adam, Co-Founder, Fynd Conclusion With the conclusion of hybrid apps, we come to an end of this series. In summary, these are the things we’ve covered: Computer Science Fundamentals. Data Structures and Algorithms UI/UX HTML, CSS, JS Front-End Frameworks Server-Side Scripting and Databases Full Stack Frameworks Android and iOS Hybrid Mobile Apps Read our Popular Articles related to Software Development Why Learn to Code? How Learn to Code? How to Install Specific Version of NPM Package? Types of Inheritance in C++ What Should You Know? I hope you’ve enjoyed reading this series as much as I have enjoyed writing it and more importantly, found at least some parts useful. As always, your comments and suggestions are welcome!
Read More

by Rounak Banik

01 Dec'17
Why Companies are Looking to Hire Full Stack Developers

7.11K+

Why Companies are Looking to Hire Full Stack Developers

It’s no secret that companies today are looking to hire young and talented software developers. But with so many smart developers out there, how can you set yourself apart from everyone else applying for these coveted roles? The best way to do this is to master the skills companies demand: a wide variety of programming skills. When you are learning how to develop software, you can improve your odds of getting a job by learning full stack development. In fact, Indeed ranked the Full Stack Developer role as the #1 job in 2017. Check out our free courses to get an edge over the competition. There are three main reasons why companies love to hire young full stack developers: Full stack developers can solve many problems Companies look to hire people based on what problems the candidates can solve for the company. By definition, full stack developers can work on both backend, frontend, and the protocols that connect the two; being able to create a software product end to end and independently. When you learn full stack development, you have an advantage over other job seekers as you can solve many more problems than other developers. For example, think about working at a high growth startup. Startups need developers who can work on a variety of programming projects. From user interfaces to server-side programming, to database applications, and everything in between. With only a small team, startups want to hire full stack developers who can work on many of the different software projects. As a full stack developer, you build many types of software projects that most other developers cannot. Check out upGrad’s Full Stack Development Bootcamp (JS/MERN) Even at a larger company, hiring developers with the knowledge to work on many different projects gives a manager flexibility to move people between teams as businesses constantly need change. One year, you can have a developer work on a frontend project and then you can move him to a backend project the very next year. The added flexibility makes the manager’s job much easier so they like to work with developers with a wide variety of skills. Check out upGrad’s Java Bootcamp.   How to Become a Full Stack Developer Companies love full stack developers because they can solve many different problems for the business. Companies like to hire young developers who are generalists The main reason is that companies hire young developers based on their potential rather than deep domain knowledge. Companies like to teach young developers what they want them to know. As a full stack developer, you have a broad set of technology skills that the company can help you expand further. As an entry-level developer, they don’t need you to understand every algorithm. But you need to have core programming knowledge so the company can teach you what is specific to their business. Let’s go back to the example of working at a startup. When the company is starting out, they need full stack developers to work on all layers of the development stack, but as the company grows, the developers will need to specialise. It’s easy for a full stack developer to start as a generalist and then become a specialist later as the company can hire more employees. On the other hand, it’s very difficult for a specialist to join a startup and learn to be a generalist when the company is small. Full stack developers can grow with their companies more easily than specialists can. In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses Once you know the basics and get the job, the company will invest time and money to help you expand your knowledge further. Full stack developers can become great managers and executives Companies love to promote people with a wide variety of experiences in the business. As a full stack developer, you will get a chance to work on frontend software, backend software, and all of the architecture that connects them. Through that variety of experience on different projects, you get the opportunity to learn much more than your solely backend and frontend peers. They only get a chance to learn one part of the company’s technology architecture, but you learn the whole architecture and understand how it all fits together. That puts you in a great opportunity to rise through the technology ranks of the company and get promoted. If you work at a startup, your experience as a full stack developer can help set you apart from your peers as the company grows. Where some developers only know how one part of the technology stack works, you understand how all aspects of the technology fit together. As more developers are hired and new technology teams form, you are more likely to manage those new teams because of your wide knowledge. At a large company, you may also get more chances for promotion. When companies look to promote from within, they need people who can manage cross-functional software teams. As a full stack developer, you will know how to talk to developers from both frontend and backend teams. How to Succeed in Your First Software Development Job Of course, technology skills are not the only ones needed to get you a promotion. You will also need to learn business skills to be a manager. But if you do that you can climb high up the corporate ladder. Looking to become a full stack developer? This article does a great job explaining how to get started: How to become a full stack developer. Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript Enroll in Software Engineering Courses from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs, or Masters Programs to fast-track your career.
Read More

by Gopi Vajravelu

31 Jan'18
What is Test-driven Development: A Newbie’s Guide

5.53K+

What is Test-driven Development: A Newbie’s Guide

Programmers and bugs have been in a never-ending fight for supremacy since time unknown. It’s unavoidable – even the best programmers fall prey to bugs. No code is truly safe from bugs, that’s why we perform testing. Programmers, at least the sane ones, test their code by running it on development machines to make sure it does what it was meant to do. Traditionally, test cases were written after writing the code, but in Test-driven Development, an automated test case is written before writing any piece of code so that the execution and testing can be checked simultaneously. In this article, we’ll be talking about Test-Driven Development in depth and why is it better than the traditional methods! Check out our free courses to get an edge over the competition   What is Test-Driven Development? Test-Driven Development was created as part of the Extreme Programming (XP) methodology and was called the ‘Test-First’ concept. Test-driven development allows you to test your code thoroughly, and also enables you to retest your code quickly and easily since it’s automated. In essence, before writing any piece of code, the programmer first creates a unit-test. Then, the programmer creates just enough code to satisfy the unit-test. Once the test is passed and the code refactored, the programmer can go ahead with making further improvements. Test-driven development makes sure that the code is thoroughly tested which leads to a modularized, extensible, and flexible code. Each time a new feature is to be added, it needs to undergo what is called the “lifecycle” of TDD. Let’s talk more about this lifecycle. Check out upGrad’s Advanced Certification in DevOps How to Become a Full Stack Developer Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript Test-Driven Development Lifecycle The test-driven development lifecycle covers everything from writing the initial unit-test to reworking the code. Add a test: Every new feature needs to undergo a test before its implemented. The essential requirement for writing a test is to have a clear understanding of all the requirements. This is accomplished using use-cases and user-stories.   Run all tests and check the net test: This is done to ensure the correct working of our test. Basically, this phase aims to check that the test is not passed by any code that doesn’t meet the requirements. By doing so, this step eliminates the possibility of having a faulty test at hand.   Write code: Now that you have your test in place, the next obvious step is to write a code that clears the test. This code need not be perfect in all aspects, but it needs to clear the test. Once we’re sure this code clears the test, it can be modified as per the requirements.   Run the tests: Having written the code, now it’s time to see if the code passes the test or not. If your code passes the tests, it means that your code meets the requirements – till now.   Refactor the code: This is essentially done to clean up the code. Refactoring doesn’t cause damage to any of the functionalities; it is just for cleaning the code by removing duplication between test code and production code.   Repeat: This cycle is now repeated with a fresh test to add more functionalities. Each functionality undergoes the same cycle. Essentially, the size of steps should be not more than 1-10 edits between each test run. If a code doesn’t pass the test rapidly, the developer must revert and not debug excessively. Check out upGrad’s Full Stack Development Bootcamp (JS/MERN)  Why Companies are Looking to Hire Full Stack Developers Explore our Popular Software Engineering Courses Master of Science in Computer Science from LJMU & IIITB Caltech CTME Cybersecurity Certificate Program Full Stack Development Bootcamp PG Program in Blockchain Executive PG Program in Full Stack Development View All our Courses Below Software Engineering Courses The Pros and Cons of Test-Driven Development Test-driven development has some definite pros over traditional methods of testing – which were mostly manual. However, it’s not infallible. Just like any other technology, the test-driven development also has a set of cons. Let’s have a look at what are the benefits of TDD in detail: Writing small tests ensures modularity of your code. Practicing TDD helps you understand the underlying principles of good modular design.   TDD provides clarity during the implementation of your code which enables a safety-net during the refactoring phase.   With TDD, collaborating is a lot easier as now people can edit the code with confidence because the test will inform them if their changes are not up to the mark of the test.   The base of TDD is unit-tests. Because of that, refactoring is a whole lot easier and faster. Refactoring an old code is a pain, but if the code is backed by unit tests, it becomes so much easier.   It helps in clarifying all the requirements before you begin the coding part. This way, a lot of ambiguity that can arise later on is avoided.   Test-driven development focuses on testing while writing. This forces the programmer to make their interfaces clean enough to pass the test. It’s hard to understand this advantage until you work on a piece of code that hasn’t undergone TDD.   Silly mistakes are caught almost immediately. It helps in removal of those mistakes that would waste a lot of time if found in QA. In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses Now, let’s have a look at what are the limitations of test-driven development: The test suite that’s used for testing needs to be maintained else the tests may not be fully deterministic.   The tests are hard to write – especially beyond the unit-testing phase.   TDD does slow down the pace of development, at least initially.   Like with any form of development, there’s a big difference between just doing it and doing it well. Writing good unit tests requires a level of specialty.   It’s difficult to apply this approach to your legacy(existing) code.   TDD requires you to perform routine housekeeping. It’s necessary to refine the tests to make them run more quickly.   It’s easy to get distracted by the fancy features in any unit-testing framework, but it should be kept in mind that simple tests tend to give the best results.   Unless everyone on the team correctly maintains their tests, the whole system can quickly degrade. How to Succeed in Your First Software Development Job Read our Popular Articles related to Software Development Why Learn to Code? How Learn to Code? How to Install Specific Version of NPM Package? Types of Inheritance in C++ What Should You Know? In Conclusion… Test-driven development is the way forward as far as future of application development goes. There are a number of automated testing frameworks like PHPUnit, Serenity, Robot, RedWoodHQ, and many more. Pick the one that fits your need and get started with building better maintainable applications in no time!  Enroll in Software Engineering Courses from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs, or Masters Programs to fast-track your career.
Read More

by Arjun Mathur

12 Mar'18
A Beginner’s Guide to MVC Architecture in Java

35.67K+

A Beginner’s Guide to MVC Architecture in Java

If you’re related to web development scene, you’ll most certainly have come across the acronym “MVC” hundreds of time, if not more. MVC is one of the most talked about design patterns in the web programming world today, and rightly so. In this article, we’ll take you through the world of MVC Architecture. We’ll talk about the basics of MVC, its advantages, and finally, a simple code that will help you understand the implementation of MVC in Java in a clearer way. What exactly is the MVC architecture? Before we get into the technicalities of it, let’s make some things clear – MVC is NOT a design pattern, it’s a way to structure your applications. In recent years, the web applications are extensively using the MVC architecture, and hence it’s natural to confuse it for a design pattern exclusive for web applications. However, let’s tell you that MVC was first described way back in 1979 – before the WWW era when there was no concept of web applications. The architecture used today for web applications is an adaptation of the original pattern. In fact, this architecture was initially included in the two major web development frameworks – Struts and Ruby on Rails. These two environments paved the way for a majority of web frameworks that came later – and thus the popularity of this architecture kept rising. Learn to build applications like Swiggy, Quora, IMDB and more MVC architectural pattern follows an elementary idea – we must separate the responsibilities in any application on the following basis: Model: Handles data and business logic. View: Presents the data to the user whenever asked for. Controller: Entertains user requests and fetch necessary resources. Each of the components has a demarcated set of tasks which ensures smooth functioning of the entire application along with complete modularity. Let us have a look at each of these components in further detail. Check out our free courses to get an edge over the competition. Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript upGrad’s Exclusive Software and Tech Webinar for you – SAAS Business – What is So Different? document.createElement('video'); https://cdn.upgrad.com/blog/mausmi-ambastha.mp4   Controller The controller is the like the housekeeper of the application – it performs coordination between model and view to entertain a user request. The user requests are received as HTTP get or post request – for example, when the user clicks on any GUI elements to perform any action. The primary function of a controller is to call and coordinate with the model to fetch any necessary resources required to act. Usually, on receiving a user request, the controller calls the appropriate model for the task at hand. Check out upGrad’s Full Stack Development Bootcamp (JS/MERN) Model The model is quite simply the data for our application. The data is “modelled” in a way it’s easy to store, retrieve, and edit. The model is how we apply rules to our data, which eventually represents the concepts our application manages. For any software application, everything is modelled as data that can be handled easily. What is a user, a book, or a message for an app? Nothing really, only data that must be processed according to specific rules. Like, the date must not be higher than the current date, the email must be in the correct format, the name mustn’t be more than “x” characters long, etc. Check out upGrad’s Java Bootcamp Whenever a user makes any request from the controller, it contacts the appropriate model which returns a data representation of whatever the user requested. This model will be the same for a particular work, irrespective of how we wish to display it to the user. That is why we can choose any available view to render the model data. Additionally, a model also contains the logic to update the relevant controller whenever there is any change in the model’s data. Explore our Popular Software Engineering Courses Master of Science in Computer Science from LJMU & IIITB Caltech CTME Cybersecurity Certificate Program Full Stack Development Bootcamp PG Program in Blockchain Executive PG Program in Full Stack Development View All our Courses Below Software Engineering Courses View As the name suggests, the view is responsible for rendering the data received from the model. There may be pre-designed templates where you can fit the data, and there may even be several different views per model depending on the requirements. Any web application is structured keeping these three core components in mind. There may be a primary controller that is responsible for receiving all the requests and calling the specific controller for specific actions. Let’s understand the working of a web application under the MVC architecture better using an example. Let’s See an Example Let’s take an example of an online stationery shop. The user can view items, buy, add items to cart, add items to current order, or even add/remove items (if he’s the admin). Now, let’s see what will happen when a user clicks on the title “Pens” to see the list of pens. Our application will have a particular controller to handle all the queries related to pens. Let’s say it’s called “pens_controller.php”. We’ll also have a model that will store the data regarding the pens we have – let’s call it “pens_model.php”. Finally, we’ll have several views to present the data – a list of pens, a table displaying pens, a page to edit the list, etc. The following figure shows the complete flow of control right from the moment a user clicks on “pens”, to when the result is rendered in front of him: First, the “pens_controller.php” handles the user request (1) as a GET or POST request. We can also have an “index.php” which is the central controller which will call the “pens_controller” whenever needed. The controller then examines the request and the parameters and calls the required model – in this case, “pens_model.php”. The controller asks the model to return the list of available pens (2). Now, the model searches the database for the necessary information (3), applies logics if necessary, and returns the data to the controller(4). The controller then picks an appropriate view (5) and presents the data (6 and 7). If a request comes from a handheld device, a view suitable for it will be used, or if the user has a particular theme selected, its view will be picked – and so on. How to Become a Full Stack Developer The Advantages of the MVC Architecture A common problem faced by application developers these days is the support for different type of devices. The MVC architecture solves this problem as developers can create different interfaces for different devices, and based on from which device the request is made, the controller will select an appropriate view. The model sends the same data irrespective of the device being used, which ensures a complete consistency across all devices. The MVC separation beautifully isolates the view from the business logic. It also reduces complexities in designing large application by keeping the code and workflow structured. This makes the overall code much easier to maintain, test, debug, and reuse. In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses A Simple Implementation of MVC using Java We will have the following three: StudentObject : the model.   StudentView: view class to print details on the console.   StudentController: a controller that stores data in studentObject and updates StudentView accordingly Step 1: Create the Model public class Student {   private String rollNo;   private String name;      public String getRollNo() {      return rollNo;   }      public void setRollNo(String rollNo) {      this.rollNo = rollNo;   }      public String getName() {      return name;   }      public void setName(String name) {      this.name = name;   } } The code is self-explanatory. It consists of functions to get/set roll number and names of the students. Let’s call it “student.java”. Step 2: Create the View public class StudentView {   public void printStudentDetails(String studentName, String studentRollNo){      System.out.println("Student: ");      System.out.println("Name: " + studentName);      System.out.println("Roll No: " + studentRollNo);   } } This is simply to print the values to the console. Let’s call this “studentView.java”. Step 3: Create the Controller public class StudentController {   private Student model;   private StudentView view;   public StudentController(Student model, StudentView view){      this.model = model;      this.view = view;   }   public void setStudentName(String name){      model.setName(name);   }   public String getStudentName(){      return model.getName();   }   public void setStudentRollNo(String rollNo){      model.setRollNo(rollNo);   }   public String getStudentRollNo(){      return model.getRollNo();   }   public void updateView(){      view.printStudentDetails(model.getName(), model.getRollNo());   } } Call this “StudentController.java”. A cursory glance will tell you that this controller is just responsible for calling the model to get/set the data, and then updating the view. Now, let’s have a look at how all of this is tied together. Step 4: Create the main Java file public class MVCPatternDemo {   public static void main(String[] args) {      //fetch student record based on his roll no from the database      Student model  = retriveStudentFromDatabase();      //Create a view : to write student details on console      StudentView view = new StudentView();      StudentController controller = new StudentController(model, view);      controller.updateView();      //update model data      controller.setStudentName("John");      controller.updateView();   }   private static Student retriveStudentFromDatabase(){      Student student = new Student();      student.setName("Robert");      student.setRollNo("10");      return student;   } } This is called “MVCPatternDemo.java”. As you can see, it fetches the student data from the database or a function (in this case we’re using a function to set the values) and pushes it on to the Student model. Then, it initialises the view we had created earlier. Further, it also initialises our controller and binds it to the model and the view. The updateView() method is a part of the controller which updates the student details on the console. Step 5: Test the Result If everything goes right, the result should be: Student: Name: Robert Roll No: 10 Student: Name: John Roll No: 10 If you get this as the output, congratulations! You’ve successfully implemented the MVC architecture using Java, albeit for a simple application. However simple, this application is enough to demonstrate the powers of the MVC architecture. 15 Must-Know Spring MVC Interview Questions Wrapping Up… After so much said and done, it’s hard to emphasise more on the power of the MVC architecture in any web/desktop application these days. It provides an altogether new level of modularity to your code which makes it a lot more readable and maintainable. So, if you want to scale to new heights in your career as an application developer, getting hold of the MVC architecture and its working should be your top priority. Read our Popular Articles related to Software Development Why Learn to Code? How Learn to Code? How to Install Specific Version of NPM Package? Types of Inheritance in C++ What Should You Know? Enroll in Software Engineering Courses from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs, or Masters Programs to fast-track your career. Do drop by a comment and let us know how you like this article!
Read More

by Arjun Mathur

09 Apr'18
What is the Future Scope of Full Stack Developer in India?

11.36K+

What is the Future Scope of Full Stack Developer in India?

Choosing a career in the tech sector can be tricky. You wouldn’t want to choose something that’s getting obsolete. You would want to find a career option that’s in demand and will remain in demand for the coming years. With so many options available, figuring out which one to choose can also be overwhelming. One of those options is full-stack development.  Full-stack developers are experts who are familiar with both client-side and server-side programming. They perform the roles of front-end and back-end developers. While some may argue that they are no specialists, a talented full-stack developer wouldn’t have much trouble handling development projects.  But you might wonder, “What is full stack developer’s future scope?” We’ll answer that question in this article and help you understand how attractive this field is. Let’s dive in.  Check out our free courses to get an edge over the competition. Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript How Full Stack Development has Evolved You might think that full-stack development is a new term, but the concept has existed for a long time. Full-stack development has a fascinating history that goes back to the earliest days of programming. Knowing how much this field has evolved will let you get an idea of how much scope is there.  Since the beginning of software development, when there was no web or mobile programming, the role of full-stack developers has been present. In the early 80s, most of the software developers used to work alone and oversee the entire project from start to finish. Check out upGrad’s Full Stack Development Bootcamp (JS/MERN) There wasn’t much requirement of separate experts. Then the web came, and the need for specialists increased. As websites got more complex, the division between specialists also became distinct.  Things were this way in the 90s and remained this way until the mid-2000s. The term full-stack developer was coined much later, in the 2000s, when the web required the expertise of different expertise. Web applications required people to learn both client-side programming and server-side programming. And when people who studied both of these sectors entered the market, the term full stack developer arrived. Apart from that, tools and technologies that simplified the integration of client-side and server-side programming had entered the market. This helped the growth of full-stack developers.  Explore our Popular Software Engineering Courses Master of Science in Computer Science from LJMU & IIITB Caltech CTME Cybersecurity Certificate Program Full Stack Development Bootcamp PG Program in Blockchain Executive PG Program in Full Stack Development View All our Courses Below Software Engineering Courses Full Stack Scope Now Nowadays, full-stack development is in huge demand. Companies need full stack developers because of several reasons. Full-stack developers can work with multiple technologies, and so, they can handle more aspects of a project than an average programmer. Check out upGrad’s Advanced Certification in Cyber Security They cut costs for companies because they can do the work of many specialists alone. A full-stack developer is familiar with many stacks, including the MEAN stack and the LAMP stack. Their vast knowledge of multiple areas equips them to handle the unique requirements of their projects.  The average salary for full-stack developers in India is about 6.3 LPA, and it goes up to 16 LPA for experts. Companies are willing to pay handsome salaries to full-stack developers because of their unique skill sets and abilities. As a full-stack developer, you’ll have to handle both the client-side and the server-side of the application you develop. Read a detailed article about the full stack developers salary in India based on various factors. Huge Demand and Steady Growth The future of full-stack development is attractive. It looks promising because of the steady growth in demand of these professionals. There are many reasons why the demand for full-stack developers is increasing and will keep rising in the coming years. Here are some of those reasons: Smaller Teams With a full-stack developer in the team, you can keep the team short. And smaller teams have many advantages over large ones. Even Jeff Bezos believes that a small team is better than a large staff. A large team requires more communication and more resources. A large team costs more than a small group as well. As they require more communication, the chances of facing problems of miscommunication are also higher in their cases.  A full-stack developer can easily handle the work of 2-3 developers because of his/her expertise. An excellent full-stack developer can handle the requirements of both a front-end developer and a back-end developer. Due to this reason, a company can keep the teams small, avoid miscommunication, and reduce the operating costs. In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses upGrad’s Exclusive Digital Marketing Webinar for you – What’s new in Marketing? document.createElement('video'); https://cdn.upgrad.com/blog/rumi-ambastha.mp4   Adaptability Web development is a challenging field. A lot of factors are at play when you’re developing a new product. And the product’s requirements could change at any time. Maybe you found a new framework which can enhance productivity considerably. Or, maybe your team just got smaller because a member got fired. A full-stack developer is a preferred choice in such scenarios because he/she can adapt to these changes quickly.  Whether it’s taking on a new responsibility or making tweaks to the final product, full-stack developers can handle it all. Apart from that, as a full stack developer yourself, you wouldn’t have to worry about working on new projects that pose exciting challenges. After all, they are the “Jack of all Trades” of the sector.  Learn Software Development online from the World’s top Universities. Earn Executive PG Programs, Advanced Certificate Programs or Masters Programs to fast-track your career. New Technologies Development tools and software keep getting new updates for better performance. Even the programming languages get newer versions regularly to ensure they function better and cause less hassle. Most of the time, the new updates help with integrating different tools for enhanced productivity. Read: How to become a full stack developer? An average developer might have to put in a lot of effort to keep up with these new developments. He/she might not know how to approach the original subjects. On the other hand, a full stack developer has to learn the relations between different technologies beforehand. So keeping up with new updates and integrations is an easy task for him/her. Moreover, he/she would already be accustomed to learning new things about web development. That’s why they remain in huge demand. Read our Popular Articles related to Software Development Why Learn to Code? How Learn to Code? How to Install Specific Version of NPM Package? Types of Inheritance in C++ What Should You Know?   Conclusion You must’ve noticed how excellent the prospects are for full-stack developers. As companies are relying more and more on technology and the web, the demand for such experts is increasing. The full stack developer future scope is undoubtedly bright, and it’s the perfect time for anyone to learn this skill.  If you’re interested to learn more about full stack, check out upGrad & IIIT-B’s PG Diploma in Full-stack Software Development which is designed for working professionals and offers 500+ hours of rigorous training, 9+ projects and assignments, IIIT-B Alumni status, practical hands-on capstone projects & job assistance with top firms.
Read More

by Rohit Sharma

26 Jan'20
25+Questions For Your Nagios Interview

6.92K+

25+Questions For Your Nagios Interview

Are you preparing for a DevOps interview? Then you should read these Nagios interview questions and answers.  Nagios is the most popular continuous monitoring software among companies. Companies rely on constant monitoring software to highlight errors and solve problems before they become significant issues. As a DevOps professional, recruiters would expect you to be familiar with all aspects of this powerful software. We’ve compiled a list of the most important Nagios interview questions and answers to help you prepare for your job interview. Feel free to share this list with others.  Check out our free courses to get an edge over the competition. What is Nagios? Nagios is a popular open-source solution that helps in monitoring systems, networks, and applications. It’s a standard DevOps tool, which tracks all the changes taking place in the subject. In case a technical fault arises, it can send alerts to the staff and make them aware of the issue as well. This way, the problem can be solved faster and earlier without it becoming a significant issue.  Nagios provides a centralized view of the complete infrastructure and vies detailed information on its status as well. You can also mention how it benefits organizations and how you can use it to solve the numerous problems related to the specific organization. Check out upGrad’s Advanced Certification in Cloud Computing Nagios helps in understanding where the infrastructure lacks and how you can upgrade it to overcome those problems. You can also mention how it automatically solves the issues detected. Nagios enables you to monitor the whole organization, its infrastructure, and its various processes.  This should answer the question. But you can add more points such as the advantages of using Nagios, and some other applications of Nagios, if required.  Check out upGrad’s Advanced Certification in Blockchain How Nagios helps DevOps Professionals? Nagios helps DevOps problems in tracking down issues and solving them in their early stages. This software solution overlooks every aspect of the infrastructure so it can spot an error and alert the technical team quickly. This way, DevOps professionals don’t have to worry about monitoring the systems for finding problems. They can rely on Nagios to spot the same.  Explore our Popular Software Engineering Courses Master of Science in Computer Science from LJMU & IIITB Caltech CTME Cybersecurity Certificate Program Full Stack Development Bootcamp PG Program in Blockchain Executive PG Program in Full Stack Development View All our Courses Below Software Engineering Courses What are the features of Nagios? Nagios has many features.  – Its APIs enable it for monitoring various systems, infrastructures, and applications. – It has add-ons that make you aware of the aging infrastructure and help you in planning upgrades. – You have full access to its code as it is open-source software.  – Its reporting system is fast and agile. It gives you a record of all the alerts and their responses.  – You can view the entire infrastructure of your organization through Nagios while also seeing the detailed information about everything. – Nagios has a vast community of more than a million users. If you come across any problems or have any questions, you can ask them who’d be happy to help.  How does Nagios operate? You can give this explanation as to your answer: Nagios runs as a service on a server It runs plugins on the server which connect with hosts on the network You can see the detailed information of the connected host through its interface In case some issue arises, you would receive an email or another notification Nagios runs scripts at specific times and saves the results of those scripts If the results of running the scripts change, Nagios starts running other scripts  That is how Nagios operates.  What do you mean by ‘Plugins’ in Nagios? Plugins in Nagios are different scripts that check the status of a service or host. You’d run them from the command line. Nagios checks the results from its plugins to see the condition of the various hosts and services present in your network.  You can also explain why plugins are necessary for Nagios.  Nagios requires plugins to check the status of the numerous hosts and services present in a network. A plugin verifies the required host and sends the results of its check to Nagios. Nagios then processes the results and determines whether an action is needed or not.  In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses What is NRPE? NRPE enables you to run plugins on remote Unix and Linux machines. This way, Nagios can monitor local resources such as memory usage and CPU on remote components. Typically, these resources are not given to remote machines; that’s why you’d need to use NRPE.  You can also give an explanation of NRPE architecture for a more detailed answer.  NRPE contains two sections, the NRPE daemon, and the check_NRPE plugin. The former runs on a different computer while the latter remains in the local machine and has an SSL connection between the monitoring machine and the remote machine.  What is a Passive Check?  In Nagios, external processes initiate Passive checks. When they are completed, the results are sent to Nagios. Passive checks help in monitoring asynchronous services. Those services can’t be tracked without regular polling of their status. Passive checks also help Nagios in checking the status of hosts that are behind a firewall as they can’t be verified through a monitoring host.  What are the advantages of using Nagios? Nagios offers plenty of advantages to an organization.  It allows you to plan future upgrades for your existing infrastructure It ensures a technical error in your IT infrastructure has minimum impact It quickly alerts you of any new problems It allows you to monitor the entire system and infrastructure  It coordinates the responses of the technical staff It helps you find out how fast your team responds to technical problems It ensures that SLAs (Service-Level Agreements) of your organization are met What is Icinga? How is it related to Nagios? Icinga is another popular open-source software that helps in monitoring services. It was designed in 2009 to help Nagios, but it has become a separate software.  What is an Active Check? Nagios performs an Active check to poll a device or service for its status information on a scheduled basis.  Can you name a few databases which support Nagios? Many databases support Nagios. They are Oracle, Postgres, Microsoft SQL solutions, and MySQL.  What is Nagios XI? Nagios is the most trusted and most powerful monitoring software. It can help you in monitoring applications, network protocols, systems, services, and metrics. It provides you with all the advantages of Nagios (discussed above) and has a powerful performance.  Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript Is Nagios used to monitor window machines? Yes, Nagios is used to monitor window machines. You can do so by setting-up Nagios for monitoring the required window system and then add a separate server and host for performing the task.  What is OID Nagios? The Simple Network Management Protocol (aka SNMP) uses Object Identifiers for defining the Management Information Base.  What is the Nagios Network Analyzer? The network analyzer is a vital component of Nagios which checks the system for potential dangers. Its quick scan enables the admin to get the required data about the health of the system.  What are the benefits of using Nagios to monitor websites? Nagios can help you monitor websites too. It improves the website’s availability, helps you spot bugs, and you can enhance your site’s performance and avoid online security threats as well with the help of Nagios.  Is Nagios Object-oriented? If so, can you elaborate on what it means? Object-oriented means that you can produce object definitions in Nagios that are inherited from other objects. As Nagios is object-oriented, its relationship with its components remains simple without any intricate details.  Which protocols support Nagios? SMTP Monitoring, POP Monitoring, FTP Monitoring, IPMI Monitoring, DNS Monitoring, and LDAP Monitoring are some of the protocols Nagios supports.  Can you use Nagios for Cloud Monitoring? Yes, you can use Nagios for cloud monitoring. It is one of the most popular monitoring tools available in the market.  What are objects in Nagios? All elements related to the alerting logic and the monitoring process are objects in Nagios.  Name three virtualization platforms that support Nagios. Microsoft Virtual PC, Amazon EC2, and VMware are three of the most popular virtualization platforms supporting Nagios.  What are the object types in Nagios? Nagios has a variety of object types such as host groups, periods, services, hosts, contact, notifications, and commands.  What are the two-state types in Nagios? Soft states and hard states are the two primary state types in Nagios.  Which database format does Nagios support for storing data? Nagios supports the RRD database format for storing status data.  What are the sections of NDO utilities? NDO utilities include FILE2STOCK Utility, NDOMOD Event Broker Module, NDO2DB Daemon, and LOG2NDO Utility.  What are the default credentials in Nagios? The Username and Password are “nagiosadmin” in Nagios as default.  What language does Nagios core use? Nagios core uses PHP and CGI.  What are the required conditions for Nagios to check external commands? Nagios checks for external commands regularly according to the command_check_interval option. In addition to the regular checks, it also checks for external commands when an event handler is executed.  What are the differences between Passive and Active checks? It is one of the most popular Nagios interview questions, so we suggest you prepare the answer thoroughly.  The main difference between Active checks and Passive checks is that Nagios performs the former while an external application performs the latter.  Passive checks monitor services that are located behind a firewall or are asynchronous. Active tests can’t be done on those services or hosts even though Nagios performs them regularly.  How is Nagios related to DevOps? Continuous monitoring is a core component of DevOps and Nagios is a popular tool for the same.  Can you customize charts in Nagios? Yes, you can customize charts through a third-party tool such as Graphite or CACTI. What is the difference between soft and hard states in Nagios? To answer this question, you should define both of these states.  When the results of a host or service are not OK, but it has not been rechecked multiple times according to max_check_attempts, then the error is specified as a Soft error. When a host or service recovers from a Soft Error, it is called Soft Recovery. On the other hand, when the results of a host or service check are not OK even when they have been rechecked several times, according to max_check_attempts, the error is called Hard Error. Recovery from such a kind of error is called Hard Recovery.  upGrad’s Exclusive Software Development Webinar for you – SAAS Business – What is So Different? document.createElement('video'); https://cdn.upgrad.com/blog/mausmi-ambastha.mp4   Which three variables affect inheritance and recursion in Nagios? The three variables affecting recursion and inheritance are Name, Use, and Register. The name is a placeholder for other objects. Use specifies the parent object and Register can either have a value of 1 or 0. If the Register has a value of 1, it means it’s an actual object. If it has a value of 0, it means the object is only a template and isn’t a real object.  What is meant by State Stalking? Let us discuss what State Stalking is. State stalking helps in logging. With State Stalking, Nagios watches a particular service or host and log any changes it notices in the check results. You can also add that State Stalking is quite helpful in the analysis of logs. Without State Stalking, Nagios logs a check only when the state is changed between two checks.  What is Flap Detection in Nagios? When a host or service changes its state too frequently, it is called Flapping. Flapping can lead to many problems, which could, in turn, cause many recovery notifications to arise. Nagios checks if a service or host has started flapping during its status check.  Nagios checks for flapping. It does so by storing the results of the previous 21 checks of the specific service or host first. And it analyzes those results to see how frequent state changes occurred. It determines a percent state change value through that data and compares the same to flapping thresholds. When the percent state change is greater than the high threshold for flapping, the object is said to have started flapping. And when the percent state change is lower than the low threshold for flapping the object is said to have stopped flapping.  How would you explain the ‘Machine is Unreachable’ error? When Nagios fails in finding a path to a specific node, it shows this error. The node might be up, but because Nagios can’t access it, it shows the node as unreachable.  Final Thoughts We hope you found these Nagios interview questions helpful. Be sure to prepare all these questions thoroughly.  If you’re interested to learn more about Nagios, check out upGrad & IIIT-B’s PG Diploma in Full-stack Software Development which is designed for working professionals and offers 500+ hours of rigorous training, 9+ projects, and assignments, IIIT-B Alumni status, practical hands-on capstone projects & job assistance with top firms.  
Read More

by Arjun Mathur

30 Jan'20
Continuous Delivery vs. Continuous Deployment: Difference Between

6.22K+

Continuous Delivery vs. Continuous Deployment: Difference Between

Knowing the difference between continuous delivery vs continuous deployment is paramount in today’s rapidly progressing world. That is because your users should be able to update the software without much hassle.  It is something that you are aware of through your smartphone, laptop, or computer software. Software updates for a wide range of applications are a regular occurrence. Without them happening, developments cannot take place.  Check out our free courses to get an edge over the competition. So, what can you do about it? In this internet era, you should be able to meet your user’s requirements in a matter of time. When you rectify errors or issues quickly, you can retain your clients. At the same time, when you find it challenging to do so, it can cause drowning profits.  So, when you opt for the usual slow and obsolete process of finding, analyzing, and planning methods, you are well out of the market. You have lost the plot altogether. To avoid being left out in the lurch, what you require is agile development.  Check out upGrad’s Advanced Certification in Cyber Security  Opt for agile development Agile development is the process or framework where you can test, plan, and eventually implement your ideas. The best part is that you can do it immediately. Instant results are the order of the day.  Those businesses and companies that have embedded agile development into their processing plans stand to gain from it. When you can achieve continuous delivery as well as constant deployment in your solution delivery pipeline, your firm can release the updates efficiently.  For our readers, who are not aware of the difference between continuous delivery and continuous deployment, then we will try and clarify through this post. Not to mention, you will also learn how they fit into an agile environment.  When you want to understand both continuous delivery and continuous deployment, then you must first understand, continuous integration.  Check out upGrad’s Advanced Certification in Cloud Computing  It is an essential element for agile practice.  An Agile Developer knows the significance of implementing this process because it gives them the ability to manage smaller components. This way, they can design quality software. For agile concepts, all the teams know what is going on, unlike the waterfall concept.  Explore our Popular Software Engineering Courses Master of Science in Computer Science from LJMU & IIITB Caltech CTME Cybersecurity Certificate Program Full Stack Development Bootcamp PG Program in Blockchain Executive PG Program in Full Stack Development View All our Courses Below Software Engineering Courses Developers must use deployment automation tool        That is why developers must consider using automation of continuous deployment at the development stage itself. Solutions should be given to ensure that continuous integration and continuous delivery are smoothly handled through a consumption-based model. What is continuous integration? Continuous integration is a process where, several methodologies are used from several sources, automatically to integrate the code for designing and testing purposes. As a DevOps Developer, when your design code can pass the test, then it is deployed automatically.  Further testing is then conducted on your code like manual exploratory test and load test. You would be surprised to know that the process can take several days. It entirely depends on the requirements.  What is continuous delivery? Continuous delivery enables you to design a high-quality version of your code. This classic version helps you to decide when you want to release your software for your clients, based on the feedback. In most cases, the timing of the release matters depending on the market condition.  Continuous delivery vs. continuous deployment It is the main difference between continuous delivery vs continuous deployment. Continuous deployment is the process where the software to be released undergoes an automated pipeline. Developers need not worry about the release, but rather ensure that the code developed, is regularly tested, updated, and then released. More importantly, it must work fine from the client’s end.  The continuous delivery consists of a time lag before the release of the software. The product gets reviewed, and changes, if any, is done before the release. Continuous deployment involves automated testing throughout the entire process until the release of the product.  Explore Our Software Development Free Courses Fundamentals of Cloud Computing JavaScript Basics from the scratch Data Structures and Algorithms Blockchain Technology React for Beginners Core Java Basics Java Node.js for Beginners Advanced JavaScript How can you consolidate delivery and deployment to attain common goals? It is when some developers get tempted to think that continuous deployment may be advantageous for the software. It depends on the CI/CD practices implemented in your organization.  However, there are some constraints that you might want to beware of before making use of continuous deployment. Market conditions and regulatory compliances, usually restrict IT firms from making use of continuous deployment. The levels of the DevOps concepts implemented in an IT firm also dramatically influences the usage of continuous deployment.  Continuous delivery requires manual code changes, and that can delay in the deadline for deploying the code.  But, there are some benefits to using it. IT firms may want to consider using continuous delivery because of the convenience. It enables IT firms to have a competitive advantage for deploying the code, ably supported by human intelligence.  Developers can come up with many new features that can be designed and ready for implementation. It enables them to develop robust and resilient systems. What this does is, reduces the production costs, and allows developers to improve the quality of the product.  But, continuous delivery and continuous deployment may not be that relevant in some areas of work. You may not require a deployment phase when contributing to a library or designing an artifact. In-Demand Software Development Skills JavaScript Courses Core Java Courses Data Structures Courses Node.js Courses SQL Courses Full stack development Courses NFT Courses DevOps Courses Big Data Courses React.js Courses Cyber Security Courses Cloud Computing Courses Database Design Courses Python Courses Cryptocurrency Courses Likewise, many web applications do not have to come up with a design and deploy phases. These days, there is a new development for designing high-end tools for application release that can effectively manage software releases. Few of them include: Packaging of the applications  The version of the release  When updating the database  Managing the configuration of the server  Rollback and roll forward  Auditing and access for security purposes To summarise, the main difference between continuous delivery vs continuous deployment would be that continuous delivery is the ability to release a version on any platform. On the other hand, continuous deployment is your ability to deploy the versions continuously.  Both the concepts need a framework, where you can work on small, but effective changes that can be implemented immediately in the market. It would help if you learned how your updates had affected the users, in a good and bad way.  You will need to communicate with your clients to achieve what you intend to by finding out how it helped or did not help them. However, to make that, you need to bring value to your users.  upGrad’s Exclusive Software Development Webinar for you – SAAS Business – What is So Different? document.createElement('video'); https://cdn.upgrad.com/blog/mausmi-ambastha.mp4   Do you want to learn more? If you are keen on developing your DevOps skills and learning more about the continuous delivery vs continuous deployment, then we would recommend you take up courses taught from an online higher education platform.  Only a handful of these online education platforms have tie-ups and partnerships with universities like IIT Madras, IIIT-B, MICA, NMIMS, and Cambridge Judge Business School Executive Education. When they certify you, it elevates your knowledge and enables you to stand out from the crowd. The above-mentioned reasons are why an online course in full-stack software development can kickstart your career in tech, especially if you are looking to switch lanes.
Read More

by Rohit Sharma

05 Feb'20