Debug School

rakesh kumar
rakesh kumar

Posted on

Dart Interview question

BASICS

  1. Explain the concept of asynchronous programming in Dart.
  2. How do you handle exceptions and errors in Dart?
  3. Describe the difference between async and sync in Dart.
  4. Explain the purpose of the Future and Stream classes in Dart

Data Structures:

  1. Describe the differences between List, Set, and Map collections in Dart.
  2. How can you efficiently perform operations like filtering, mapping, and reducing on Dart collections?
  3. Explain the concept of generics and how they are used in Dart

Dart Basics:

  1. Explain the difference between final and const variables in Dart.
  2. How can you achieve code reusability using inheritance in Dart classes?
  3. Given a list of integers, write a Dart function to find the sum of all even numbers.
  4. Write a Dart function to check if a given string is a palindrome.
  5. Implement a Dart function that calculates the factorial of a given positive integer .

Conditional Statements:

  1. Write a Dart program to determine whether a year is a leap year or not.

  2. Create a Dart function that returns the largest of three given numbers.

  3. Implement a Dart program that checks whether a number is positive, negative, or zero.

  4. Write a Dart function to find the maximum of an array of integers
    .

Loops:

  1. Implement a Dart program to print the Fibonacci series up to a given number of terms.

  2. Write a Dart function to calculate the factorial of a number using a loop.

  3. Create a Dart program to print the multiplication table of a given number.

  4. Implement a Dart function to find the greatest common divisor
    (GCD) of two numbers.

Arrays and Lists:

  1. Write a Dart function to find the second largest element in an array of integers.

  2. Create a Dart program to reverse an array of integers in place.

  3. Implement a Dart function to remove duplicates from an array.

  4. Write a Dart function to rotate an array of integers by a given number of positions
    .

Strings:

  1. Create a Dart function to count the occurrence of a specific character in a string.
  2. Write a Dart program to reverse a given string.
  3. Implement a Dart function to check if two strings are anagrams of each other.
  4. Write a Dart program to find the longest common prefix among an array of strings .

Recursion:

  1. Write a recursive Dart function to calculate the nth term of the Fibonacci series.

  2. Implement a recursive Dart function to calculate the power of a number.

  3. Create a recursive Dart program to calculate the sum of digits of a positive integer.

  4. Write a Dart function to calculate the factorial of a number using recursion
    .

Pattern Printing:

  1. Implement a Dart program to print a pattern of stars in a pyramid shape.

  2. Write a Dart program to print a pattern of numbers in a diamond shape.

  3. Create a Dart function to print a Pascal's triangle up to a given number of rows.

  4. Implement a Dart program to print a pattern of hollow squares
    .

Mathematics:

  1. Write a Dart program to find the prime factors of a given number.
  2. Create a Dart function to check if a number is Armstrong (sum of cubes of its digits is equal to the number itself).
  3. Implement a Dart program to calculate the area and perimeter of different geometric shapes.
  4. Write a Dart function to find the greatest common divisor (GCD) of an array of numbers .

Searching and Sorting:

  1. Implement a Dart program to perform binary search on a sorted array of integers.
  2. Write a Dart function to implement the bubble sort algorithm on an array.
  3. Create a Dart program to merge two sorted arrays into a single sorted array.
  4. Implement a Dart function to perform insertion sort on an array of integers .

Logical Challenges:

  1. Write a Dart program to find the sum of all prime numbers within a given range.
  2. Implement a Dart function to find the factorial of a large number using Big Integer libraries.
  3. Create a Dart program to check if a given number is a perfect number.
  4. Write a Dart function to generate all prime numbers up to a given limit .

Algorithms:

  1. Implement a Dart program to find the shortest path between two nodes in a graph using Dijkstra's algorithm.
  2. Write a Dart function to solve the Tower of Hanoi problem for a given number of disks.
  3. Create a Dart program to implement the knapsack problem using dynamic programming.
  4. Implement a Dart function to calculate the nth term of the Tribonacci series .

Miscellaneous:

  1. Write a Dart program to simulate a simple calculator that performs addition, subtraction, multiplication, and division.

  2. Implement a Dart function to convert a decimal number to its binary representation.

  3. Create a Dart program to generate a random password of a specified length.

  4. Write a Dart function to find the intersection of two arrays.

  5. Implement a Dart program to generate the first N prime numbers.

  6. These logical programming questions cover a range of topics and concepts that are relevant to Flutter development. Solving these questions will not only improve your problem-solving skills but also enhance your understanding of Dart programming concepts
    .

Top comments (0)