Sunday, 22 January 2017

FTD Hyderabad | Dotnet interview | November 7 2016 | Experienced

Hi All,

I wanted to share interview questions asked at FTD Hyderabad Interview for Dot Net developer experienced candidate.

Please use the questions as reference and research the answers for self understanding
The questions are as follows


1. Introduce yourself

2. In which topics are you comfortable


C# OOPS :

1. Tell me about Hash table vs Dictionary
2.What are dey and which is faster
     Dictionary is faster as it is strongly typed
3.  What is the difference

4. Boxing and unboxing

5. Array and array list are having same number of elements or Size which is faster and why it is fast
 Array will be faster in this case when compared to ArrayList as the implementation of the arrayList in the internal side is an array. As ArrayList will allow different datatypes to save it requires boxing and unboxing which makes it slow.
 Along with that ArrayList

4.Using key usage why ?

5 Memory leakage
https://msdn.microsoft.com/en-us/library/ms998530.aspx
Run a profiler on your code.

Here are two good options:
RedGate's memory profiler
Jetbrains dotTrace

Memory leaks in .NET are not that common, but when they happen it is most commonly due to unattached event handlers. Make sure you detach handlers, before the listeners go out of scope.

Another option is if you forget to call Dispose() on IDisposable resources. This may prevent cleanup of unmanaged resources (which are not handled by GC).

6. Is Webservice method overloading possible ?  and How it can be achieved ?

The function overloading in Web Service is not as straightforward as in class. While trying to overload member function, we make two or more methods with the same name with different parameters. But this will not work in web services and will show runtime error because WSDL is not supported by the same method name
The procedure to solve this problem is very easy. Start each method with a Web Method attribute. Add Description property to add a description of web method and MessageName property to change web method name.


[WebMethod(MessageName = "<name>", Description = "<description>")]
Hide   Copy Code
namespace TestOverloadingWebService
{
    [WebService(Namespace = "http://tempuri.org/", Description=" <b> Function
    overloading in Web Services </b>")]
public class OverloadingInWebService : System.Web.Services.WebService
{
    [WebMethod(MessageName = "AddInt", Description = "Add two integer
        Value", EnableSession = true)]
    public int Add(int a, int b)
    {
        return (a + b);
    }
    [WebMethod(MessageName = "AddFloat", Description = "Add two Float 
        Value", EnableSession = true)]
    public float Add(float a, float b)
    {
        return (a + b);
    }
}
}
7. GAC What is global assembly cache

Global Assembly Cache

Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer.

Use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the Windows Software Development Kit (SDK).

Starting with the .NET Framework 4, the default location for the global assembly cache is %windir%\Microsoft.NET\assembly.
In earlier versions of the .NET Framework, the default location is %windir%\assembly.


8. What is presistent cookie

9. What are cookies

10. What is session management, how did you apply session management is your application
    
https://msdn.microsoft.com/en-us/library/z1hkazw7.aspx
Server side session
         4 types
            Application state session
Session state
Profile properties
Database support           
     Client side session
         View state
            Control state
        Hidden fields
        Cookies
       Query strings

11. How can session state is maintained in your application
12. What is client side session and server side

13. What is View bag and view data
       Which is dynamic
       viewBag.foo - dynamic
       viewData["foo"]

14. Similarities between ViewBag & ViewData , which is dynamic

Helps to maintain data when you move from controller to view. Used to pass data from controller to corresponding view. Short life means value becomes null when redirection occurs. This is because their goal is to provide a way to communicate between controllers and views. It’s a communication mechanism within the server call.
Difference between ViewBag & ViewData:

ViewData is a dictionary of objects that is derived from ViewDataDictionary class and accessible using strings as keys. ViewBag is a dynamic property that takes advantage of the new dynamic features in C# 4.0. ViewData requires typecasting for complex data type and check for null values to avoid error. ViewBag doesn’t require typecasting for complex data type

ViewData: It’s required type casting for complex data type and check for null values to avoid error.

ViewBag: It doesn’t require type casting for complex data type.

Consider the following example:

public class HomeController : Controller
{
    public ActionResult Index()
    {
        var emp = new Employee
        {
            EmpID=101,
            Name = "Deepak",
            Salary = 35000,
            Address = "Delhi"
        };

        ViewData["emp"] = emp;
        ViewBag.Employee = emp;

        return View();
    }
}
And the code for View is as follows:

@model MyProject.Models.EmpModel;
@{
 Layout = "~/Views/Shared/_Layout.cshtml";
 ViewBag.Title = "Welcome to Home Page";
 var viewDataEmployee = ViewData["emp"] as Employee; //need type casting
}

<h2>Welcome to Home Page</h2>
This Year Best Employee is!
<h4>@ViewBag.emp.Name</h4>
<h3>@viewDataEmployee.Name
-------------------------------------------------------------------------

18. Can we have catch without try and finally
19. Try and finally without Catch

try need either catch or finally for sure.
but not both catch and finally are mandatory.

20. What is deferred execution LINQ

LINQ query, you always work with objects. The object may in-process object or out-process object. Based on objects, LINQ query expression is translated and executed. There are two ways of LINQ query execution


 a . In case of differed execution,

a query is not executed at the point of its declaration. It is executed when the Query variable is iterated by using loop like as for, foreach.
DataContext context = new DataContext();
var query = from customer in context.Customers
 where customer.City == "Delhi"
 select customer; // Query does not execute here

 foreach (var Customer in query) // Query executes here
 {
 Console.WriteLine(Customer.Name);
 }
 A LINQ query expression often causes deferred execution. Deferred execution provides the facility of query reusability, since it always fetches the updated data from the data source which exists at the time of each execution.

b. Immediate Execution
In case of immediate execution, a query is executed at the point of its declaration. The query which returns a singleton value (a single value or a set of values) like Average, Sum, Count, List etc. caused Immediate Execution.
You can force a query to execute immediately of by calling ToList, ToArray methods.
DataContext context = new DataContext();
var query = (from customer in context.Customers
 where customer.City == "Delhi"
 select customer).Count(); // Query execute here
Immediate execution doesn't provide the facility of query re-usability since it always contains the same data which is fetched at the time of query declaration


22. What is routing .and Uses
  APP_sTART RouteConfig.  RegisterRoutes in RouteConfig cls.

route = {controller}/{action}/{id. optional}

WebApi.RouteConfig

  api/{controller}/{action}/{id}


23. Can we pass data from one controller to other controller
24. What are 'Action Filters'
Using an Action Filter

An action filter is an attribute. You can apply most action filters to either an individual controller action or an entire controller.


An action filter is an attribute that you can apply to a controller action -- or an entire controller -- that modifies the way in which the action is executed. The ASP.NET MVC framework includes several action filters:

OutputCache – This action filter caches the output of a controller action for a specified amount of time.

HandleError – This action filter handles errors raised when a controller action executes.

Authorize – This action filter enables you to restrict access to a particular user or role

For example, the Data controller in Listing 1 exposes an action named Index() that returns the current time. This action is decorated with the OutputCache action filter. This filter causes the value returned by the action to be cached for 10 seconds.

Listing 1 – Controllers\DataController.cs

using System;
using System.Web.Mvc;

namespace MvcApplication1.Controllers
{
     public class DataController : Controller
     {
          [OutputCache(Duration=10)]
          public string Index()
          {
               return DateTime.Now.ToString("T");

          }
     }
}




Bank Of America | BA Continnum Interview Questions 10 Janunary 2017 | Experienced

Hi All,

I wanted to share interview questions asked at Bank of America Interview for Dot Net developer experienced candidate.

Please use the questions as reference and research the answers for self understanding

The questions are as follows

Asp.net


1. How do you show diff master pages to 2 roles , admin and normal user.

2. If I miss mentioning master page will I get error , when I will get error
Is compile time error

3.Can two text box have same name in same page under 2 different controls
How will you access the values

4. How to catch exception without try catch
Is it possible

5. One page with multiple text box server side pare. How will you iterate REPEATER
and check given text in text Box

6. How will you get values from a text box and assign.

7.Validate a page using javascript
Text box text in click of button.

8.What are generics.
What is list

SQL :

9.Table with one column as dates
how to get the date diff of 12 23 34 rows etc as result table
Answer hint :
 [use self join on table and second table with first row missing]
T1  T2
1 | 2
2 |3
3 | 4


10.How to call sp in a function
Answer hint :It's not possible. but you can call a function from Stored proceure
11.How to get distinct elements wo using distinct Key.

Answer hint : by using order by and a subquery b

Thursday, 8 December 2016

Just before Factory Reset | Backup made easy

Befor any factory reset of your mobile
The first step is to backup your data.

Here are some apps that I use to back up data and make my self free from worrying about losing data.

What made me to Backup data


1. Once I lost my mobile and I lost all my data and contacts and the important notes that I wrote from long time, this made me to think that that I need to keep my data backed up every day

2. The other incident is my Android mobile got into an issue where we will not be able to use home button , incoming calls and notification menu. Then I tried to transferer the data into my PC but unfortunately USB debugging was also not functioning. So with lots of effort I finally backed up my data.

Here are some apps that can help us to stay ready with Backup.

1. Contacts +  :  This app helps us to save contacts, messages, call history and stay happy

2. Keep : this is an app by Google where the notes can be synced into cloud. You can also access your notes on desktop @ keep.google.com this was very helpful for me to keep safe of all my notes

3. WhatsApp : I use Google drive as my backup location for WhatsApp data. So once you login to new device you can backup WhatsApp chat and pictures from Google drive automatically.

You can enable backup in WhatsApp by
Settings > Chats > Chat backup > Backup

Tuesday, 6 December 2016

Moto G3 Home Button , Notifaication Bar | Recent apps | Incoming calls not functioning are Resolved



I want to share my personal experience on the issue with Moto G3 that I faced repeatedly.

The issue is like :

1. The home button will not be working
2. Incoming calls will not come, the caller will receive either a busy tone or Ring and call drop. But       you will be unaware of this.
3. Notification bar fly down menu will not come down
4. You will not be able to switch between the apps, Recent apps button will not respond.


For all the above issues there is a solution that i personally executed and RESOLVED the issue.
You need to Factory Reset the Motorola device / Android device to bring it to normal state.

Before Factory reset you need to back up all your all as Factory reset will erase user information.

HOW to Factory Reset your Moto G3

Factory Reset : Android 5.x (Lollipop)/Android 6.x (Marshmallow) Steps 
  1. With the phone powered off, press and hold the Volume Down button and the Power button at the same time until the device turns on.
  2. Press the Volume Down key to highlight Recovery mode.
  3. Press the Power key to select and restart into Recovery mode.
  4. The screen will display an Android robot with a red exclamation mark (no command).
  5. While holding down the Power key, press and release the Volume Up key, then release Power.
  6. Use the volume keys to scroll to Wipe data/factory reset and press the Power key to select it.
  7. Scroll down to Yes - erase all user data+ personalized content and press the Power key to select it.
  8. Now your phone will be reset. Then you need to select Reboot system now device
Use Volume Up / down buttons for Navigation, Power button for Selection.

After the reset your mobile will behave as brand new device where you need to setup your account and install all the apps.

This will bring back your Home Button , Notification Bar and Recent apps functionalities.

These are the steps that are officially provided by Motorola. Here is the link to check the same.

https://motorola-global-portal.custhelp.com/app/answers/prod_answer_detail/a_id/105537/p/30,6720,9390/kw/reset

Saturday, 14 March 2015

WhatsApp Voice Calls available for Android users

Hi friends,

Now WhatsApp is providing Calling facility for its users competing with Viber and Skype.

In my personal interest I would whatsapp calling rather than installing any other apps for calling as we are already using WhatsApp for chatting purpose.

1. Avail WhatsApp on invite basis, i.e even if you have already installed the calling update you need a call from the user who is already enabled with WhatsApp calling feature.

2. After the installation you need to change the Device ADMINISTRATION settings as follows  settings > Security > Check UnKnown sources ( allow installation of apps from unknown sources)


Thursday, 27 June 2013

Uttharakhand - Kedharanath Floods Person status finder

Hello Friends
Here you can get the information and Upload the details about the persons missing in Uttharakhand Floods