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.
- Managed Code - Code which runs under CLR. Assemblies, MSIL
- Memory management
- Automatic Garbage Collection
- Security
Reference Type - Instance of reference type represents pointer or reference to data. Stored in Heap. Classes, Interfaces, Arrays and Delegates are Reference Types.
UnBoxing - Reference Type to value type
object x = a; //Boxing
int z = (int)x; //Unboxing
- CLS - Common Lanuage Specification
- CLR - Part of Framework
- Feature of .NET Framework
- Precompiled libraries
- Inbuilt methods in libraries can be used in our program
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
- .NET interview questions from Scott Hanselman – Answers (Part 1)
- .NET interview questions from Scott Hanselman – Answers (Part 2)
- StyleCop Tutorial
- LINQ To SQL Tutorial
- Create T-SQL CASE Statements With LINQ To SQL
- 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
- 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)
- What are SOA & BPM?
- What is SOA?
- Understanding Service-Oriented Architecture
- What is an Enterprise Application
- Top Ten Questions and Answers on Data - Very good
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.
- Consuming a Web service From Biztalk
- Publishing an orchestration as a Web service
BizTalk: Questions for interview without answers
WCF: Questions for studying and interview
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.
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 is1. 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
- 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
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;
}
- 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
- 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
- Fixed Lengh
- Wasted Storage
- Resizing affects performance
- 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 functionb. 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
Queue:
- FIFO, Linear Data Structure
- Insertion - Rear, Deletion - Front
- Basically a line with some entities kept for service
Dequeue
- Double Ended Queue
- Used in System Programming
- Element can be added and deleted at both the ends
- Highest Priority removed
- Increasing Priority - Lowest element removed
- Decreasing Priority - Highest element removed
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.
- 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
Entity Framework Q&A
Behavior Driven Development using MVVM pattern and GreenPepper tests
MVC - Basics
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
- ORM stands for Object-Relational Mapper
- Mapping Domain model to DB Schema
- Good ORM will let you develop without knowing DB Schema
- Source - Link
- ADO.NET Entity Framework,LINQ to SQL,BLToolkit,DataObjects.Net,LinqConnect,NHibernate,OpenAccess,Subsonic
- Source - ORMeter
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
- Attributes - vertices, border color, fill color
- Operations - draw, erase, move
- Attributes - legs, hasfeathers, nightvision, canswim, gender
- Operations - fly, run, move, eat, swim
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
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
- 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
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.
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).
In livelock, threads get chosen for execution, but with starvation they are never given a chance to execute.
- 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
- Networks FAQ
- Discrete Structures FAQ
- Data Structures FAQ
- FAQ1, FAQ2
- Database FAQ
- Compilers FAQ
- Software Engineering FAQ
- OS FAQ
- C Interview Questions and Answers
- CS Fundamentals Notes
- Implementation of stack using linked list
- C Program to implement stack using array
- Queue operations using linked list
- Windows Architecture - The Basics
- Anatomy of a Stack Trace
- Two Minute Drill: Stack Basics
- Windows Testing - Reverse Engineering Tools
- XML parsing using SaxParser with complete code
- Using JAXB to generate XML from XSD
- Java and XML - Tutorial
- DB unit testing with dbUnit, JSON, HSQLDB and JUnit Rules
- Java Tutorials
Algorithms in C#
- Dynamic programming example with C# using Needleman Wunsch algorithm
- Prim's Algorithm For Minimum Spanning Trees
- Algorithms In C#: Depth First Paths Of Directed Graphs
- Algorithms In C#: Minimum Priority Queues
- Algorithms In C#: Directed Graphs
- Algorithms In C#: Breadth First Paths Of Directed Graphs
- Algorithms In C#: Red-Black Trees
- Algorithms In C#: Depth First Paths Of Directed Graphs
Happy reading!!!
No comments:
Post a Comment