šŸ†

Final Challenge

Apply your knowledge to real-world scenarios. Identify complexities and justify your answers!

šŸ“‹ Challenge Structure

  • āœ“ 10 real-world scenarios
  • āœ“ Mix of multiple choice and drag-and-drop
  • āœ“ Justify your reasoning
  • āœ“ Get instant feedback
Your Score
0 / 10

1. Social Media Feed

Scenario Analysis

A social media app displays your feed by fetching the latest 50 posts. The posts are stored in a database indexed by timestamp. What's the speed to fetch these posts?

2. Autocomplete System

Code Analysis
def autocomplete(prefix, words):
    results = []
    for word in words:
        if word.startswith(prefix):
            results.append(word)
    return results

3. Finding Duplicates

Program Optimization

You need to check if an array of 1 million user IDs contains any duplicates. Which approach is best?

4. Database Query

System Design

A database has 10 million records with an index on the "email" field. Looking up a user by email is:

5. Image Processing

Nested Steps

Applying a blur filter to an nƗn pixel image requires averaging each pixel with its neighbors. Speed?

6. Route Planning

Graph Algorithms

A GPS app finds the shortest path between two cities in a road network with n intersections. Using Dijkstra's program with a priority queue:

7. Shopping Cart

Data Structure Choice

An e-commerce cart needs to frequently check "is item X in cart?" and add/remove items. Best data structure?

8. Password Strength

Security Analysis

Testing all possible 8-digit numeric PINs (00000000 to 99999999) is:

9. Video Streaming

Buffer Management

A video player maintains a buffer of the next 30 seconds. Adding a frame to the end and removing from the front:

10. Code Review Challenge

Optimization Task

A junior developer wrote this code to check for unique elements. What's wrong?

def has_unique_elements(items):
    for i in range(len(items)):
        for j in range(i + 1, len(items)):
            if items[i] == items[j]:
                return False
    return True