What is UML Diagram- Unified Modelling Language?

Answer: The UML (Unified Modelling Language) Diagram is a standardized modelling language of describing, designing and documenting a software system in object-oriented software engineering. There are many UML diagrams like Class diagram, Sequence diagram & Activity diagram etc. that are used to model software system, behaviour and business processes of the system. Major goal of…

Read the full article

What are two main categories of UML diagram?

Answer: Two main categories of UML diagram are Structural and Behavioural diagrams. These diagrams explain the static and dynamic characteristics of the system. Structural diagram shows static characteristics whereas Behavioural shows dynamic. For example Structural Diagram: Class, Object & Package diagram etc. Behavioural Diagram: Use Case, Sequence & Activity diagram etc.

Write simple program to overload new and delete operator in C++

Answer includes a simple program to overload new and delete operator in C++ class with important points about overloaded new and delete. Below is the C++ code example program for overloading new and delete operator. C++ syntax for overloading new and delete is simple. The new operator will accept object size in its parameter and…

Read the full article

How does free know the size of memory to be deleted?

Answer is little bit tricky but simple to how does free know the size of memory to be deleted or deallocated?  . Elaborating interview question as, since, we only pass a pointer or address to free (void*ptr) function and not size then how does free() function in C/C++ program know the size of memory to…

Read the full article

Why you do not initialize data members when you write a class?

Answer: When we declare/write a class, there is no memory allocation happens for data members of a class, so, we cannot store data into data members. The memory gets allocated for data members only when we create objects of a class. So, initialization of the variable happens once object of the class get created. Example:…

Read the full article

What is public and private IP address? – Real Scenarios

Public and private IP address explanation with example and real time scenarios. Public IP Address: Public IP Address is the IP that is unique and visible to the world. For example, “interviewsansar.com” website has a unique public IP address. Actually, Public IP addresses are registered by Internet standards groups e.g. NIC (Network Information Centre) and…

Read the full article

What is inline function in C++? Explain with C++ code example

What is inline function in C++ with program example is frequently asked interview question. Answer of inline functions in cpp object oriented programming will include discussion of default inline functions and inline function using keyword inline in a class. NOTE: In an interview, when inline functions in a class is asked another question can be…

Read the full article

When do you use inline function in C++ project?

Answer: In the following scenarios we should use inline functions in C++ programming. When to Use Inline function in C++: 1) When the member functions are very small e.g. only returning value or having very small statements then we should use inline member function in C++ class. As they are not taking much space and…

Read the full article

Due to memory leak in C C++ project what issue you have faced

Answer includes the issues occur due to memory leak in C,C++ project. This is a very important technical interview question asked for any languages i.e. C, C++, Java and C# etc. that we should prepare. This answer contains issues due to memory leaks in C / C++ project I have faced. However, It is applicable to all…

Read the full article

When to Use StringBuffer and StringBuilder class in Java Programming

We should use StringBuffer for multi-threaded java program or else Stringbuilder class. The difference between StringBuffer and StringBuilder class in java is that StringBuffer is synchronized, whereas, StringBuilder is not. In multithreading application, if a buffer is shared among multiple threads, then we should consider using StringBuffer as all of its methods are synchronized and…

Read the full article