Advertisement

Device Features & Essentials interview questions and answers

7 Device Features & Essentials interview questions for .NET MAUI roles, each with a model answer, examples and likely follow-ups.

7 questions
Advertisement

7 questions

Q1 Beginner Save

How do you get the device's geolocation in MAUI?

Use Geolocation.Default.GetLocationAsync (last-known or a fresh request with GeolocationRequest specifying accuracy and timeout). Request location permission first. GetLastKnownLocationAsync is faster but may be stale; GetLocationAsync forces a fix.
var request = new GeolocationRequest(GeolocationAccuracy.Medium,
    TimeSpan.FromSeconds(10));
var loc = await Geolocation.Default.GetLocationAsync(request);
Real-world example
A weather app fetches the user's coordinates to show local conditions after requesting location permission.
Likely follow-ups
  • Last-known vs fresh location? | What permission is required?
Geolocation Permissions Device Features & Essentials
Q2 Beginner Save

How do you pick or capture a photo in MAUI?

Use MediaPicker.Default.PickPhotoAsync to choose from the gallery or CapturePhotoAsync to use the camera (camera requires permission and hardware). Both return a FileResult you can open as a stream to display or upload.
var photo = await MediaPicker.Default.CapturePhotoAsync();
if (photo is not null)
{
    using var stream = await photo.OpenReadAsync();
    // save or display
}
Real-world example
A profile screen lets users take a new avatar photo or pick an existing one with a couple of lines.
Likely follow-ups
  • Does capture need permission? | What does PickPhotoAsync return?
Media Permissions Device Features & Essentials
Q3 Beginner Save

How do you open the browser, dialer, or email from MAUI?

Use the launcher/communication APIs: Browser.Default.OpenAsync for URLs, PhoneDialer.Default.Open for phone numbers, Email.Default.ComposeAsync for email, and Sms/Map for others. These invoke the platform's default apps rather than embedding them.
await Browser.Default.OpenAsync("https://w3teacher.com",
    BrowserLaunchMode.SystemPreferred);
PhoneDialer.Default.Open("+15551234567");
Real-world example
A contact screen opens the dialer with the support number and launches the website in the system browser.
Likely follow-ups
  • SystemPreferred vs External mode? | How do you compose an email?
Launcher Communication Device Features & Essentials
Q4 Intermediate Save

How do you read device sensors like the accelerometer?

Use the sensor APIs (Accelerometer, Gyroscope, Compass, Barometer). Subscribe to ReadingChanged and call Start with a SensorSpeed, then Stop when done to save battery. Marshal UI updates to the main thread.
Accelerometer.Default.ReadingChanged += (s, e) =>
    Debug.WriteLine(e.Reading.Acceleration);
Accelerometer.Default.Start(SensorSpeed.UI);
Real-world example
A fitness app detects shakes and step motion by reading the accelerometer at UI speed and stopping it when the screen closes.
Likely follow-ups
  • Why stop sensors when idle? | What is SensorSpeed?
Sensors Performance & Optimization Device Features & Essentials
Q5 Intermediate Save

How do you get device and display information in MAUI?

Use DeviceInfo (model, manufacturer, platform, version, idiom, DeviceType—physical vs virtual) and DeviceDisplay (screen metrics, density, orientation, keep-screen-on). These help adapt UI and diagnose device-specific issues.
var idiom = DeviceInfo.Current.Idiom;          // Phone/Tablet/Desktop
var density = DeviceDisplay.Current.MainDisplayInfo.Density;
DeviceDisplay.Current.KeepScreenOn = true;
Real-world example
A video page keeps the screen awake during playback and adapts controls when it detects a tablet idiom.
Likely follow-ups
  • How do you detect an emulator? | What is display density?
Device Info Responsive UI Device Features & Essentials
Q6 Intermediate Save

How do you use the Clipboard and Share APIs?

Clipboard.Default.SetTextAsync/GetTextAsync copies and reads text. Share.Default.RequestAsync opens the OS share sheet with text or files (ShareTextRequest/ShareFileRequest), letting users send content to other apps.
await Clipboard.Default.SetTextAsync(couponCode);
await Share.Default.RequestAsync(new ShareTextRequest
{ Text = "Check this out!", Title = "Share" });
Real-world example
A coupon screen copies the code to the clipboard and offers a Share button to send a referral link to friends.
Likely follow-ups
  • How do you share a file? | Is Clipboard access async?
Clipboard Sharing Device Features & Essentials
Q7 Advanced Save

How do you run background work or scheduled tasks in MAUI?

MAUI has no unified background API; use platform mechanisms: Android WorkManager/foreground services, iOS BGTaskScheduler/background modes, and Windows background tasks—wrapped behind a shared interface. For short async work while active, normal tasks suffice; true background execution needs native scheduling per platform.
public interface IBackgroundSync { void Schedule(TimeSpan interval); }
// Platforms/Android -> WorkManager; Platforms/iOS -> BGTaskScheduler
Real-world example
A messaging app schedules periodic sync via WorkManager on Android and BGTaskScheduler on iOS behind one IBackgroundSync interface.
Likely follow-ups
  • Why is there no unified background API? | What handles Android background work?
Background Tasks Platform Integration Device Features & Essentials