Company: Vortex Position: Mobile Developer Duration: 1-2 Days
- Fork this repository to your own GitHub account
- Make your forked repository PUBLIC
- Complete all three parts in the designated folders
- Write clean, readable code with appropriate comments
- Commit your work with meaningful commit messages
- Submit your public forked repository link to HR before the deadline
/part-1-theory → Theory questions (answers.md)
/part-2-code-snippets → Coding tasks (Dart files)
/part-3-logic-problems → Algorithm problems (Dart files)
Open part-1-theory/answers.md and answer all questions there.
- Section A: 10 Multiple Choice questions
- Section B: 5 Short Answer questions
Create your solutions in part-2-code-snippets/ folder. Each solution should be in a separate Dart file.
Write a class ApiService that:
- Has a method
fetchUsers()that makes a GET request tohttps://api.example.com/users - Handles loading, success, and error states
- Returns a list of
Userobjects - Includes proper error handling with try-catch
Define the User model with fields: id, name, email, isActive
Note: The API URL is a placeholder. We are evaluating your code structure, not whether it runs. Focus on demonstrating proper HTTP request patterns, error handling, and model parsing.
The following code has bugs. Identify and fix all issues, then explain what was wrong in comments.
class CounterScreen extends StatelessWidget {
int counter = 0;
void incrementCounter() {
counter++;
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text('Counter: $counter'),
),
floatingActionButton: FloatingActionButton(
onPressed: incrementCounter(),
child: Icon(Icons.add),
),
);
}
}Using Provider (or any state management you prefer), create:
- A
UserProviderclass that manages a list of users - Methods:
addUser(),removeUser(),toggleUserActive() - The state should notify listeners when changed
Write SQL queries for the following scenarios. Assume you have these tables:
courses (id, title, category, price, instructor_id, created_at)
enrollments (id, user_id, course_id, enrolled_at, completed_at)
users (id, name, email, role, created_at)Write queries to:
- Get all courses with their instructor names, ordered by newest first
- Find the top 5 most enrolled courses
- Get users who have completed more than 3 courses
- Calculate the total revenue per category
Create a SearchableList widget that:
- Takes a list of items and displays them
- Has a search TextField at the top
- Filters the list in real-time as user types
- Shows "No results found" when search has no matches
- Debounces the search input (300ms delay)
Create your solutions in part-3-logic-problems/ folder. Each solution should be in a separate Dart file with a main() function that demonstrates the solution.
An EdTech platform has courses with prerequisites. Given a total number of courses (labeled 0 to n-1) and a list of prerequisite pairs, determine if a student can complete all courses.
// Example:
// Input: numCourses = 4, prerequisites = [[1,0], [2,1], [3,2]]
// Output: true
// Explanation: Course 0 has no prereq, 1 requires 0, 2 requires 1, 3 requires 2
// Input: numCourses = 2, prerequisites = [[0,1], [1,0]]
// Output: false
// Explanation: Circular dependency - impossible to completeWrite a function:
bool canFinishAllCourses(int numCourses, List<List<int>> prerequisites)Given a list of courses where each course has a duration (in hours) and a skill value, find the maximum skill value a student can achieve within a given time limit.
// Example:
// courses = [
// {"name": "Flutter Basics", "duration": 5, "skill": 10},
// {"name": "Advanced Dart", "duration": 3, "skill": 7},
// {"name": "State Management", "duration": 4, "skill": 8},
// {"name": "API Integration", "duration": 2, "skill": 5}
// ]
// timeLimit = 8 hours
//
// Output: 15 (Advanced Dart + State Management = 3+4 hours, 7+8 skill)Write a function:
int maxSkillValue(List<Map<String, dynamic>> courses, int timeLimit)Students have different skill levels (1-10). Form study groups where:
- Each group has exactly 3 students
- The difference between max and min skill in a group should be ≤ 2
- Maximize the number of groups formed
// Example:
// Input: skills = [1, 2, 3, 3, 4, 5, 5, 6, 7, 8]
// Output: 2
// Explanation: Group 1: [3,3,4], Group 2: [5,5,6]
// Students with skills 1,2,7,8 cannot form valid groupsWrite a function:
int maxStudyGroups(List<int> skills)Before submitting, ensure:
- Your forked repository is PUBLIC
- All three parts are completed
- Code is clean and has appropriate comments
- Commit history shows meaningful progress
- All Dart code compiles without errors
Good luck!
If you have any questions about the assessment, please contact HR.