Recently, the annual “Golden Nine Silver ten” has begun, many people hope to take advantage of this opportunity to change their Flutter.

In that case, here are some interview questions for you.

Take a look at companies’ hiring needs

First, let’s take a look at the requirements of each company. After all, the interview questions are only part of the story.

More beautiful App-Flutter development engineer 20-40K·14 salary

responsibility

  • Ai SDK application development using Flutter; Be able to independently develop iOS and Android applications;
  • Work with algorithm engineer to discuss technical implementation solutions, application and system integration;
  • Familiar with Flutter APIS and third-party frameworks;
  • Continuously improve and optimize the product development process to enhance development capability and efficiency, and enhance user experience and usability through technology.
  • Develop ar related business

Post requirements

  • Can use Flutter for cross-platform mobile development;
  • Familiar with iOS or Android native developers is preferred;
  • Practical project experience with Flutter is preferred.
  • Familiar with one of the mainstream AR SDK(ARKit, ARCore, Vuforia, etc.) is preferred

Gebu Technology – Flutter development Engineer 20-30K

The job description

  • Familiar with Flutter programming language, familiar with various UI components and UI development, and have a certain understanding of Java language;
  • At least 2 years Android development experience, familiar with Android SDK, good component-oriented programming experience, able to independently develop Android App;
  • Familiar with common unit test framework, with keen awareness of abstraction and encapsulation, proficient in writing unit test code to ensure code quality;
  • Experience in iOS, Web front end such as ReactNative or Web back end is a plus.
  • Proficient in using Git common operation commands, and familiar with common Git-based code version control platforms Github, Gitlab, etc.
  • I have strong analytical and problem-solving skills and the ability to work under pressure. I am curious about new technologies, actively explore them, learn quickly and apply them to products.
  • Good product awareness and risk awareness, able to control the work progress, positive and optimistic, serious and responsible, good at communication, willing to cooperate.

Let’s take a look at just two of them. Most of them are similar, so we can draw a few points:

  1. Knowledge of native development and experience in native development
  2. Familiar with Flutter and API
  3. Have some experience in Flutter development

The first point may be a bit difficult for those of you who are front-end Web developers. Flutter is just a UI framework, so learn some native development knowledge.

The third point is actually nothing to say, we can write a few demo projects.

Let’s move on to the second point, which is the focus of this article.

Interview questions related

The Flutter interview process is similar to the Android interview process and consists of two parts:

  1. Dart
  2. Flutter

After all, Flutter is written in Dart, so you must know something about Dart.

Dart related interview questions

1. Dart’s “.. What does it mean?

Dart’s “..” Means “cascade operator” and is used for ease of configuration.

“..” And “.” The difference is calling “..” The return is equivalent to this, and “. Returns the value returned by the method.

2. Dart scope

Dart does not have keywords such as “public” or “private”. It is public by default, and private variables start with an underscore _.

3. Is Dart a single-threaded model? How does it work?

Dart is a single-threaded model, and here’s how it works:

To quote Flutter Chinese:

Dart runs in a single-threaded message loop that consists of two task queues, a microtask Queue and an event queue.

After the entry function main() is executed, the message loop starts. First, tasks in the microtask queue will be executed one by one in first-in, first-out order. When all the tasks in the microtask queue are completed, tasks in the event queue will be executed. After the execution of the event task is completed, the microtask will be executed.

4. How are Dart tasks parallel?

As I said, how do you multitask in Dart if you don’t have multithreading?

Dart provides a independently running worker-ISOLATE that acts like a new thread but does not share memory.

So how do they interact?

Here are some of the answers to the Concurrent programming, asynchronous, and event-driven details in the DART of the Flutter introduction:

In DART, an Isolate object is a reference to the Isolate execution environment. In general, the current Isolate controls interactions with other isolates. When we want to create a new Isolate, we can use the isolate. spawn method to get a new Isolate object. The two isolates send messages to each other using SendPort. There is also a ReceivePort corresponding to the ISOLATE to receive messages for processing, but it is important to note that there is a pair of ReceivePort and SendPort on each isolate. Only ReceivePort in the same ISOLATE can receive and process the message sent by SendPort of the current class.

5. What about Future?

Future, which literally means “Future,” is a tool for dealing with asynchrony.

As I said just now:

Dart runs in a single-threaded message loop that consists of two task queues, a microtask Queue and an event queue.

Future by default is simply an event that is inserted into the “event queue”, executed when free time is available, and then called back to the future.then (v) method.

We can also use the future. microtask method to insert a task into the “microtask queue”, thus increasing its execution efficiency.

In each ISOLATE, the execution priority is Main > MicroTask > EventQueue

6. Talk about Stream?

Stream, like Feature, is a tool for handling asynchrony.

However, the difference between a Stream and a Feature is that a Stream can receive multiple asynchronous results while a Feature has only one.

Streams can be created and controlled using stream.fromFuture or StreamController.

One more note: regular streams can only have one subscriber, and if you want to have multiple subscribers, use asBroadcastStream().

7. What about mixins?

As for what mixin is, quote zhang Fengjiatelier’s article:

First mixin is a keyword that defines a class. Dart introduces the mixin keyword to support multiple inheritance. Mixin classes cannot have constructors to avoid parent class constructor conflicts

Flutter related interview questions

1. The life cycle of StatefulWidget

  • initState()The: Widget initializes the current State. Context is not available in the current method. If you want to get the Context, tryFuture.delayed()
  • didChangeDependencies()In:initState()After the call,StateIt is also called when object dependencies change.
  • deactivate(): whenStateThis method is called when you temporarily remove it from the view tree, when you switch pages, and AndroidonPauseAbout the same.
  • dispose(): called when the Widget is destroyed.
  • didUpdateWidget: called when the status of the Widget changes.

To borrow an image from CoorChice’s article:

2. How does Flutter communicate with Android iOS?

Flutter interacts with the native via platformchannels, which are divided into three types:

  1. BasicMessageChannel: Used to pass strings and semi-structured information.
  2. MethodChannel: Used to pass method calls. Flutter actively calls Native methods and gets the corresponding return value.
  3. EventChannel: Communication for Event streams.

Learn more about Flutter Platform Channel.

3. What are Widgets, RenderObjects and Elements?

  • WidgetOnly used to store information needed for rendering.
  • RenderObjectResponsible for managing layout and drawing.
  • ElementIs the entity on the giant control tree.

A Flutter is a Flutter that contains Widgets, RenderObjects and Elements.

4. What is state management and why is it needed?

First of all, state is really a conceptual thing, distinguishing between global state and local state.

Local state such as the information entered in a control, global state such as the userId requested from the background after login.

As the global state grows and multiple pages share a state, we need to manage it.

Common state management includes:

  • ScopedModel
  • BLoC
  • Redux / FishRedux
  • Provider

5. What about the BLoC pattern?

Specific can view: Vadaski – Flutter | state management to explore – BLoC (3)

Here’s part of the quote:

BLoC is an approach to building applications using Reactive programming, a completely asynchronous world of flows.

6. How do I manage error pages in a unified manner?

We all know that if something goes wrong in a Flutter, it will be red.

You can customize a Widget using errorWidget. Builder.

For details, see Druid – how to customize the Flutter error page

conclusion

I will write here for the time being. Having written so much, I have a deeper understanding of Flutter & Dart. Please feel free to send me any new interview questions in the future.

I also created a “Flutter communication group”. I can add my personal wechat account “17610912320” to the group.

Recommended reading:

Flutter | a super cool how the login page is tempered

Flutter | WReorderList one can specify two item swap position of components

Flutter | how to implement a water ripples spread Widget