Google Top Windows Phone interview questions c# - Part2 | SubramanyamRaju Xamarin & Windows App Dev Tutorials

Friday, 28 February 2014

Top Windows Phone interview questions c# - Part2

Introduction:

 In previous article  i was posted the nearly 67 interview question about windows phone and c#.net. Because it is good practice for knowing generic questions about c#.net which is related to windows phone development.However in this post i am going to introduce most of questions related to windows phone.So that lets continue with part-1 post questions


Note1: I am really sorry, During my time if i am missing any questions which you are excepted to be answered in this post,so that it would be very impressive if  you are able to post your questions in comments section,and it will answered very quickly and added your question's answer in this post  

Note2: Please help windows phone developers, when i am searching for interview questions,i am not found any resources .So that i am decided to post interview questions in my blog as per my knowledge.So it would be very helpful if you are suggested me with new question in comment section ,which you are already faced in your interview.Lets do it together and Lets share it for all our windows phone developers to make success in their interview's.

68. WindowsPhone 8 vs Windows 8 vs Windows RT vs WinRT:

 It is a most confusing question ,and the guys always struck at this point

WindowsPhone 8: Window Phone 8 OS is the second generation mobile operating system from Microsoft which runs under the mobile hardware.and we can develop this apps using windows phone 8 sdk

Window 8: Windows 8 as universal operating system for the various device like smart phone, tablet, surface tablet, desktop.

Windows RT: Windows RT runs on tablet  and Windows 8 Pro runs on desk top, (windows RT and Windows 8 pro are different version of windows 8 OS).

  WinRT: Windows Runtime, or WinRT for short, the successor to Win32, also known as Windows API or  WinAPI, used in previous editions of Windows since the migration from DOS.
The RT in WinRT means Runtime, but the RT in Windows RT does not. Microsoft chose not to explain what RT means in the case of Windows on ARM (and Runtime does not make sense).
69. Windows Phone apps vs Windows store apps
Windows Store Application is not same as Windows Phone 8 Application, they are totally different (in terms of UI and other backend api's). Windows Store Application run on Windows RT and Windows 8while Windows Phone 8 applications only run on Windows Phone 8 phones.
Only similarity in Windows Phone 8 and Windows8 / Windows RT is that they have a same Kernel.

70. Windows Phone Programming Languages:

    Preferred  languages:

          ·      C#
·         VB.Net
·         JavaScript
·         C++(not officially)
·         Others
71. Why xaml for Windows Phone?:
Windows Phone XAML defines the visual appearance of a UI, and an associated code-behind file defines the logic. The UI design can be adjusted without necessarily making changes to the logic in code-behind. XAML in this role simplifies the workflow between individuals who might have a primary visual design responsibility and individuals who are responsible for app logic and information design.
72. X:key vs  X:Class  vs  X:Name:        
·         x:Key: Sets a unique user-defined key for each resource in a ResourceDictionary. The key token string is used as the argument for StaticResource markup extension to retrieve any such resource from another XAML usage.

·         x:Class: Specifies the CLR namespace and class name for the class that provides code-behind for a XAML page, and names the class that is created or joined by the XAML markup compiler build action in the Windows Phone app model

·         x:Name: Specifies a run-time object name for the instance that exists in run-time code after an object element defined in XAML is processed. You use x:Name for element-naming scenarios in the occasional cases where the more convenient  FrameworkElement.Name  property is not supported.

73. X:Name vs Name:
  x:Name can be used on object elements that do not have Name properties of their own.
You can only use Name on an element that represents an object that actually does have a Name property. For example anything that derives from FrameworkElement.
74. Why Expression Blend for WindowsPhone?:
Sometimes we may need to customize windows phone default control as per requirement of our apps, so that Expression Blend for Windows Phone is designed to make it easier and faster to design applications for Windows Phone. In addition to the design tools available in Expression Blend, Expression Blend for Windows Phone includes tools designed specifically for creating Windows Phone applications.
Note: However Blend is available with windows phone sdk
75. How to adjust the corner radius Windows Phoen button?:
Windows phone default having Ui like Metro type.There is no property to set corner radius for Windows phone buttons. But our requirement is to create a button with curve edges.so that we can do like this by overriding control template of button.
<Button  HorizontalAlignment="Left" Margin="47,636,0,0" Name="SignUpButton" VerticalAlignment="Top"   FontSize="18" Background="#6BA92A"
             Click="SignUpButton_Click">
        <Button.Template>
            <ControlTemplate>
                <Border BorderBrush="#6BA92A" Background="#6BA92A" CornerRadius="20,20,20,20" BorderThickness="2">
                    <Button   Content="Sign up "
                              Background="{TemplateBinding Background}"
                              Height="65"
                              Width="348"
                              FontSize="{TemplateBinding FontSize}"
                              BorderBrush="#6BA92A">
                    </Button>
                </Border>
            </ControlTemplate>
        </Button.Template>
    </Button>

76. Normal State vs Pressed state:
"Normal" is the state for when the control is not pressed, not disabled and doesn't have the pointer over its hit test area. "PointerOver" and "Pressed" are typically states that last a relatively short period of time and are tied to user action.
77. RenderTransForm:
Render transforms are typically intended for animating or applying a temporary effect to an element. For example, the element might zoom when focused or moused over, or might jitter on load to draw the eye to that part of the user interface (UI).
78. Windows phone Triggers:
     When you add an action to the artboard in Microsoft Expression Blend for Windows Phone,  an EventTrigger is created by default. You can use any of the additional built-in triggers in Expression Blend for Windows Phone by changing the trigger type. To change the trigger type, click New in the Trigger category in the Properties panel.

      The following triggers are available in Expression Blend for Windows Phone:

·         DataStoreChangedTrigger   Use the DataStoreChangedTrigger trigger to invoke an action based on a modification to a data store.

·         DataTrigger   Use the DataTrigger trigger to invoke an action based on the value of a data-bound property.

·         EventTrigger   Use the EventTrigger trigger to invoke an action based on an event such as a mouse click, a page loading, or another interaction.

·         KeyTrigger   Use the KeyTrigger trigger to invoke an action when a combination of keys is pressed on the keyboard.

·         PropertyChangedTrigger   Use the PropertyChangedTrigger trigger to invoke an action based on a modification to an element or a data store property.

·         StoryboardCompletedTrigger   Use the StoryboardCompletedTrigger trigger to invoke an action after a storyboard has finished.

·         TimerTrigger   Use the TimerTrigger trigger to invoke an action based on a timer.

79. How to make tap,flick,hold on screen?:
A touch gesture is defined as a user-initiated movement with one or more fingers on a touch screen. Controls that are supported on Windows Phone are gesture-aware. These controls support gestures such as tap, pan, and flick. 
80. Why pushNotification?:
Push notifications provide a way for web services to push data to users' devices without waiting for a game to initiate the web request. Push notifications can be sent from any source that can make a web request: a server, a desktop PC, even another Windows Phone.
81. When  pushNotification channel URI will be expired?:
   You create a channel, send it to your server and then the server can send until it fails (the channel Uri expires or there's an error). At which point the app needs to create a new ChannelUri and then UPDATE the value stored for that app/device on the server. The server will then be able to send notifications.
Some important points
1.       When a new channel Uri is requested for one that is still valid you'll get the same one back.

2.       When your ask for a new channel uri and the current one has expired, you'll normally get the same uri returned but the channel will be made live again.

3.       There is no way to know if a channel has expired from within an app without running code like your registerPushChannel method. (Unless you track this on your backend and the app queries the backend.)

4.       There is no way to tell the app that a channel has expired, or tell the user to reopen the app to re-establish a channel connection using the push infrastructure.
The standard way to try and ensure that the channel is always available is to check the channel whenever the app is started.

This is what you're doing, you probably just want to make sure you're updating server records not just adding more.
Note: When you sent special characters like ‘&’ symbol will cause channel URI be expired.
82. HttpChannel
Implements a client channel for remote calls that uses the HTTP protocol to transmit messages.Which is most important for creating channel URI in push notifications from mspn(Microsoft Push Notification Service)
83. Foreground vs BackGround:
Foreground-background is a scheduling algorithm that is used to control execution of multiple processes on a single processor. It is based on two waiting lists, the first one is called foreground because this is the one in which all processes initially enter, and the second one is called background because all processes, after using all of their execution time in foreground, are moved to background.
When a process becomes ready it begins its execution in foreground immediately, forcing the processor to give up execution of current process in the background and execute newly created process for a predefined period.
Note: Windows Phone apps are made dormant state when running in the background or when the phone is locked (to conserve device memory and battery life). If your application needs to perform processing when it is (may be) in the background you can use a background agent

84. How can run app in background:
Scheduled Tasks and background agents allow an application to execute code in the background, even when the application is not running in the foreground. 
Background agents are divided into Periodic Tasks and Resource-intensive Tasks.
 Periodic Task can run for no more than 25 seconds every 30 minutes. This sort of agent is suitable for many common use-cases:
·         Downloading data from remote server and then scheduling notifications (for example, when monitoring twitter or facebook updates)
·         Changing lock screen wallpaper ( like the Bing app)
·         Synchronizing data in the background, for example emails

Apps which require more device resources and/or which do not require a fixed update schedule, can use a resource intensive task.
 

Limitations

Background agents have certain limitations, as listed below.
·         Background tasks can minimally be run every 30 minutes. There is a debug-only API to run them more regularly, but this is not available for released apps.
·         There are certain APIs which are not supported , you can check here.
·         Some low power devices do not support background agents
·         Background tasks are limited by number on each device and can be enabled or disabled from application settings.
·         They do not work when power saver mode is activated.

85. Can you tell me real time example’s when an app will be going to background?:
When phone get calls,phone lock, or when user launching another app like (datepicker,sms composer or any other app installed in a device)
86. Background app notifications:
Some time we need to get app notification even though app in background like whatsapp, so that Windows Phone platform is responsible to handle Push Notifications and developers don't have a direct access for notification handling when an app is not running. That means you can't do any background logic after Toast is received. 
Note: But some times push notifications are not always for solutions , at that we need use background worker.
87. Displaying Html Content :
You could probably make use of a WebBrowser control to show this content. An example of showing data from a string in this control from code behind would be as follows...

webBrowser1.NavigateToString("<html><body><h1>Description</h1><p>This is a description, set from code</p></body></html>");

88. LINQ to SQL :
Windows Phone 7.5 includes support for LINQ to SQL, allowing developers to work with relational data. In this article you'll learn how to define, create, upgrade and work with LINQ to SQL within your application.
LINQ to SQL will only create a duplicate at the point when the original is being modified. If your application works with a large number of objects, or objects that are large in size, this can significantly reduce the memory footprint of your application.
89. Lamda Expression:
A lambda expression is an anonymous function and it is mostly used to create delegates in LINQ. Simply put, it's a method without a declaration, i.e., access modifier, return value declaration, and name. 
 Syntaxt: (input parameters) => expression
 
Example: List<int> numbers = new List<int>{11,37,52};
List<int> oddNumbers = numbers.where(n => n % 2 == 1).ToList();

90. lambda expression vs linq:
They are equivalent. The compiler changes the query expression into the equivalent Lambda expression before compiling it, so the generated IL is exactly the same.
Example
var result = select s from intarray
             where s < 5
             select s + 1;
is exactly the same as
var result = intarray.Where( s => s < 5).Select( s => s+1);

91. Delegate:
Delegate is a type which  holds the method(s) reference in an object. It is also referred to as a type safe function pointer.
  public delegate type_of_delegate delegate_name()
  example: public delegate int mydelegate(int delvar1,int delvar2)
 
 92. SQLite Vs IsolatedStoarge:
A very common task for most of the applications is to store and access the data. Almost all applications has to store some kind of user data for a later use. This is the reason why mobile platforms provide ways to the developer handle those data; with Windows Phone 8 is not different, it provides theSystem.IO.IsolatedStorage namespace to access files and/or application settings.
This is normally enough for many applications, but a database would be better if the user wants to store data in a more structured way. This post is about the use of the SQLite database to handle those structured data.

93. How big can the application's IsolatedStorage be on Windows Phone 8?:

There is no limit on WP8 for the IsolatedStorage. But of course you'll get an exception if you run out of space when writing new data, so you have to handle that properly.
Windows Phone applications do not have a limit on the quota for storage on disk. The quota APIs reflect this, and GetUserStoreForSite is not available.

94. Find out how much space in isolated storage:

  IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
long usedBytes = isf.Quota - isf.AvailableFreeSpace;

95. BackStack:
The navigation history of an app is represented as a last-in, first-out structure called a stack. This is also referred to here as the back stack, since it contains the set of pages in a stack structure that represents the back navigation of your app. 
96. Fast App Resume:
In Windows Phone 8, when the user navigates away from an application, the app goes into suspended state and the state preserves in memory by the operating system. If the user re-launches the app by tapping on the app’s primary tile from the Start Screen or the app name in the app list, the old instance of the app terminates by default and a new instance of the app generates. Windows Phone 8 introduces an ability for apps to request that user actions to re-launch the app to resume the suspended instance of the suspended if exists. This process is called Fast App Resume or FAR.

97. How to remove one page of windows phone backstack?:

NavigationService.RemoveBackEntry() removes only the last entry from the backstack, so it should fit your needs.
This method is used to remove the most recent entry from the back stack, or throws an InvalidOperationException if there are no more entries to remove. If you want to remove more than one item, you call this method multiple times.

98. OutofMemory Exception in WindowsPhone:

Different Windows Phone devices might have different amounts of memory. As such, you should work to have a small memory footprint so that your applications can work on multiple devices
Hints: working with images, data binding optimization, and more.
99. How to implement Data Virtualization :
Data Virtualization is a technique you use to expose a subset of the data from a large data collection so that only the actual data you need is fetched into memory. To implement data virtualization, you take your data collection which could contain any number of rows – even a million rows or more! – and you create a custom class for your virtualized data collection that implements IList<T> and acts as a facade to the underlying data collection.
IList<T> has a great many methods, but fortunately the only methods you have to implement are:
public int Count
     T IList<T>.this[int index]
 
Note: This interface is an abstraction that allows list types to be used with through a single reference type. With it, we can create a single method to receive an int[] or a List<int>.
100. Tap event vs Click Event in windows phone:
  The Click event was originally defined in Silverlight for desktop Windows and it is only defined for the Button control (and derivatives such as HyperlinkButton). You can think of the Click event as the "traditional" way to handle a Button press.
The Tap event was added to the framework in Windows Phone 7.1 (Mango). Tap is defined in the UIElement class, which is the parent of many types of controls. You can handle a Tap event in a TextBlock, Image, and many other controls. Button is subclassed from UIElement as well, and thus can also receive Tap events. It is redundant that a Button can receive both Tap and Click events.

101. XAML vs HTML vs XML:


XAML : XAML is another schema that derives from XML that describe content presentation for parsers that render WPF and Silverlight windows phone. The XAML schema can be further defined to parse WPF or to parse for Silverlight.

HTML: HTML has a defined schema with tags that describe content presentation for a web browser or anything that uses HTTP and parses HTML. HTML isn't exactly XML that would be XHTML but it's gotten better. 

XML: is data storage that can exchange with most technology cross plate form.


102. What are the application events of windows phone?:


The Launching Event:

A user can launch a new instance of your app by selecting it from the installed applications list or from a Tile on Start in addition to other means, such as tapping on a toast notification associated with the app or selecting the app from the Photos Extras menu. 

The Deactivated Event:

The Deactivated event is raised when the user navigates forward, away from your app, by pressing theStart button or by launching another application.  


The Activated Event:

The Activated event is called when the user returns to a dormant or tombstoned app. Your app should check the IsApplicationInstancePreserved property of the event args to determine whether it is returning from being dormant or tombstoned. 

The Closing Event:

The Closing event is raised when the user navigates backwards past the first page of an app. In this case, the app is terminated and no state is saved. 

103. Which controls are not permitted in windows phone panorama?:

-Toggle switches
- Sliders
- Maps controls – unless they are static (pinch/zoom/pan are disable etc.)
- Browser controls - unless they are static (pinch/zoom/pan are disable etc.)

             Most Excepected General Questions

1)Why you are choosing  windows phone development?

2)Have you idea about windows 8,WPF?

3)How many apps are you are done?

4)Is you are faced any issues while developing your apps?

5)Tell me most difficult module you felt among your apps?

6)What's your role in your apps?

7)Which IDE you are using to develop?

8)What are the steps you are followed while development?

9)Have you ever do Unit Testing while submit build file to Testing Team?

10)From Which client you got more windows phone apps?

11)Tell me your carrier goal?

12)How many your apps are live in app store?

13)Do you have idea about app submission process with windows phone market place?

And please read another related post that is WindowsPhone Tips.

All the best for your interview  by  :)

22 comments:

  1. Really Great effort... Thank you for sharing..

    ReplyDelete
    Replies
    1. These interview questions were really required...Subbu you are doing very appreiciating work....Keep it up..

      Delete
  2. Replies
    1. Hi Subbu ,

      Today i attend the Interview in Tagit India Private Ltd Chennai:

      But i Failed in Telephonic Round:

      Questions Asked :

      1. Introduction about our self.
      2. Project Description.
      3. Technical Questions asked .
      a) Expalin about MVVM Light
      b) Dependency Object in WP8?.[http://msdn.microsoft.com/en-us/library/windowsphone/develop/cc221408%28v=vs.105%29.aspx]
      c) Dependency Properties WP8?
      d) Explain about Visual State ?
      I did t answer b,c,d. then the interviewer cut the Call ...

      Delete
    2. I am really sorry for this,i forgot to add questions about "Dependency Properties".And it is good question on wp development.Your referred link is enough to understand "Dependency Properties" and thanks for sharing here.

      VisualState specifies how the control looks when it is in a certain state. For example, when a Button is pressed, its border might be a different color than normal.
      Reference:
      http://msdn.microsoft.com/en-us/library/system.windows.visualstate(v=vs.110).aspx

      i feel bad due to failure of of your interview,I hope in next interview you will definitely get success then only i will be happy.But i am very impressing with you,because of you are informing us with your attended questions .

      Dear visitors ,please share your questions like "PremNath",so that our windows phone developers will be answer all questions in their interview with effectively.

      I want to this kind of community over here.Lets do it together to success in our interviews.

      Thanks you so much PremNath and All the best for next interview to make good results :)

      Delete
    3. Thanks For Positive Reply , it Makes me Too Encouragement and Smart ...

      Delete
    4. Hi Subbu,

      Past 2 days , i Struggling with WP8 HTTPWebRequest Post Method ...
      Please Help me to Finish this Part

      Reference Link :
      http://stackoverflow.com/questions/21158493/how-to-post-data-on-json-web-services-in-windows-phone-8

      i Will Send my Source code to your Email Please Response me am egarly waiting for your Reply ... Plz

      Delete
    5. This comment has been removed by the author.

      Delete
    6. Hi Prem,

      I reviewed your code is exactly right way to post json,but i am not found where is your json data to post on service.
      and here ' string postData = "447451310145' is string only.

      Delete
  3. Hi, Subbu

    How to Retrieve a Phone Contacts and Show in LONGLISTSELECTOR, with Name, MobileNo, Image... plz help i tried several times but i cant able to achieve it Plz HELP Man,

    ReplyDelete
    Replies
    1. Or Please Provide any reference Link for Phone Contacts and Show in LONGLISTSELECTOR plz Man...

      Delete
    2. Have you visited my article
      1)http://bsubramanyamraju.blogspot.in/2014/02/how-to-display-photo-of-contact-for.html
      And also refer this link
      2)http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh286416(v=vs.105).aspx
      3)http://www.ginktage.com/2011/05/how-to-retreive-all-contacts-from-windows-phone-7-using-c/

      Delete
    3. Thanks Man ... i got it ... in List view with Images, but i cant getting in Long List Selector with Images... PLZ HELP

      This is my Source Code:
      XAML:


      phone:LongListSelector Name="ContactResultsData" Margin="10,62,10,0" SelectionChanged="ContactResultsData_SelectionChanged" ItemsSource="{Binding}" Foreground="Black"
      JumpListStyle="{StaticResource FriendsJumpListStyle}"
      Background="Transparent"
      GroupHeaderTemplate="{StaticResource FriendsGroupHeaderTemplate}"
      LayoutMode="List"
      IsGroupingEnabled="true"
      HideEmptyGroups ="true"
      ItemTemplate="{StaticResource Template}"



      XAML.CS:
      public partial class ContactsWithImage : PhoneApplicationPage
      {
      public ContactsWithImage()
      {
      InitializeComponent();
      Contacts cons = new Contacts();
      cons.SearchCompleted += new EventHandler(Contacts_SearchCompleted_Many);
      cons.SearchAsync(String.Empty, FilterKind.None, "Contacts Test #3 Picture");
      }

      void Contacts_SearchCompleted_Many(object sender, ContactsSearchEventArgs e)
      {
      try
      {
      //Bind the results to the list box that displays them in the UI.
      ContactResultsData.DataContext = e.Results;

      }
      catch (System.Exception)
      {
      //No results
      }
      }

      private void ContactResultsData_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {

      }

      Delete
    4. NOT DISPLAYING CONTACTS NAME AND IMAGES IN LONGLISTSELECTOR PLZ TELL ME MAN

      Delete
    5. Hi,
      as per your request i made sample with longlistselector.Please look at ConatcImagewithLongList

      Delete
    6. Hello Sir,
      Thanks a lot for your valuable questions. Sir I also msged you on your FB page please check that i need your suggestions.

      Delete
  4. HI..Can you give any articles regarding Windows Phone architecture?(very urgent)..Suppose if attending any interview what i have to tell for that question..Kindly give your suggestion..thanks..

    ReplyDelete
  5. Hi, I read your blog this is very informative. Thanks for share this blog. You can find dedicated Web designers,Mobile Application Developers, SEO and marketing specialists will tailor make the solution you want for your business.Know more about click here – www.hvantagetechnologies.com

    ReplyDelete
  6. TalScout is a video interviewing platform for both job seekers, & the employers. Simplifing talent hiring process with automated screening, virtual campus hiring digital interview platform

    ReplyDelete

Search Engine Submission - AddMe