By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Q1: List some benefits of using React Native for building mobile apps.
Some benefits of React Native are:
Known for Optimal Performance Can Reuse the Codes and Pre-Developed Components Large Community of Developers Advantage of Live and Hot Reloading Cost Effective Solution Offers Simple User Interface Support for Third-Party Plugins Modular Architecture Providing Handy Solutions and Libraries
Q2: What are the advantages of hybrid apps over native apps? Works across multiple platforms. Unified development. Faster build and lower cost of development. Easier to make changes and update.
Q3: What is Ionic Framework? Ionic Framework is an open source UI toolkit for building performant, high-quality mobile and desktop apps using web technologies (HTML, CSS, and JavaScript). Ionic Framework is focused on the frontend user experience, or UI interaction of an app (controls, interactions, gestures, animations). Currently, Ionic Framework has official integrations with Angular and React, and support for Vue is in development.
Q4: What is Singleton pattern? Singleton pattern comes under creational patterns category and introduces a single class which is responsible to create an object while making sure that only single object gets created. This class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class.
Q5: What is Xamarin? Xamarin is a Cross Platform Mobile Development technology by Microsoft where we can develop the native app using the same code base across all platforms (iOS, Android, UWP) using the C# language. Xamarin uses two approaches for the app development:
Xamarin.Forms and Xamarin Native. Xamarin.Forms uses MVVM & XAML while Xamarin Native uses native UI technology and MVC or MVVMCross Architecture.
Q6: What is a progressive web app? The concept of the progressive web app (PWA) was approached by Google in late 2015. They are basically web applications (Website) but have look and feel like other native mobile apps. The progressive web app enabled websites can offer functionalities such as working offline, push notifications, and device hardware access.
Q7: What is an Activity? An Activity provides the window in which the app draws its UI.
This window typically fills the screen, but may be smaller than the screen and float on top of other windows. Generally, one activity implements one screen in an app. For instance, one of an app's activities may implement a Preferences screen, while another activity implements a Select Photo screen.
Q8: Explain activity lifecycle. As a user navigates through, out of, and back to your app, the Activity instances in your app transition through different states in their lifecycle.
To navigate transitions between stages of the activity lifecycle, the Activity class provides a core set of six callbacks: onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). The system invokes each of these callbacks as an activity enters a new state.
Q9: Explain briefly all the Android application components. App components are the essential building blocks of an Android app. Each component is an entry point through which the system or a user can enter your app.
There are four different types of app components:
Activities - An activity is the entry point for interacting with the user. It represents a single screen with a user interface. Services - A service is a general-purpose entry point for keeping an app running in the background for all kinds of reasons. It is a component that runs in the background to perform long-running operations or to perform work for remote processes. Broadcast receivers - A broadcast receiver is a component that enables the system to deliver events to the app outside of a regular user flow, allowing the app to respond to system-wide broadcast announcements. Content providers - A content provider manages a shared set of app data that you can store in the file system, in a SQLite database, on the web, or on any other persistent storage location that your app can access.
Q10: Explain the build process in Android. First step involves compiling the resources folder (/res) using the aapt (android asset packaging tool) tool. These are compiled to a single class file called R.java. This is a class that just contains constants. Second step involves the java source code being compiled to .class files by javac, and then the class files are converted to Dalvik bytecode by the 'dx' tool, which is included in the sdk 'tools'. The output is classes.dex. The final step involves the android apkbuilder which takes all the input and builds the apk (android packaging key) file.
Q11: How to persist data in an Android app? There are basically four different ways to store data in an Android app:
Shared Preferences - to save primitive data in key-value pairs Internal Storage - you need to store data to the device filesystem, but you do not want any other app (even the user) to read this data External Storage - you might want the user to view the files and data saved by your app SQLite database
Q12: What are the advantages of native apps over hybrid apps? They work efficiently as they are built for that specific platforms Native apps are responsive on all the platform-specific devices They are very fast and the best in the app performance Native apps better integrate with mobile hardware They have interactive and intuitive User Interface (UI) and User Experience (UX) as per the user expectations based on specific platforms Some of the Native mobile apps work even without the Internet connection Native apps are secured and reliable They can easily access or utilize the other device-specific capabilities like GPS, Camera, Contacts, etc.
Q13: What is Builder pattern? Builder pattern builds a complex object using simple objects and using a step by step approach. This builder is independent of other objects.
The Director class is optional and is used to make sure that the building steps are executed in the right order with the right data by the right builder. It's about validation and delegation.
Builder/Director pattern's steps invocations could be semantically presented by method chaining or so called Fluent Interface syntax.
Pizza pizza = new Pizza.Builder() .cheese(true) .pepperoni(true) .bacon(true) .build();
Q14: What is an Intent in Android? An Intent is basically a message that is passed between components (such as Activities, Services, Broadcast Receivers, and Content Providers).So, it is almost equivalent to parameters passed to API calls. The fundamental differences between API calls and invoking components via intents are:
API calls are synchronous while intent-based invocations are asynchronous. API calls are compile-time binding while intent-based calls are run-time binding. To listen for an broadcast intent (like the phone ringing, or an SMS is received), you implement a broadcast receiver, which will be passed the intent. To declare that you can handle another's app intent like "take picture", you declare an intent filter in your app's manifest file.
If you want to fire off an intent to do something, like pop up the dialer, you fire off an intent saying you will.
An Intent provides a facility for performing late runtime binding between the code in different applications.
Q15: What is hybrid app development? Hybrid apps are developed using web technologies like HTML, CSS and Javascript, and then wrapped in a native application using platforms like Cordova. The apps are shown in its own embedded browser, like UIWebView in iOS and WebView in Android (not Safari or Chrome). This allows you to use any web-native framework for mobile app development.
Q16: What is the difference between Upcast and Downcast in Swift? The upcast, going from a derived class to a base class, can be checked at compile time and will never fail. However, downcasts can fail since you can't always be sure about the specific class. If you have a UIView, it's possible it's a UITableView or maybe a UIButton. downcasts must be either optional with as? or 'forced failable' with as! when sure about the type
Q17: How To Share Code Between Cross-Platform Applications on Xamarin? Xamarin provides three common approaches to share code between Cross-Platform Applications:
.NET Standard Libraries Shared Projects Portable Class Libraries (Deprecated)
Q18: What are some disadvantages of PWA? Disadvantages of the progressive web app:
Less access to system features: Currently, Progressive Web Apps have limited access to native system features than native apps. Also, all browsers are not supporting its full features but maybe in near future, it will be the new standard of development.
More Android - Less Apple's iOS: progressive web apps are currently, most supported by Android devices. Apple's iOS is only partially supporting.
No review standard: progressive web apps don't need any kind of review system which is applicable for native apps from the app store. It may make the process faster but lack of promotional benefits from the app store.
Q19: What are some possible security issues with Ionic apps? When building hybrid applications, security is a common issue, as long as your app can be reverse engineered. Since version 4, Ionic CLI does provide built-in code uglification - a common technique of making the code difficult to read by hackers. But you also need to know that if you are using Angular CLI or older versions of Ionic, there is no code uglification going on. Your developers will have to uglify the code on their own.
There are a lot of ways to compromise what's happening with your mobile app or PWA, like a man-in-the-middle attack. Why does it matter? Well, because basically, your Ionic application is a website, running on the device. The important takeaway is that Ionic communicates with the backend using usual HTTP calls. So, you also want to use the security measures on your Ionic app that you use to protect your website, like using HTTPS connection instead of the HTTP.
Q20: What are the differences between onCreate(), onCreateView(), and onActivityCreated() in Fragments and what would they each be used for? They are all called in the Fragment but are called at different times. The onCreate() is called first, for doing any non-graphical initialisations. Next, you can assign and declare any View variables you want to use in onCreateView(). Afterwards, use onActivityCreated() to do any final initialisations you want to do once everything has completed.
Q21: What does the Swift mutating keyword mean? Being the value type structs are immutable. Meaning other variables can not change the values for instance of structure at any given point.
The mutating word is required for changing the values of self variables inside structure's function only.
For. e.g
struct MyStruct { var abc: String = "initila value"
func changeValue() { abc = "some other value". //Compile time error: Cannot assign to property: 'self' is immutable. Mark method 'mutating' to make 'self' mutable. } } Here as we are trying to change value of variable abc inside function declared in struct itself, we get the compile time error.
So here we need to make function mutating to make change value inside structure. Hence the correct code will be:
mutating func changeValue() { abc = "some other value" } }
Q22: What does 'program to interfaces, not implementations' mean? Coding against interface means, the client code always holds an Interface object which is supplied by a factory.
Any instance returned by the factory would be of type Interface which any factory candidate class must have implemented. This way the client program is not worried about implementation and the interface signature determines what all operations can be done.
This approach can be used to change the behavior of a program at run-time. It also helps you to write far better programs from the maintenance point of view.
Q23: What is IndexedDB and how is it used by PWA? IndexedDB is a large-scale, NoSQL storage system. It lets you store just about anything in the user's browser. In addition to the usual search, get, and put actions, IndexedDB also supports transactions.
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs. This API uses indexes to enable high performance searches of this data. While DOM Storage is useful for storing smaller amounts of data, it is less useful for storing larger amounts of structured data. IndexedDB provides a solution.
In a context of PWA a general recommendation for storing data offline:
For the network resources necessary to load your app while offline, use the Cache API (part of service workers). For all other data, use IndexedDB (with a promises wrapper).
Q24: What is Android Data Binding? The Data Binding Library is a support library that allows you to bind UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
Layouts are often defined in activities with code that calls UI framework methods. For example, the code below calls findViewById() to find a TextView widget and bind it to the userName property of the viewModel variable:
TextView textView = findViewById(R.id.sample_text); textView.setText(viewModel.getUserName()); The following example shows how to use the Data Binding Library to assign text to the widget directly in the layout file. This removes the need to call any of the Java code shown above.
<TextView android:text="@{viewmodel.userName}" />
The pros of using Android Data Binding:
Reduces boilerplate code which in turns brings Less coupling Stronger readability Powerful, easy to implement custom attribute and custom view Even faster than findViewById - The binding does a single pass on the View hierarchy, extracting the Views with IDs. This mechanism can be faster than calling findViewById for several Views. Having Tech or Coding Interview? Check 👉 113 Android Interview Questions
Q25: What is Explicit Intent? Explicit Intents used to call a specific component.
When you know which component you want to launch and you do not want to give the user free control over which component to use. For example, you have an application that has 2 activities. Activity A and activity B. You want to launch activity B from activity A. In this case you define an explicit intent targeting activity B and then use it to directly call it.
Q26: What is typecasting? Sometimes you know information that Swift doesn't: you know that the UIViewController you have a reference to is in fact your custom PictureViewController subclass, and you want to treat it like one. As an example, here's how we create new view controllers from a storyboard:
let vc = storyboard?.instantiateViewController(withIdentifier: "Detail") as? DetailViewController That as? is a typecast - we're passing on to Swift the knowledge that the view controller we expect to be created is in fact a DetailViewController. If the typecast fails then vc will be nil, but if it succeeds then Swift will be able to use it as a DetailViewController.
Q27: What is difference between as?, as! and as in Swift? In Swift 1.2 and later, as can only be used for upcasting (or disambiguation) and pattern matching: // 'as' for pattern matching switch item { case let obj as MyObject: // this code will be executed if item is of type MyObject case let other as SomethingElse: // this code will be executed if item is of type SomethingElse ... } as? produces an optional value, which is either the value if it can be cast to the specified type, or nil if it can't. as! doesn't produce an optional, it just produces a value of the specified type, and if the cast fails, it aborts the program. Saying foo as! SomeType is basically the same thing as saying (foo as? SomeType)! (except you get a better error message). You should only ever use as! if you're 100% certain the cast will succeed (because if you're wrong, the whole program aborts).
Q28: What is the difference between PhoneGap, Cordova, and Ionic? PhoneGap is a library that exposes native mobile phone functionalities as JavaScript API. When Adobe purchased PhoneGap, its open source core was donated to the Apache Software Foundation under the name Cordova. In the beginning, there was almost no difference between Cordova and PhoneGap. Although, over the years of development, Adobe started adding a proprietary set of the services to PhoneGap. Today, it is safe to say PhoneGap is Cordova plus extra Adobe services.
Ionic uses Cordova, not PhoneGap for its core tools. Beside native mobile phone functionalities, Ionic gives structure and code scalability to JavaScript applications by using AngularJS (Angular, React and Vue for IOnic 4). It also provides a set of Angular directives and components to speed up application development.
Q29: What is the difference between Xamarin.Forms and Xamarin Native? The main difference is that in Xamarin Forms, you share NOT ONLY the business logic, but also the UI. In Xamarin forms, you'll use basic components on all platforms (Button, Label, etc). That's the reason why it's called Xamarin.Forms, because it's suitable for basic forms.
But for Xamarin Native (Xamarin.iOS and Xamarin.Android ), you'll create a UI per platform (One for iOS, one for Android). You can do much more with Xamarin Native, because you'll use native components.
Q30: What is the difference between Activity and Context? Context is the Base Object. So every Activity same as Application derives from Context. This means that every Activity and every Application IS a Context. An Application context lasts, as long as your app is alive, while the Activity context dies with your Activity (it is not valid after onDestroy() of that Activity). So if you need the Context across Activities (i.e. in a Singleton) you will be better off using an Application context.
Q31: What is the difference between Handler vs AsyncTask vs Thread? The Handler class can be used to register to a thread and provides a simple channel to send data to this thread. A Handler allows you communicate back with the UI thread from other background thread. The AsyncTask class encapsulates the creation of a background process and the synchronization with the main thread. It also supports reporting progress of the running tasks. And a Thread is basically the core element of multithreading which a developer can use with the following disadvantage: Handle synchronization with the main thread if you post back results to the user interface No default for canceling the thread No default thread pooling No default for handling configuration changes in Android Having Tech or Coding Interview? Check 👉 113 Android Interview Questions
Q32: What is the difference between compileSdkVersion and targetSdkVersion? The compileSdkVersion is the version of the API the app is compiled against. This means you can use Android API features included in that version of the API (as well as all previous versions, obviously). If you try and use API 16 features but set compileSdkVersion to 15, you will get a compilation error. If you set compileSdkVersion to 16 you can still run the app on a API 15 device as long as your app's execution paths do not attempt to invoke any APIs specific to API 16.
The targetSdkVersion has nothing to do with how your app is compiled or what APIs you can utilize. The targetSdkVersion is supposed to indicate that you have tested your app on (presumably up to and including) the version you specify. This is more like a certification or sign off you are giving the Android OS as a hint to how it should handle your app in terms of OS features.
Q33: What is the difference between let and var in Swift? Is there any changes in your answer for reference types?
For fundamental types the let keyword defines a constant:
let theAnswer = 42 The value of a constant doesn't need to be known at compile time, but you must assign the value exactly once.
The var defines an ordinary variable.
Both var and let are references/pointers, therefore let is a const reference/pointers. Using fundamental types doesn't really show how let is different than const. The difference comes when using it with class instances (reference types):
class CTest { var str : String = "" }
let letTest = CTest() letTest.str = "test" // OK
letTest.str = "another test" // Still OK
//letTest = CTest() // Error
var varTest1 = CTest() var varTest2 = CTest() var varTest3 = CTest()
varTest1.str = "var 1" varTest2.str = "var 2" varTest3 = varTest1 varTest1.str = "var 3"
varTest3.str // "var 3"
Q34: What's the difference between Self vs self? When you're writing protocols and protocol extensions, there's a difference between Self (capital S) and self (lowercase S). When used with a capital S, Self refers to the type that conform to the protocol, e.g. String or Int. When used with a lowercase S, self refers to the value inside that type, e.g. 'hello' or 556.
As an example, consider this extension on BinaryInteger:
extension BinaryInteger { func squared() -> Self { return self * self } } Remember, Self with a capital S refers to whatever type is conforming to the protocol. In the example above, Int conforms to BinaryInteger, so when called on Int the method returns an Int.
On the other hand, self with a lowercase S refers to whatever value the type holds. If the example above were called on an Int storing the value 5 it would effectively be 5 * 5.
Q35: When to use strong, weak and unowned references? To determine if you even need to worry about strong, weak, or unowned, ask, 'Am I dealing with reference types'. If you're working with Structs or Enums, ARC isn't managing the memory for those Types and you don't even need to worry about specifying weak or unowned for those constants or variables. Strong references are fine in hierarchical relationships where the parent references the child, but not vice-versa. In fact, strong references are the most appropraite kind of reference most of the time. When two instances are optionally related to one another, make sure that one of those instances holds a weak reference to the other. When two instances are related in such a way that one of the instances can't exist without the other, the instance with the mandatory dependency needs to hold an unowned reference to the other instance.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.