Skip to content

jadecubes/TESTDOME-Questions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

🎯 TESTDOME Questions & Solutions

A curated collection of efficient, well-documented solutions to TestDome coding challenges in C#

C# Problems Solved License


🤔 Why This Repository?

TestDome provides real-world coding assessments used by companies for technical screening. This repository demonstrates:

  • Clean, readable solutions that prioritize clarity and maintainability
  • Optimal time complexity implementations using appropriate data structures
  • Production-ready code with proper error handling and edge case coverage
  • Learning-focused comments explaining problem constraints and approach

📚 Problem Categories

Data Structures & Algorithms

Problem Difficulty Topics Time Complexity
Binary Search Tree ⭐⭐ Trees, Recursion O(log n)
Two Sum ⭐⭐ Hash Tables, Arrays O(n)
Sorted Search ⭐⭐ Binary Search O(log n)
Train Composition ⭐⭐ Stacks, Deque O(1) operations
Frog ⭐⭐ Dynamic Programming O(n)

String Manipulation

Problem Difficulty Topics Time Complexity
Palindrome String Processing O(n)
Are Anagrams ⭐⭐ String, Hash Maps O(n)
All Anagrams ⭐⭐⭐ String, Grouping O(n * k log k)

Collections & LINQ

Problem Difficulty Topics Time Complexity
Merge Names LINQ, Sets O(n)
Common Names LINQ, Intersection O(n + m)
Song ⭐⭐ Linked Lists O(n)

Object-Oriented Design

Problem Difficulty Topics Time Complexity
Account ⭐⭐ OOP, Encapsulation -
Folder ⭐⭐ Composite Pattern O(n)
Path ⭐⭐ String Parsing O(n)
Route Planner ⭐⭐⭐ Graph Traversal, BFS O(V + E)

🚀 Getting Started

Prerequisites

  • .NET SDK 6.0 or higher
  • Any C# IDE (Visual Studio, Rider, VS Code)

Running Solutions Locally

Each file is self-contained with a Main method for easy testing:

# Navigate to the C# Questions directory
cd "C# Questions"

# Compile and run any solution
dotnet run BST.cs

# Or use the C# compiler directly
csc BST.cs && ./BST.exe

💡 Featured Solutions

Two Sum - Efficient Hash Table Approach

Problem: Find two indices whose values sum to a target.

public static Tuple<int, int> FindTwoSum(IList<int> list, int sum)
{
    Dictionary<int,int> map = new Dictionary<int, int>();
    for (int i = 0; i < list.Count; i++)
    {
        int target = sum - list[i];
        if (map.ContainsKey(target))
            return new Tuple<int, int>(i, map[target]);
        map[list[i]] = i;
    }
    return null;
}

Key Insight: Single-pass solution using hash table to store complements. Time: O(n), Space: O(n).


Binary Search Tree - Leveraging BST Properties

Problem: Efficiently check if a BST contains a value.

public static bool Contains(Node root, int value)
{
    if (root == null) return false;
    if (root.Value == value)
        return true;
    else if (root.Value < value)
        return Contains(root.Right, value);
    else if (root.Value > value)
        return Contains(root.Left, value);
    else
        return false;
}

Key Insight: Exploits BST ordering property to achieve O(log n) average case vs O(n) for unordered tree traversal.


🎓 Learning Path

Beginner (Start here if new to algorithms)

  1. Palindrome
  2. Merge Names
  3. Common Names

Intermediate (Build on fundamentals) 4. Two Sum 5. Binary Search Tree 6. Are Anagrams 7. Sorted Search

Advanced (Graph algorithms & optimization) 8. Route Planner 9. All Anagrams 10. Frog (Dynamic Programming)


📊 Solution Statistics

  • Average Time Complexity: O(n) or better for 87% of solutions
  • Space Optimization: In-place algorithms used where possible
  • Code Quality: All solutions tested against TestDome's test suites
  • Documentation: Every solution includes problem description and constraints

🛠️ Project Structure

TESTDOME-Questions/
├── C# Questions/          # All C# solution files
│   ├── BST.cs            # Self-contained with problem statement
│   ├── TwoSum.cs         # Each file has Main method for testing
│   └── ...
└── README.md             # This file

🔗 Resources


🤝 Contributing

Found a more efficient solution or want to add problems in other languages? Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/python-solutions)
  3. Include problem description as comments
  4. Add test cases in Main method
  5. Submit a pull request

📝 License

This project is licensed under the MIT License - see individual files for problem copyrights held by TestDome.


⚠️ Disclaimer

These solutions are provided for educational purposes. If you're taking a TestDome assessment:

  • Understand the logic, don't copy blindly
  • Companies value problem-solving process over memorized solutions
  • Use this as a learning resource to improve your skills

Happy Coding! 🚀

Built with ☕ and algorithms

About

Answers to questions on TESTDOME

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages