GithubHelp home page GithubHelp logo

purushottam-kunwar / interview-questions-flutter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from raieshg/interview-questions-flutter

0.0 0.0 0.0 22 KB

Documentation of all questions that i have faced during interviews. Basically the realworld documentations of interview.

License: MIT License

interview-questions-flutter's Introduction

interview-questions-flutter

Documentation of all questions that I have faced during interviews. Basically the realworld documentations of interview. I might have missed some question so please feel free to create pull request. A start will be appreciated. Best of Luck. Thank You



introudction

My name is Arjun Dahal.I am currently working on xyzcompany name as full stack mobile app developer. 
I have 2 years of experience in android development, 1 year in flutter and 1 year in go development.

I Specialize in these skills (read their requirement and try to match those sills):

1. Flutter App Development
    . Project Name
        - Description (What problem your app solved)
        - Tech Used 
        - Achivements (What you have learned)

2. Backend Development with Golang
    . Project Name
        - Description (What problem your app solved)
        - Tech Used
        - Achivements (What you have learned)

3. Native Android App Development with Kotlin
    . Project Name
        - Description (What problem your app solved)
        - Tech Used 
        - Achivements (What you have learned)

For more information please feel free to find my CV.

Question Answer

Dart Specific Questions

  1. What is null safety in dart?
    Ans: Generally, a variable holds some kind of value but let's take an example of a variable called favourite color now this varable can be null right? some of us don't have any favourite color so it kind of make sense. now let's imagine a situation that we don't have this beautiful feature of dart i.e null safety. we should always know that the color variable can be null and check it all the time. now imagine you just forgot that variable favourite color can be null but you have just used it. now in this case you will get an error app will crash. what null safety does is it shows error while writing code so that you don't miss to address null and your app won't crash cuz you already know it can be null.

  2. What is static variable or method?
    Ans: The static variable or methods are the same for every instance of the class, so if we declare the data member as static then we can access it without creating an object.

  3. What is const?
    Ans: const means compile time constant. The expression value must be known at compile time.

  4. What is final?
    Ans: The final keyword is used to hardcode the values of the variable and it cannot be altered in future.

  5. What is abstract class?
    Ans: An abstract class is a class that can’t be instantiated, instead they are used for defining interfaces that are used by other classes. Abstract classes can only be extended. Abstract classes are useful for defining blue-prints for other classes to implement.

  6. What extends keyword is used for?
    Ans: The extends keyword is typically used to alter the behavior of a class using Inheritance.

  7. What implement keyword is used for?
    Ans: The implement keyword is used to implement an interface by forcing the redefinition of the functions.

  8. What is Mixins?
    Ans: Mixins are a way to abstract and reuse a family of operations and state. It is similar to the reuse you get from extending a class, but is not multiple inheritances.

  9. What with keyowrd is used for?
    Ans: With is used to include Mixins. A mixin is a different type of structure, which can only be used with the keyword with.

  10. How many null aware operator in flutter?
    Ans: ?. , ?? , and ??= .

Reactive Programming

  1. What is reactive programming?
    Ans: The reactive proramming is a programming paradime where we deal with data streams and act upon changes.

  2. How can we do reactive programming in dart?
    Ans: We can work with asyncronus data with steams. basically a stream emits multiple pieces of data over time.

  3. How can we listen to multiple streams and is it possible to listen to it?
    Ans: By default stream can be only listened by single subscriber but there is something called broadcast streams this can be listened by multiple subscribers.

  4. What is Stream Controller?
    Ans: Steam Controller allows sending data, error and done events on its stream. This can be used to create a simple stream that others can listen on, and to push events to that stream.

  5. What is StreamSink?
    Ans: A StreamSink is a StreamConsumer, which means it can take several streams (added by addStream) and processes the events these streams emit.

  6. What is RxDart?
    Ans: RxDart extends the capabilities of Dart Streams and StreamControllers. so basically this means that RxDart has all the capabilities of stream and additonal features.

  7. How can we Combime Streams in RxDart?
    Ans: We can combine a specific number of Streams together with proper types information for the value of each Stream by sing combine2..9(2 represents combining two streams and so on till 9)

  8. What is BehaviourSubject in RxDart?
    Ans: BehaviorSubject captures only the latest added item. When a new listener starts to listen to the controller, it will receive the stored item.

  9. What is ReplaySubject in RxDart?
    Ans: ReplaySubject captures all items that have been added. When a new listener starts to listen to the controller, it will receive all items. After that, any new event will be sent to all listeners.

  10. What is PublishSubject in RxDart?
    Ans: PublishSubject emits all the items on listen that is added.

Flutter Specific Questions

  1. What is Stateless Widget?
    Ans: Stateless widgets are those widgets which states or content is not changed with user interaction

  2. What is Stateful Widget?
    Ans: Widgets value can be changed as per users interaction is stateful widget.

  3. What is StatelessElement?
    Ans: An Element that uses a StatelessWidget as its configuration.

  4. What is StatefulElement?
    Ans: An Element that uses a StatefulWidget as its configuration.

  5. What is InheritedWidget?
    Ans: Base class for widgets that efficiently propagate information down the tree. e.g. Theme.of(context).primaryIconTheme.color

  6. How do we find Screen sizes and resolution?
    Ans: Using MediaQuery

  7. How can we implement LazyLoading?
    Ans:

  • You can listen to a ScrollController.
  • ScrollController has some useful information, such as the scrolloffset and a list of ScrollPosition.
  • ScrollPosition contains informations about it's position inside the scrollable. Such as extentBefore and extentAfter. Or it's size, with extentInside.
  • Considering this, you could trigger a server call based on extentAfter which represents the remaining scroll space available.
  1. What's the use of Vsync?
    Ans: Vsync/TickerProvider allows animations to be muted, slowed, or fast-forwarded.

  2. How can we serialize complex json?
    Ans: We can use json_serializable package and use that to generate code for us. similar to gson on native android development.

  3. What is Dio?
    Ans: Dio is a powerful HTTP client for Dart. It has support for interceptors, global configuration, FormData, request cancellation, file downloading, and timeout, among others. Flutter offers an http package that’s nice for performing basic network tasks but is pretty daunting to use when handling some advanced features. By comparison, Dio provides an intuitive API for performing advanced network tasks with ease.

  4. What is ValueNotifier?
    Ans. A ValueNotifier can hold a single value. The value itself can be of any type. It can be an int, a String, a bool or your own data type.Using a ValueNotifier improves the performance of Flutter app as it can help to reduce the number times a widget gets rebuilt.

  5. What Is A ValueListenableBuilder?
    Ans. A ValueListenableBuilder is a very useful widget that works well with ValueNotifier. It listens to the value emitted by ValueNotifier and gets rebuilt whenever a new value is emitted.

  6. How many types of stream are there in flutter? Ans: 2 single subscription streams and broadcast streams

  7. How many Life cycle of statefulwidget ? Ans: 7, constructor function,create state, initState, didChangeDependencies,build,deactivate,dispose

  8. What is flutter activity? Ans: FlutterActivity is the simplest and most direct way to integrate Flutter within an Android app.

StateManagement Related Questions

  1. What is state management?
    Ans: State-Management is the implementation of a Design Pattern, with the help of design pattern we can synchronize the state of the application throughout all widgets of the application.

  2. Why not just use setState? Ans: Let's suppose we are building an app and we have a screen which have ton of widgets. Now the problem with any ui framework is painting screen. This thing is super duper expensive. Now let's assume a situation where we want to change a text value only depending of button click. Now we can use something called setState to repaint the whole screen but will it be effective? just to change the text is good to paint the whole screen is expensive.

  3. Why we need state management?
    Ans: The State of the Whole Application is present at a single place, so we do not need to access the single state or data from different places. This makes our code clean and seprate business logic from ui logic

  4. When to implement the state management?
    Ans: If the application contains a large number of widgets and a lot of requests are being sent to the back-end for data retrieval, then it becomes mandatory to implement the state-management, as it will boost the user experience and speed of the application to a great extent.

  5. What are the state managemet approaches in flutter?
    Ans: Provider setState InheritedWidget & InheritedModel Redux Fish-Redux BLoC / Rx GetIt MobX Flutter Commands Binder GetX Riverpod states_rebuilder

  6. What is ChangeNotifierProvider from Provider Package?
    Ans: ChangeNotifierProvider listens for changes in the model object. When there are changes, it will rebuild any widgets under the Consumer.

  7. What is FutureProvider?
    Ans: The FutureProvider listens for when the Future completes and then notifies the Consumers to rebuild their widgets.

  8. What is StreamProvider?
    Ans:StreamProvider is basically a wrapper around a StreamBuilder. You provide a stream and then then the Consumers get rebuilt when there is an event in the stream. The StreamProvider doesn’t listen for changes in the model itself. It only listens for new events in the stream.

  9. How many types of flutter Stream are available? Ans:

Design patterns in Dart

SOLID

interview-questions-flutter's People

Contributors

dahal-arjun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.