Tuesday, October 31, 2017

Graph Questions

1) Let G be a weighted connected un-directed graph with distinct positive edge weights. If every edge weight is increased by the same value, then which of the following statements is/are TRUE?
P: Minimum spanning tree of G does not change
Q: Shortest path between any pair of vertices does not change
(A) P only
(B) Q only
(C) Neither P nor Q
(D) Both P and

2) 
Let G be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5, and 6. The maximum possible weight that a minimum weight spanning tree of G can have is _______

3) 
G = (V,E) is an undirected simple graph in which each edge has a distinct weight, and e is a particular edge of G. Which of the following statements about the minimum spanning trees (MSTs) of G is/are TRUE? 
I. If e is the lightest edge of some cycle in G, then every MST of G includes e
II. If e is the heaviest edge of some cycle in G, then every MST of G excludes e
(A) I only (B) II only (C) both I and II (D) neither I nor II

4)
List-I
A. Prim’s algorithm for minimum spanning tree
B. Floyd-Warshall algorithm for all pairs shortest paths
C. Mergesort
D. Hamiltonian circuit
List-II
1. Backtracking
2. Greed method
3. Dynamic programming
4. Divide and conquer
Codes:
    A B C D
(a) 3 2 4 1
(b) 1 2 4 3
(c) 2 3 4 1
(d) 2 1 3 4 

5) 
Graph - Topological Ordering


















Monday, October 23, 2017

MSDN Magazine

October 2017 Edition:
https://msdn.microsoft.com/en-us/magazine/mt826366

Septermber 2017:
https://msdn.microsoft.com/en-us/magazine/mt842553

August 2017:
https://msdn.microsoft.com/en-us/magazine/mt493452

Topics of interest:
Essential .NET - C# 7.0: Tuples Explained

July 2017:
https://msdn.microsoft.com/en-us/magazine/mt784654

Focus:
Machine Learning

June 2017:
https://msdn.microsoft.com/en-us/magazine/mt809110

Focus:
IoT
C# 

RegEx Tester

Do you want to test your regex pattern? Here you go which allows to identify whether your RegEx will work appropriately or not. It's very useful when coding with RegEx:

http://regexstorm.net/tester

Thursday, September 7, 2017

Important Concepts to know before attending Developer Interview

Important Concepts to know before attending Developer Interview

C++
- Virtual Functions
- Function Overrides
- Double pointer - Address of pointer when to use/send?
- Virtual Destructor
- How vtable works?
- Diamond Problem
- Multiple Inheritance Vs Multi-Leve Inheritance

Data Strctures
- Time Complexity
- Reverse linked list
- Cyclic or ACyclic?
- Recursive
- BST traversal: PreOrder, InOrder, PostOrder
- Which data structure when?
- Soring : Bubble
- Searching : Binary

Design patterns
- Observer
- Factory

Operating System
- Threading/Task
- Synchrnoization Objects and its uses
- Virtual Memory
- Paging / Swampping

C#
- Interface
- Boxing and UnBoxing
- LINQ using lamda
- LINQ for joins - Inner, Outer, Lefter Outer, Right Outer

Tuesday, July 25, 2017

Interview Questions - Operating System

1) What is semaphore and when will you use it?
https://stackoverflow.com/questions/34519/what-is-a-semaphore

2) What is paging in OS?

3) What is interlock and when it is used?

4) What is critical section and when it is needed?

A CRITICAL_SECTION is a synchronization primitive that can protect longer sections. It really does a lock and competing threads will be forced to wait until a thread releases ownership of the critical section. 

Critical sections are OS primitives, but they are limited to a single process. Their big brother of a critical section under Windows is a Mutex, which can be used for cross-process synchronization.

5) What is dead lock and when it will occur and how do you avoid it?

Interview Questions - Data Structures

1) Which data structure is used to implement function and why?

2) Search is faster in single linked list or double?

3) What is Order of notation?

4) You are given a bottle and asked to find out at which floor that will break in 10 story building?

5) When 2 bottles are given how do you identify the floor it breaks?

Thursday, April 27, 2017

Push Notification

People working a while in software development couldn't go without hearing the buz word '"Push Notification". Let's look about that:

What is Push Notification?
A push notification is a message that pops up on a mobile device. App publishers can send them at any time; users don't have to be in the app or using their devices to receive them.

With push notifications, you can update your users without requiring the app to run at all times or having it poll a server, potentially running down the battery. With the introduction of Firebase Cloud Messaging (FCM), Google made it a little bit easier to implement push notifications in Android apps. FCM is the new and improved version of Google Cloud Messaging (GCM) that you can use to send remote notifications to your client app. For apps that will be targeting multiple platforms or need to take advantage of advanced push operations (like segmented push), we can use FCM with Azure Notification Hubs.

Thursday, March 16, 2017

Friday, March 10, 2017

Web Application Development - At DB Side

The third part is data source/base part. The server could have DB within it or could communicate to storage at remote location.

SQL
Structured Query Language is the language to manipulate data with DB and to create/delete tables. It is supported by all RDBMS.

Oracle SQL Server
Software tool provided by Oracle enterprise to manipulate with their DB

Some Relational Data Base System (RDBMS)

  • Oracle - Most widely used DB in all platforms
  • SQL Server - Modern simplified DB from Microsoft 
  • My SQL - Open Source DB used by PHP widely

Entity Framework
Its framework available with Visual Studio to execute DB queries using LINQ. This is wrapper around SQL calls to manipulate data in RDBMS. Also, the same calls could execute on any data source.



Web Application Development - At Server Side

Data from client needs to be transferred to server. Server would manipulate data after querying with DB if required and returns the requested value to client using JSON object format.

From Visual Studio IDE, the ASP.net MVC project has to be built with front end project, server project and DB project if required in one solution. The solution has to be published to server side using ISS at server. Then, server gets all required .DLL for business logic and data access along with HTML views/pages.

When a particular URL is entered by user then using domain name, DNS does name resolution and identify the IP and port number of server and connect to fetch views and data.

C# .NET is commonly used programming language at server side.

Session
When ever we need to store persistent data across multiple pages, we can use session at server side to store the same. When network is gone, we couldn't keep this info at client side.

Quick Snap at MVC
Every URL/path business classes act as controller as per MVC pattern. The controller controls DB data rendering to Views and views data flow to DB. The controller could have multiple views which has to be returned to client at request. The manipulated data and/or user input data get stored in data base/source via controller.  

Web Application Development - At Client Side

Web Application Development is new arena for me. Being a windows native application developer, I got chance to write web app now. These are all some new stuffs in my learning pathway towards web world:
Web applications are segregated/distributed into some layers, say

  1. Client Side 
  2. Server Side
  3. DB Side

1. Client Side
Client side development mainly involves in Graphical User Interface or Web page development. Plethora of tools are used to achieve the purpose.

1.1 HTML / HTML5
Hyper Text Markup Language is introduced to define the content body of information. It uses tages to define various parts of markups. UI controls also could be marked using tags. It doesn't have much intelligence like enhancing asethetics of UI, UI event handlers...etc

1.2 CSS
Cascading Style Sheet is primarily used along with HTML to enhance the UI. It helps to align controls/layout and change background colors...etc

1.3 BootStrap
As CSS users are not having UI standards and writing CSS was little tedious, BootStrap UI framework came to picture which make front end developers life easy by providing HTML and CSS templates and wrapper class libraries.

1.4 Java Script / JQuery / Knockout JS / Angular JS
Ok, which module would take care of event handling at controls/URLs? Java Script is primarily used to handle events and send data to Server side. JQuery is successor of JavaScript. KnockOut is successor of JQuery. Currently, the most advanced version of this arena is take care by Angular JS.

Data which needs peristent storage across various pages of web Apps could use cookies to store them temporarily.


Wednesday, March 1, 2017

Observer Design Pattern

This design pattern is typically used in publisher-subscriber scenario hence it could be implemented easily with events and delegates in C#

The idea is the publisher is event owner. Subscribers are added themselves to publishers for notification. When event occured then publisher notifies about that to every registered subscribers.

Technically, publisher owns the event handler in which list of delegates of subscribers would be called. Subscribers get their event notification through predefined common protocol i.e delegate. Publisher adds list of subscribers in its multi cast delegate. The event args are passed to subscribers through event handler at publisher.

NOTE: We can't let subscriber to take ownership of delegate as they get exposed to all other subscribers and they could modify that which violates encapsulation.

Here is the demo:
https://www.codeproject.com/Tips/769084/Observer-Pattern-Csharp

Learning by Watching! - C# Videos

Tuesday, February 28, 2017

Interview Questions

1) When will you use composition and when you use inheritance?
2) What data structure have you used in CLX rule engine?
3) How do you get storage array status?
4) I have 2 threads one should print odd numbers and another should print even numbers, how would you do it?
5) What is live migration in CLX?
6) What advantages composition has than inheritance?
7) What design patterns you used in your projects?
8) What is observer pattern?
9) What is MVC?

A quick view on Design Patterns

A quick view on Design Patterns:

https://csharpdesignpatterns.codeplex.com/

Thursday, February 23, 2017

Common Type System (CTS) in .NET

Common Type System (CTS) is the powerful unified way of making all types as objects. Object is the base class for any type in C#. Object is reference type though.

Here is the quick snap of the CTS:






















C# types are broadly classified as: Value type & Reference type. This classification is based on size of types. Value types basically stores value at the given memory location (mostly in stack) whereas Reference types stores data on managed heap.

Value Types:
int
float
char
struct

Reference Types:
.NET framework class library
User defined classes, interfaces, delegates, events, array, string

C# design goal is to UNIFY every types into OBJECTS. Hence, all types are derived from System.Object. When we assign any value into object, the conversion happens IMPLICIT and the process is called BOXING.

Whereas when we try to pull data from boxed object into particular type, we need to type-cast the data into the container type which is called UN-BOXING. The type casting is much required here as the object type would have assigned any other value by any other thread.

1x1 - Java Vs JavaScript

Key differences between Java and JavaScript: Java is an OOP programming language while Java Script is an OOP scripting language. Java creates applications that run in a virtual machine or browser while JavaScript code is run on a browser only. Java code needs to be compiled while JavaScript code are all in text.

TypeScript is OO scripting on top of JS

Wednesday, February 22, 2017

Pointer Arithmetic!

Pointers are so powerful programming construct in C++. If it is used wisely then you could achieve so many things with ease; if not used correctly then you have to pay for it. Here is one worth point of note:

// Pointer arithmetic/offset works as per the element/casted element TYPE




Tuesday, February 21, 2017

.NET Framework Vs .NET Core

The .NET Framework is used to develop Windows applications using WPF and Windows Forms and Web applications using ASP.NET MVC.

.NET Core is open-source, cross-platform and supports UWP and ASP.NET Core libraries. UWP is used to build Windows 10 targeted apps and ASP.NET Core is used to build Web apps for Windows, Linux, and Mac operating systems.

Universal Windows Platform (UWP), is a platform-homogeneous application architecture created by Microsoft and first introduced in Windows 10. The purpose of this software platform is to help develop Metro-style apps that run on both Windows 10 and Windows 10 Mobile without the need to be re-written for each


A Simple Explanation on 'Internet of Things' - IoT

What is IoT?
Simply put, this is the concept of basically connecting any device with an on and off switch to the Internet (and/or to each other). This includes everything from cellphones, coffee makers, washing machines, headphones, lamps, wearable devices and almost anything else you can think of.

The relationship will be between people-people, people-things, and things-things.

How does this impact you?
Say for example you driving car and listening music and got a phone call what if your music go low automatically as soon as you connect the call and get back to original volume when you finished the call?, What if your alarm clock wakes up you at 6 a.m. and then notifies your coffee maker to start brewing coffee for you? What if your office equipment knew when it was running low on supplies and automatically re-ordered more? What if the wearable device you used in the workplace could tell you when and where you were most active and productive and shared that information with other devices that you used while working?

On a broader scale, the IoT can be applied to things like transportation networks: "smart cities" which can help us reduce waste and improve efficiency for things such as energy use; this helping us understand and improve how we work and live.

How does this impact IT sector?
IoT is expected to impact the way e-commerce companies' function, besides revolutionizing Mobility, Big Data, Analytics, Devices and Business Processes. While there will be numerous opportunities, a career in IoT will require niche skill sets. 

IT firms require integrated capabilities to handle hardware devices/sensors, embedded software, networks, web applications and application software. Knowledge of Engineering, IT and communication is essential to create a successful IoT business. Advances in wireless networking technology and increase in storage and computing power will make data analysis possible at a large scale with less cost. 

Future of IoT?
Currently, the Indian government is working on an ambitious plan to create USD 15 billion IoT industry in the next six years. With Cisco's Internet Business Solutions Group (IBSG) prediction that 50 billion devices will be connected by 2020 and with the constant increase in the Internet and smart phone usage across the globe, IoT is bound to grow and so will the job opportunities in the area.