Jump to content

Programming Challenges

Test your skills with coding challenges, discuss algorithms, and share solutions.

  1. Challenge:Build a basic invoice generator that allows small businesses or freelancers to create and manage invoices for clients. The system should include client details, services provided, costs, and due dates. Basic Requirements:✅ Create an Invoice: Users can enter client details, services, and costs. ✅ Calculate Totals: Automatically sum up itemized services and apply tax if needed. ✅ Export as PDF: Generate a printable/downloadable invoice. Bonus Features for Small Business Needs:🔹 Client Database: Store previous clients for quick selection. 🔹 Recurring Invoices: Automate invoices for regular clients. 🔹 Payment Status Tracking: Mark invoices as Paid, Pending, or Overd…

  2. Challenge:Build a simple time tracking system that allows small businesses or freelancers to log work hours for projects and generate basic reports. Basic Requirements:✅ Start and Stop Tracking: Users can start and stop a work session. ✅ Project-Based Logging: Assign time entries to specific projects or clients. ✅ Daily & Weekly Reports: Summarize hours worked per project. Bonus Features for Small Business Needs:🔹 Invoice Generation: Convert time logs into invoices for clients. 🔹 CSV/Excel Export: Allow users to export time reports. 🔹 User Authentication: Let multiple users track their own hours. 🔹 Idle Time Detection: Automatically detect inactivity. 🔹 Mobile-Friendl…

  3. Challenge:Build a container security scanner that analyzes Docker images for vulnerabilities and misconfigurations. The system should check for outdated packages, excessive privileges, and potential security risks inside the container. Basic Requirements:✅ Scan a Docker image for known vulnerabilities. ✅ Identify and flag outdated dependencies. ✅ Detect privileged containers (running as root). Bonus Features for Enterprise-Grade Security:🔹 Integrate CVE Database: Use Trivy, Clair, or Grype to detect vulnerabilities. 🔹 Policy Enforcement: Block deployment of insecure images. 🔹 Runtime Security Checks: Monitor running containers for suspicious activity. 🔹 SBOM (Software Bil…

  4. Challenge:Design and implement a basic Service Mesh that manages microservices communication within an enterprise architecture. The system should ensure secure, observable, and resilient service-to-service interactions. Basic Requirements:✅ Implement service-to-service communication using an API gateway or service proxy. ✅ Enable basic request routing between multiple microservices. ✅ Implement health checks to monitor service availability. Bonus Features for Enterprise-Grade Implementation:🔹 Traffic Control & Load Balancing: Distribute requests intelligently between services. 🔹 Security & Encryption: Implement mutual TLS (mTLS) for secure service-to-service commu…

  5. Challenge:Design and implement an API rate-limiting system that prevents abuse and ensures fair usage of enterprise APIs. The system should allow different rate limits based on user roles (e.g., Free, Premium, Admin) and IP addresses. Basic Requirements:✅ Implement request counting to track API usage per user/IP. ✅ Set rate limits (e.g., 100 requests per minute for Free users, 1,000 for Premium). ✅ Block or throttle users exceeding their limit. ✅ Use an in-memory store (e.g., Redis, Python Dictionary) to track API usage. Bonus Features for Enterprise-Grade Security:🔹 Role-Based Rate Limits: Different limits for Free, Premium, and Admin users. 🔹 Sliding Window Algorithm: P…

  6. Challenge:Design and implement a basic adaptive MFA system that enhances security while minimizing friction for users. The system should prompt for MFA only when risk factors are detected (e.g., logging in from a new device, unusual location, or repeated failed login attempts). Basic Requirements:✅ Implement user authentication with a username and password. ✅ Implement MFA using a One-Time Password (OTP) (via email, SMS, or authenticator app). ✅ Introduce risk-based authentication, triggering MFA only when certain conditions are met (e.g., new IP, failed login attempts). Bonus Features for Enterprise-Level Security:🔹 Device Fingerprinting: Store known devices and only req…

  7. Challenge:Build a script or configuration that automates cloud infrastructure provisioning using Infrastructure as Code (IaC) principles. Basic Requirements:✅ Use Terraform, Ansible, or Pulumi to define infrastructure. ✅ Deploy a virtual machine (VM) or containerized application in a cloud provider (AWS, Azure, GCP). ✅ Ensure idempotency (running the script multiple times should not break things). Bonus Features for Enterprise-Grade IaC:🔹 Configuration Management: Use Ansible or Puppet to configure the deployed system. 🔹 State Management: Store Terraform state remotely (S3 + DynamoDB for locking). 🔹 Security Best Practices: Implement IAM roles & least privilege. Use e…

  8. Design a centralized logging and monitoring system that collects, processes, and analyzes logs from multiple servers or applications. Basic Requirements:✅ Log Ingestion: Accept logs from multiple sources (applications, servers, databases). ✅ Storage & Indexing: Store logs efficiently (e.g., JSON, database, or flat files). ✅ Search & Filtering: Query logs using timestamps, severity, or keywords. ✅ Alerting: Notify admins when critical issues appear (e.g., failed logins, server crashes). Bonus Features for Enterprise-Level Monitoring:🔹 Log Streaming: Use tools like Fluentd, Filebeat, or Graylog to ingest logs in real-time. 🔹 Data Visualization: Create dashboards wit…

  9. Design and implement a job queue system that can process multiple tasks asynchronously, ensuring scalability for enterprise workloads. Basic Requirements:✅ Implement a task queue where jobs can be added and processed in the background. ✅ Use multi-threading or multi-processing to handle tasks efficiently. ✅ Each job should have a status (e.g., Pending, Processing, Completed). ✅ Allow users to submit new tasks dynamically. Bonus Features:🔹 Implement priority levels for jobs (e.g., High, Medium, Low). 🔹 Store job information in a database (SQLite, PostgreSQL, etc.). 🔹 Expose a REST API for adding jobs and checking statuses. 🔹 Add retry mechanisms for failed jobs. 🔹 Integrat…

  10. Create a script that automates software deployment for an enterprise. ✅ The script should: Pull the latest version of a web application from GitHub. Restart the application after deployment. Log all deployment activities. Bonus Features:Implement rollback functionality if the new deployment fails. Send Slack/email notifications when the deployment is complete. Add a configuration file so the user can customize settings. Example Usage:./deploy.sh --branch=main Deployment started... Pulling latest code from GitHub... Restarting service... Deployment successful! 🔹 Why this matters: Enterprises need reliable deployment processes, and this script is a step toward CI/CD automat…

  11. Build a basic incident ticketing system that IT support teams can use to track issues. ✅ Users should be able to: Log a new incident (e.g., "Server down," "Email not working"). Assign a priority level (e.g., Low, Medium, High, Critical). View open tickets and their status. Bonus Features:Add a search function to find tickets by keyword. Store tickets in a file or database for persistence. Implement an auto-escalation system (e.g., if a Critical issue isn't resolved in 24 hours, alert admins). Example Output:1. Report an Incident 2. View Open Tickets 3. Close a Ticket 4. Exit Enter your choice: 1 Enter issue description: Database connection failure Enter priority (Low, Me…

  12. Enterprises often have outdated legacy databases that need to be migrated to a modern system. Your task is to write a script that: ✅ Reads data from a CSV file (simulating a legacy database dump) ✅ Cleans up the data (e.g., removing duplicates, fixing inconsistencies) ✅ Converts it into a new format (e.g., JSON, SQL inserts) Bonus Features:Allow the user to specify mappings (e.g., "Column X should be renamed to Field Y"). Implement data validation (e.g., emails must be in valid format). Provide a summary report of how many records were migrated. Example Output:Processing legacy_data.csv... Total records: 10,000 Duplicates removed: 53 Invalid emails fixed: 12 Data successf…

    • 0 replies
    • 100 views
  13. Challenge:Create a Password Policy Enforcer that checks whether a given password meets enterprise security standards. The program should validate passwords based on complexity requirements and provide feedback to users. Basic Requirements:Validate that a password meets the following enterprise security rules: ✅ At least 12 characters long ✅ Contains at least one uppercase letter ✅ Contains at least one lowercase letter ✅ Contains at least one number ✅ Contains at least one special character (!@#$%^&*()_+-=[]{}|;:'",.<>?/) Provide feedback to the user if the password fails any checks. Allow users to generate a strong password if their input is weak. Bonus Feature…

  14. Challenge:Create a Role-Based Access Control (RBAC) system where users have different roles with assigned permissions that control what actions they can perform. This challenge is highly relevant in enterprise IT, DevOps, and cybersecurity, where securing access to resources is critical for compliance and security. Basic Requirements:Define roles and permissions, such as: Admin: Full access Developer: Can read/write code but cannot change user roles Viewer: Read-only access Allow users to log in and see only the actions they’re authorized for. Implement a permission check function that validates if a user can perform an action. Role Definitions & PermissionsRole Can V…

    • 0 replies
    • 124 views
  15. Build a command-line budget tracker that helps users manage their income and expenses. Basic Requirements:Allow users to add income and record expenses. Track the current balance based on income and expenses. Provide a summary of all transactions (income and expenses) at any time. Bonus Features:Allow users to categorize transactions (e.g., "Rent", "Groceries", "Utilities"). Add a search function to filter transactions by category or amount. Save the transaction history to a file and load it when the program starts. Example Output:Welcome to the Budget Tracker! 1. Add Income 2. Record Expense 3. View Summary 4. Exit Enter your choice: 1 Enter income amount: 2000 Income r…

  16. Create an interactive Number Guessing Game that allows the user to guess a randomly generated number within a specified range. Basic Requirements:The program should randomly select a number between 1 and 100. Prompt the user to guess the number. Provide feedback: "Too high" if the guess is higher than the target number. "Too low" if the guess is lower than the target number. "Correct!" when the guess is right. Keep track of the number of attempts and display it when the user guesses correctly. Bonus Features:Allow the user to set their own range (e.g., 1 to 1000). Implement a hints system that gives additional clues, such as whether the number is even or odd. Add an optio…

    • 0 replies
    • 102 views
  17. Let's start with a classic! I wanted to create a simple challenge for kids or beginners just starting out with programming. FizzBuzz is one of the most basic challenges you'll encounter, but it's also a great way to practice loops and conditions. Hint: You can only % so much... after that, it’s all about $. 😉 Have fun coding, and don’t forget to share your twist on the solution! Write a program that implements the classic FizzBuzz game with an additional twist: Basic Requirements:For numbers from 1 to 100: Print "Fizz" if the number is divisible by 3. Print "Buzz" if the number is divisible by 5. Print "FizzBuzz" if the number is divisible by both 3 and 5. Print the numb…

    • 0 replies
    • 126 views
  18. Write a program that implements a Caesar Cipher, one of the simplest encryption techniques. The program should be able to both encrypt and decrypt text using a given shift value. Basic Requirements:Accept a message from the user. Accept a shift value (e.g., 3 shifts each letter forward by 3). Provide options to encrypt or decrypt the message. Handle both uppercase and lowercase letters. Bonus Features:Handle non-alphabetic characters by leaving them unchanged. Allow the user to brute-force decrypt a message by trying all possible shift values. Implement a case-insensitive mode to ignore letter casing in the input. Example Output:Choose an option: (1) Encrypt (2) Decrypt &…

    • 0 replies
    • 107 views
  19. Write a program that checks whether a given number is a palindrome. A palindrome number reads the same backward as forward (e.g., 121, 12321). Basic Requirements:Accept numeric input from the user. Check if the number is a palindrome. Display True if it’s a palindrome and False otherwise. Bonus Features:Extend the program to check binary representations of the number for palindromic properties. Add the ability to handle negative numbers (e.g., -121 should return False). Allow users to check multiple numbers in one run. Example Output:Enter a number: 12321 True (It's a palindrome!) Enter a number: 12345 False (Not a palindrome) Enter a number: 9 True (It's a palindrome!)

    • 0 replies
    • 112 views
  20. Write a program that automatically organizes files in a directory by file type. The program should: Basic Requirements:Scan a directory for files. Create folders for different file types (e.g., Documents, Images, Videos). Move files into their respective folders based on their extensions. Bonus Features:Allow the user to specify the directory to organize. Include an undo option to restore files to their original locations. Add a custom ruleset that allows users to specify how files should be categorized (e.g., .py files go to Scripts). Example Output:Enter the directory to organize: /home/user/Downloads Organizing files... Files organized successfully: - Documents: 12 fil…

    • 0 replies
    • 104 views
  21. Today, I think it will be an easy one. Write a program that validates IPv4 and IPv6 addresses. Basic Requirements: Accept a string input from the user. Check if the input is a valid IPv4 address (e.g., 192.168.1.1). Check if the input is a valid IPv6 address (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). Print whether the address is valid, and if so, specify the type (IPv4 or IPv6). Bonus Features: Detect private IP ranges for IPv4. Handle CIDR notation (e.g., 192.168.1.0/24). Identify loopback addresses (e.g., 127.0.0.1 for IPv4, ::1 for IPv6). Example Output: Enter an IP address: 192.168.1.1 Valid IPv4 add…

    • 0 replies
    • 121 views
  22. Objective Build a simple chatbot in a programming language of your choice. The bot should respond contextually to user inputs and include a unique personality or theme. Requirements Personality/Theme: Define the chatbot’s personality or theme (e.g., a sarcastic movie critic, a helpful librarian, or a medieval knight offering advice). Context Awareness: The chatbot should remember at least two pieces of information shared by the user and reference them later in the conversation. Responses: Include at least 10 unique responses based on keywords, context, or a combination o…

  23. Objective: Create a program that generates custom holiday messages by combining templates and user input. The program should also allow the user to shuffle the words for fun. Requirements: The program should provide a set of predefined holiday message templates, such as: "Happy {holiday}, {name}! May your {wish} come true this season!" "Wishing you a {adjective} {holiday}, {name}. Stay {wish} and joyful!" The program must: Ask the user for inputs like the holiday name, their name, an adjective, and a wish. Fill the templates with the user-provided data. Display the fina…

  24. Objective Write a program that simulates an interactive text-based adventure game. The player must navigate through a series of challenges, make decisions, and reach the treasure at the end of the journey. The program should provide multiple paths and outcomes based on the player's choices. Requirements Input Handling: The program should take user input to make decisions (e.g., choosing between different paths or actions). Dynamic Storyline: Create at least three branches in the story with unique outcomes based on user decisions. Data Structures: Use appropriate data structures to manage the game's state (e.g., dictionaries for story branches, …

  25. Challenge: Create a command-line calculator that performs basic arithmetic operations and keeps a history of calculations during the session. Basic Requirements: Allow the user to perform addition, subtraction, multiplication, and division. Accept input in the format: number operator number (e.g., 5 + 3). Display the result of each calculation. Store the history of calculations in a list and display it upon request. Bonus Features: Add support for more complex operations like square roots, exponents, and percentages. Implement input validation to handle errors (e.g., dividing by zero). Allow the user to save the …

    • 0 replies
    • 87 views

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.