Posts

Software Application 3-Tier Architecture

3-Tier Architecture Three-tier  is a well-established software application architecture that organises applications into three logical and physical computing tiers.  the presentation tier (user interface) the application tier (where data is processed) the data tier (where the data associated with the application is stored and managed) Benefits  of  Three-tier Architecture : Each tier of a  three-tier architecture runs on its own infrastructure, each tier can be developed simultaneously by a separate development team.   Each tier can be updated or scaled as needed without impacting the other tiers. Each tier can run on a separate operating system and server platform - e.g., web server, application server, database server - that best fits its functional requirements.   Each tier runs on at least one dedicated server hardware or virtual server, so the services of each tier can be customised and optimised without impact the other tiers.   ...

Basic Input/Output C Program

Basic Input/Output C Program Example 1. #include < stdio.h > // header file for standard input & output functions // main function of the program which execute first in every program - starting point int main () { printf ( " Hello World \n " ); // an integer variable declaration int x ;           // Read a value from standard input scanf ( " %d " , & x ); // Write value to the standard output printf ( " %d \n " , x ); // return 0 tells that program executed successfully return 0 ; } Example 2.   #include < stdio.h > int main () { int x = 5 ; printf ( " X data is= %d \n " , x ); int y = 7 ; printf ( " Y data is= %d \n " , y ); y = 50 ; printf ( " Y data is= %d \n " , y ); printf ( " Address of X is= %u \n " , & x ); return 0 ; } Note :- A variable with '&' in prefix represents the address of that variable. e...

Diamond Problem in C+

Image
Problem:  Diamond problem is the scenario in hybrid or multiple inheritance, when a derived class inherit the 2 or more classes which inherit the same base class. In this case, Derived Class 3 acquires the 2 copies of the Base Class which is inherited by the Derived Class 1 & Derived Class 2. So an ambiguous situation appear while accessing the members of the Base class by Derived Class 3. Diamond Problem in Inheritance Solution : The ambiguity in the above mentioned problem will be removed by making the Base Class virtual by using the virtual keyword while  Derived Class 1 & Derived Class 2 inherit the Base Class. It will pass a single copy to the Derived Class 3, when Derived Class 3 inherit the Derived Class 1 & Derived Class 2. // This code will explain the diamond problem by using Animal Class as Base Class. // Bird - Derived Class 1, Mammal - Derived Class 2, Bat - Derived Class 3 #include < iostream > using namespace std; class Animal { public: ...

Two Number Sum (C++) - Interview Question

Find the two numbers in a given array or vector whose sum is equal to the given target value. Return the index of two numbers, lower index value will be the Index 1 and higher will be Index2 #include < iostream > #include < vector > #include < unordered_map > using namespace std; vector < int > twoSum ( const vector < int > & A , int B ) { unordered_map < int , int > hm ; vector < int > result ; int i ; for ( i = 0 ; i < A . size (); i ++) { int diff = ( B - A [ i ]); if ( hm . find ( diff ) != hm . end ()) { if ( i < hm [ diff ]) { result . push_back ( i + 1 ); result . push_back ( hm [ diff ] + 1 ); } else { result . push_back ( hm [ diff ] + 1 ); result . push_back ( i + 1 ); } return result ; } e...

Static Data Members in C++ Classes

 Static Data Members in C++ Classes Static Data Member : It is a data member of a class that is qualified as static. The properties of a static data member is similar to that of a C static member. Characteristics of a Static Data Member or Static Member Variable : It is initialized to zero when the first object of its class is created. No other initialization is permitted. Only one copy of the that member is created for the entire class and is shared by all the objects of that class, irrespective of the number of objects created. It is visible only within the class, but its lifetime is the entire program.  Static variables are normally used to maintain values common to the entire class.  For example, cur_id is used as a static data member, that increment with the number of object of that class with "putdata()" function.

Vulnerabilities Analysis in Executable

Vulnerabilities Analysis in Executable Static and dynamic analysis are two common techniques used to identify vulnerabilities in executable files. Each approach offers unique benefits and can be used in combination to provide a comprehensive assessment of the security of an executable.

Firmware (Software for Hardware)

  Embedded Firmware Design Document Firmware  is often referred to as “software for hardware”. Firmware provides instructions to help hardware start up, communicate with other devices, and perform basic input/output tasks.  There are typically three levels of firmware: Low-level firmware: This firmware is usually stored in non-volatile memory chips like read-only memory (ROM) and one-time programmable (OTP) memory. These chips cannot be rewritten or updated, and the firmware is intrinsic to the hardware, such as a computer. High-level firmware: This firmware is deployed within flash memory chips and comes with more complex instructions that allow updates to be made. Subsystems: These are semi-independent devices that are part of a more extensive system. Firmware at this level is embedded within central processing units (CPUs), flash chips, and liquid crystal display (LCD) units. Types of firmware :  BIOS (Basic Input/Output System) :- The Basic Input/O...