I think its time for me to ramp up with .NET as well. I am revising my .NET notes I got few years
back.
OOPS
- Inheritance - Code reuse, Better Maintenance
- Polymorphism - Different Phases (Operator Overloading, Operator Overriding)
- Encapsulation - Ability to hide internals of an object from its users and provide interface to only those members that you want client to be able to directly manipulate
- Data Encapsulation or Information Hiding - Concealing the implementation details of a data object from the outside world
- Data Abstraction is seperation between specification of a data object and its implementation
- OOPS basics notes Link
- Abstract Class cannot be instantiated but inherited. Normally base class is declared with abstract keyword and derived class should extend abstract class and implement relevant methods. C# does not support multiple inheritance.
- Interface can be implemented but cannot be instantiated. Interface can be implemented by other classes.
- Virtual Class: There is no virtual class. It could be lingo to abstract class.
- Pure Virtual Function: Virtual function initialized to zero
- Union is a structure that reserves storage for the largest of its data members so that only one of its data members can be stored at any time. Useful in Applications where it is known that only one of many possible data items.
- Typing - Strong Typing helps detect mismatched assignment statements.
- C++ Program Data Access
- Public - Accessible anywhere in the program
- Private - Class members, functions, friend function. Accessed from within class or by a function or a class that is declared to be friend
- Protected - Within its class or subclass or friend. Data member can only be accessed from within its class or from its subclasses or by a friend
- [Refresher] - Inside Microsoft Source Code – What is .NET Framework ?
Advantages of managed code
- Platform independant
- JIT (Just in time Compilation) - Dynamically Compiles Intermediate language (MSIL) code into native code that is optimized for execution for target operating system. Intermediate code compiled into CPU dependant executable code.
Features of CLR
- Managed Code - Code which runs under CLR. Assemblies, MSIL
- Memory management
- Automatic Garbage Collection
- Security
Value Type - An instance of value type represents actual data. Stored in Stack. Value Types are Simple Data Types, Enums, Structs.
Reference Type - Instance of reference type represents pointer or reference to data. Stored in Heap. Classes, Interfaces, Arrays and Delegates are Reference Types.
Assembly - File automated on successful compilation of every .NET Application. Can be Either a DLL or Executable Code. Assembly contains Intermediate Language Code.
Boxing - Converting primitive type to reference type
UnBoxing - Reference Type to value type
int a = 10; //Value Type
object x = a; //Boxing
int z = (int)x; //Unboxing
- CLS - Common Lanuage Specification
- CLR - Part of Framework
Class Library
- Feature of .NET Framework
- Precompiled libraries
- Inbuilt methods in libraries can be used in our program
JIT - While execution runs code only for current input value
e.g if(a==10)
{
}
else
{
}
If value of a is 10 then only that part will be choosen.
- ILDASM - Intermediate Language Dis-Assembler
- ILASM - Intermediate Language Assembler
- MSIL - Microsoft Intermediate Language
More Reads
- Mutable Objects: When you have a reference to an instance of an object, the contents of that instance can be altered
- Immutable Objects: When you have a reference to an instance of an object, the contents of that instance cannot be altered
Basics of JSON from Database Basics class from Coursera
What is JSON ?
- JSON (Java Script Object Notation)
- JSON is used for data interchange
- Suitable to semi structured data
- Parsers available for JSON in different programming languages
- Based on Name/Value Pairs, Supports Arrays
- Self Describing Data, Schema Elements within data
JSON VS XML
- JSON is less complex than XML
- DTD (Document Type Descriptions, Schema) for Schema Compliance
- JSON Schema Available to specify structure
- XPATH, XQUERY available for XML querying, JSON Path in progress
SOA - Approach to integrate diverse systems. Service-oriented architecture (SOA) is an approach to loosely coupled, protocol independent, standards-based distributed computing where software resources available on the network are considered as Services.
SOA is an approach to architecture. Cloud computing is a way of deploying aspects of architecture, including SOA.Infrastructure as a Service(Managed in Cloud), Platform as a Service, Software as a Service(Application available as service)
Enterprise Service Bus (ESB) is widely used in the context of implementing an infrastructure for enabling a service-oriented architecture (SOA). Microsoft ESB Guidance uses Microsoft BizTalk Product (Messaging Architecture).
Enterprise Application - Enterprise application is a business application. They are complex, scalable, distributed, component-based, and mission-critical. Deployed across Internet/Intranet.
Data center - server farm or server cluster, also called a data center, is a collection of computer servers usually maintained by an enterprise to accomplish server needs far beyond the capability of one machine
Further Reads
How does a web service actually work ?
I got this MSDN link extremely useful.
Anatomy of an XML Web Service Lifetime.
SOA, where will BizTalk Server fit in the technology stack (from performance perspective)?
Web Service Architecture
SOAP is a simple XML-based protocol to let applications exchange information over HTTP
Biztalk Notes
Biztalk is a messaging based integration tool. It consists of several different pieces including Business Processes (Orchestrations), BAM, Rules Engines.
BizTalk Server 2006 can process two different types of schemas: XML schemas and flat-file schemas. Both types of schemas use XML Schema definition language (XSD) to define the structure of the message.
XML schema: An XML schema defines the structure of XML messages. Messages are validated against associated schema.
Flat-file schema: Uses flat-file format. Flat files can be either delimited or positional.
What is the difference between a Distinguished field and a Promoted Property?
Distinguished fields are light weight and can only be used inside an Orchestration.
Promoted Properties are defined inside a property schema, are tracking in SQL, can be tracked in HAT, and can be used for content based routing.
What is direct binding?
- Direct binding has three types: direct to message box, self correlating, and partner ports.
- Used to route message between the message box and Orchestrations without using bindings or from one Orchestration to another Orchestration.
Biztalk Web Service Support
- Consuming a Web service From Biztalk
- Publishing an orchestration as a Web service
BizTalk: Interview questions and principles
BizTalk: Questions for interview without answers
WCF: Questions for studying and interview
Interview Basics
How does http work
- Hypertext Transfer Protocol
- HTTP is a connectionless text based protocol
- The web browser connects to the web server and sends an HTTP request (via the protocol stack) for the desired web page
- The web server receives the request and checks for the desired page. If the page exists, the web server sends it. If the server cannot find the requested page, it will send an HTTP 404 error message
- The web browser receives the page back and the connection is closed
- The browser then parses through the page and looks for page elements (Ex-Images) it needs to complete the web page. For each element needed, the browser makes additional connections and HTTP requests to the server for each element.
Learnt/Reproduced from URL -
How Does the Internet Work?
TCP and HTTP, fighting each other to bring you the web
What is difference between threads and process
The major difference between threads and processes is
1. A process can contain more than one thread.
2. A process is considered as “heavyweight” while a thread is deemed as “lightweight”.
3. Modifying a main thread may affect subsequent threads while changes on a parent process will not necessarily affect child processes.
4. Threads within a process communicate directly while processes do not communicate so easily.
Reference
Link
- Threads share the address space of the process that created it; processes have their own address.
- Threads have direct access to the data segment of its process; processes have their own copy of the data segment of the parent process.
- Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with sibling processes.
- Threads have almost no overhead; processes have considerable overhead.
- New threads are easily created; new processes require duplication of the parent process.
- Threads can exercise considerable control over threads of the same process; processes can only exercise control over child processes.
- Changes to the main thread (cancellation, priority change, etc.) may affect the behavior of the other threads of the process; changes to the parent process does not affect child processes. Link
Windows Architecture - Threads Vs Process (Good Notes)
- A thread lives in a process, and executes the instructions of the program
- To be more specific, a process is a running instance of an application, together with a set of resources that are allocated to the running application.
- In short, threads, not processes, execute program code. Every process must have at least one thread
- The purpose of threads, of course, is to allow a process to maintain more than one line of execution, that is, to do more than one thing at a time
- In a single-processor environment, the CPU must provide time slices to each thread that is currently running on the system
- In a multiprocessor environment (a computer with more than one CPU), Windows NT (but not Windows 9x) can assign different threads to different processors, providing true multiprocessing
What is Recursion
Key to a recursive procedure is that with each recursive call, the problem domain must be reduced in such a way that eventually the base case is arrived at.
Without Recursion
#include<stdio.h>
void main()
{
int result;
clrscr();
printf("Hello World\n");
result = fact(5);
printf("%d",result);
}
int fact(int i)
{
int j=1;
int result=1;
for (j=1;j<i;j++)
{
result= result*j;
}
return result;
}
With Recursion
unsigned int factorial(unsigned int n)
{
if (n <= 1)
{
return 1;
}
else
{
return n * factorial(n-1);
}
}
Fibonacci Series
With Recursion
int fib(int n)
{
int x, y;
if(n<=1) return n;
x = fib(n-1);
y = fib(n-2);
return (x+y);
}
Without Recursion
int fib(int n)
{
a = 0; b = 1;
for(i=2; i <=n; i++)
{
c = a+b;
a = b;
b = c;
}
return c;
}
What is difference between Array and Linked List
- Elements can be inserted into linked lists indefinitely
- An array from which many elements are removed may become wastefully empty or need to be made smaller.
- Arrays allow random access
- Linked lists allow only sequential access to elements
Properties of Array
- Individual data items in the array are called elements
- All elements must be of same datatype
- All elements are stored contiguosly in memory
- Name of array represents address of first element of the array
Disadvantages of Array
- Fixed Lengh
- Wasted Storage
- Resizing affects performance
Advantages of Array
- Contiguous Storage
- Random Access
- Fixed length
- Easy to Implement
Passing Array Elements to a Function
a. by value - pasing values of array elements to the function
b. by reference - passing address of array elements to the function
What is difference between Stack and Array
Stack
- Ordered collection of items
- Insertion and Deletion at one end called top of stack
- Stack - Last In First Out
Application of Stacks: Recursion, Conversion of expressions, passing parameters, Text Editors
Queue:
- FIFO, Linear Data Structure
- Insertion - Rear, Deletion - Front
- Basically a line with some entities kept for service
Application of Queues: Pushing printing jobs to printer, multiprogramming
Dequeue
- Double Ended Queue
- Used in System Programming
- Element can be added and deleted at both the ends
Priority Queue
- Highest Priority removed
- Increasing Priority - Lowest element removed
- Decreasing Priority - Highest element removed
Critical section - Critical section is a piece of code that accesses a shared resource (data structure or device) that must not be concurrently accessed by more than one thread of execution. This brute-force approach can be improved upon by using semaphores. To enter a critical section, a thread must obtain a semaphore, which it releases on leaving the section.
Trees - Abstract data structures consisting of nodes and pointers
Complete Binary Tree - 0 or 2 children. Filled at level n or n-1
Application of Trees - Searching, Sorting, Efficient Network Representation
Context switch - enables multiple processes to share a single CPU resource. The context switch is an essential feature of a multitasking operating system. Multitasking, Interrupt Handling.
Binary search tree (BST) is a node-based binary tree data structure which has the following properties.
- The left subtree of a node contains only nodes with keys less than the node's key.
- The right subtree of a node contains only nodes with keys greater than the node's key.
- Both the left and right subtrees must also be binary search trees
Refresh Basics - Sorting Algorithms
Entity Framework Q&A
Behavior Driven Development using MVVM pattern and GreenPepper tests
MVC -
Basics
From
Link
Refactoring
- Rewriting, reworking, and re-architecting code is collectively known as refactoring
- Helps remove Code Duplication, Include features that would improve code/algorithm performance
- Helps Incorporate Code-Reviews comments, Validate Coding Standards and guidelines followed
Databases
Read Quote of Alex Yakunin's answer to Database Systems: How does a relational DBMS internally store its data? on Quora
What is ORM
- ORM stands for Object-Relational Mapper
- Mapping Domain model to DB Schema
- Good ORM will let you develop without knowing DB Schema
- Source - Link
Different ORM Tools Comparision
- ADO.NET Entity Framework,LINQ to SQL,BLToolkit,DataObjects.Net,LinqConnect,NHibernate,OpenAccess,Subsonic
- Source - ORMeter
Interfaces - Contains one or more methods, properties but none of them are implemented in the interface itself. Methods in the interface are abstract, they do not include implementation code.
UML - Unified Modelling Language
Use Case Diagram - Shows Actors, Use Cases and their relationships
Class Diagram - Shows classes and their relationships with each other
Bicycle Class
- Attributes - frame size, wheel size, gears, material
- Operations - shift, move, repair
Polygon Class
- Attributes - vertices, border color, fill color
- Operations - draw, erase, move
Animal Class
- Attributes - legs, hasfeathers, nightvision, canswim, gender
- Operations - fly, run, move, eat, swim
More reads -
Link1,
Link2,
Link3
All time favourite 'C & C++'
Malloc - It returns an address of type void * that points to first byte of this space. If Error is occured or no more space is available then address Zero(NULL) is returned
Calloc - Takes two arguments: number representing how many elements are to be allocated, argument specifying size of each element. All of allocated space is automatically initialized to zero
New Operator in C++ - malloc( ) always returns a pointer of type void *, the new ( ) operator returns a pointer of the type of object being allocated.
Copy constructor - constructor to handle the creation and initialization of a class instance via an existing instance is called the copy constructor
#include<iostream.h>
class date
{
int day;
int month;
int year;
public:
date(int d=0,int m=0, int y=0)
{
day = d;
month = m;
year = y;
}
//copy constructor
date(date &d)
{
day = d.day;
month = d.month;
year = d.year;
}
//overloaded assignment operator
date operator =(date d)
{
day = d.day;
month = d.month;
year = d.year;
return d;
}
void display()
{
cout<<day<<"/"<<month<<"/"<<year;
}
};
int main()
{
date d1(21,10,1980);
date d2 = d1;
date d3;
d3=d2;
d3.display();
getchar();
return 1;
}
Refreshing my basics - Java Interfaces, Lists, Arrays
Interfaces
- Declared using the interface keyword
- Defines only abstract methods and constants
- Interfaces cannot be instantiated
- class that implements an interface must implement all of the methods in Interface
Advantages - Simulate multiple inheritance
Abstract Classes
- Abstract class can define both abstract and non-abstract methods
- You can implement multiple interfaces at the same time, but only extend one class
Do's with Abstract Class
- You can call a static method on an abstract class
- You can define both abstract and non-abstract methods in abstract class
Dont's with abstract keyword
- Static, private, and final methods cannot be abstract, since these types of methods cannot be overridden by a subclass.
- Similarly, a final class cannot contain any abstract methods
Error Types (Logic Errors, Syntax Errors, Runtime Errors) -
Link1,
Link2
Basics BTree, Binary Tree
- Binary tree - A tree where each node has at most two children.
- Binary search tree - A binary tree that exhibits the following property: for any node n, every descendant node's value in the left subtree of n is less than the value of n, and every descendant node's value in the right subtree is greater than the value of n
Posting below FAQ collection I prepared couple of years back
OS Related Questions
What is deadlock and what are the necessary conditions for it to occur?
Deadlock is when all threads in a set are waiting for something that only one of the other threads in the set can cause, so none can make progress. The necessary conditions for deadlock are: mutual exclusion of resources, no preemption of resources, incremental resource acquisition, and a circular wait pattern.
How does ordered acquisition of resource types avoid deadlock? Specifically relate your answer to the necessary conditions for deadlock from above.
It eliminates the possibility of a circular waiting pattern.
What is the difference between deadlock and livelock?
In deadlock, no thread is making progress at all, since they are all waiting. In livelock, threads are making progress, but the progress isn't useful since they just keep repeating the same action(s).
What is the difference between livelock and starvation?
In livelock, threads get chosen for execution, but with starvation they are never given a chance to execute.
Difference between Quick Sort and Merge Sort
- In Merge Sort,the splitting is trivial (simply taking two halves) and the joining is hard (merging the two sorted files).
- Merge Sort is not an Inplace Algorithm
- In Quick Sort,the splitting is hard (Partitioning) and the joining is trivial (the two halves and the pivot automatically form a sorted array).
- Quick Sort is an Inplace Sort Algorithm.(i.e., it doesn't require additional temporary space to store elements as they sort,they use the space originally occupied by the elements). More Reads Link, Sorting Algorithms
More Reads
Windows Architecture Reads
Java Notes
Algorithms in C#
Happy reading!!!