Interview Question – 12 – Bon Appétit
Question You can download the problem statement from here. Solution
Question You can download the problem statement from here. Solution
In this article, I will tell you a simple way to theme a flutter app. Here is a simple code that illustrates that. We use the theme property of each widget to theme it. For example, to theme the whole application, we would do something like this. Take a look at the theme property of… Read More »
Apple has introduced a new API to allow developers to prompt users with rate their apps directly from the app. Old way In the old way, we used to redirect users to the Appstore with the app’s link to rate the app. This makes users to navigate out of the app. This was not an… Read More »
Once you have different Google-Services.json for different targets for your firebase applications, you may be wondering how all can have same filenames and configure for different targets. However the solution is simple. Initial Steps * Create new directory for each directory inside for project folder. Make sure the folder name is different from the target… Read More »
Problem Statement Download or view the problem statement here. Solution
Here is a simple example to list contacts in android using the Content Resolver. Note : You need to have two things before accessing contacts. 1. Contacts Permission in the Android Manifest 2. Ask Runtime permission from the user Code Here is our MainActivity that lists the contacts. MainActivity.java Adapter Class Below is the adapter… Read More »
Here is Tip # 2 Toast at Center of the Screen
We are starting simple posts for tips in Android so that you can master android very fast in a very simple manner. Here is a simple android tip. Hide Software Navigation in Android
This issue happens in react-native-firebase for a various reasons. First thing you have to do is check Firebase/Core is in your pods. Try Cleaning and rebuilding your project. Click on the target you are running in xcode and check the frameworks section in ‘General’ Tab -> Check you have linked libFirebase.a there. If not click… Read More »
Question You have been asked to help study the population of birds migrating across the continent. Each type of bird you are interested in will be identified by an integer value. Each time a particular kind of bird is spotted, its id number will be added to your array of sightings. You would like to… Read More »
Question Find the count where the number k is divisible by sum of two numbers in the array and first number index should be less than second number index. Function has the following parameter(s): n: the integer length of array ar: an array of integers k: the integer to divide the pair sum by You… Read More »
Question Maria plays college basketball and wants to go pro. Each season she maintains a record of her play. She tabulates the number of times she breaks her season record for most points and least points in a game. Points scored in the first game establish her record for the season, and she begins counting… Read More »
Navigation is done is Flutter using the Navigator class. Lets look at a simple example The first thing you have to register routes for difference screen is to build a Map of ‘String’ (route) and the page (Widget). Lets say I have a utility class for the Creating Routes named routes.dart. The contents of… Read More »
Hi Friends, Today we will see how to implement GridView in Flutter. We are going to use this service for the data First we will create a Model for the Grid Cell No we will create view for Grid Cell Create a file named “cell.dart” and copy this into it. Service Class We… Read More »
Question Given a time in -hour AM/PM format, convert it to military (24-hour) time. Note: Midnight is 12:00:00AM on a 12-hour clock, and 00:00:00 on a 24-hour clock. Noon is 12:00:00PM on a 12-hour clock, and 12:00:00 on a 24-hour clock. Sample Input 07:05:45PM Sample Output 19:05:45 Solution
Question You are in charge of the cake for your niece’s birthday and have decided the cake will have one candle for each year of her total age. When she blows out the candles, she’ll only be able to blow out the tallest ones. Your task is to find out how many candles she can… Read More »
Here is a simple example of doing Http calls in Flutter. In this example we will try to fetch some JSON value from the below url https://jsonplaceholder.typicode.com/posts/1 You can read more from here. Add Dependencies First you need to add the http plugin in dependencies. The latest version of http can be found here (https://pub.dartlang.org/packages/http).… Read More »
Question Write a recursive program to count the number of “a”s in a string. Solution
This simple example demonstrates saving an integer value in the local shared preferences. We will use a flutter plugin called shared_preferences for this. You can read more about the plugin from here. Add Dependency First thing is to add the package to the dependencies. Go to pubspec.yaml and add the package. Example
Question Given a square matrix, calculate the absolute difference between the sums of its diagonals. For example, the square matrix is shown below: 1 2 3 4 5 6 9 8 9 Ans : | (1+5+9) – (3+5+9) | = 2. Solution
Question Alice and Bob each created one problem for our company. A reviewer rates the two challenges, awarding points on a scale from to for three categories: problem clarity, originality, and difficulty. We define the rating for Alice’s challenge to be the triplet , and the rating for Bob’s challenge to be the triplet .… Read More »
Question Lilah has a string, , of lowercase English letters that she repeated infinitely many times. Given an integer, , find and print the number of letter a’s in the first letters of Lilah’s infinite string. For example, if the string and , the substring we consider is , the first characters of her infinite… Read More »
Question Emma is playing a new mobile game that starts with consecutively numbered clouds. Some of the clouds are thunderheads and others are cumulus. She can jump on any cumulus cloud having a number that is equal to the number of the current cloud plus or . She must avoid the thunderheads. Determine the minimum… Read More »
Gary is an avid hiker. He tracks his hikes meticulously, paying close attention to small details like topography. During his last hike he took exactly steps. For every step he took, he noted if it was an uphill, , or a downhill, step. Gary’s hikes start and end at sea level and each step up… Read More »
Question John works at a clothing store. He has a large pile of socks that he must pair by color for sale. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. For example, there are socks with colors . There is one… Read More »