SMART
WORKZ
Toggle navigation
Home
Software Development
Integrations
Pricing
Contacts
Sign up
Edit Prompt
Action
Version
Default
Content
Task: Analyze and solve the provided provided input (image, problem statement, or code) from an online platform (HackerRank, LeetCode, CodeSignal, etc.). Focus on optimal performance, correctness, and coding best practices, while addressing the problem requirements. Follow the steps below: 1. Problem Understanding: - Carefully read and understand the problem statement. - Identify the input and output formats. - Highlight any constraints and edge cases that need consideration. 1. Error Identification: - For Code: - Analyze the code for any syntax errors, logical issues, or missing edge case handling. - Look for potential bugs, inefficiencies, and improper use of data structures or algorithms. - For Problem Statement: - Review the problem statement for unclear instructions, missing information, or incorrect examples. - Identify any ambiguities that could lead to confusion in solving the problem. - For Diagrams or Images: - Verify if the visual information or diagrams provide sufficient detail to support the solution. - Ensure that diagrams are consistent with the problem requirements and constraints. 3. Data Structures and Algorithm Selection: - Choose the most appropriate data structure(s) for the problem (e.g., arrays, linked lists, trees, graphs, etc.). - Select the optimal algorithm for solving the problem (e.g., sorting, searching, dynamic programming, backtracking, etc.). - Justify your choice of algorithm with respect to time complexity (Big O notation) and space complexity. 4. Solution Design: - Outline your approach to solving the problem step-by-step. - Break down the solution into smaller, manageable tasks or sub-problems. - Ensure that the solution handles all edge cases, as well as the minimum and maximum input sizes. 5. Code Implementation with {0}: - Implementation the incompleted function is case of any or Implement the solution in a clean and maintainable way with {0}, following best practices (e.g., meaningful variable names, modularity, DRY principle). - Write efficient and readable code with appropriate comments for clarity. - Ensure the code handles edge cases and adheres to platform-specific input/output requirements. 6. Testing: - Run the solution against all provided test cases, including edge cases. - Write custom test cases if necessary to validate your approach. - Ensure that the solution works under time and memory constraints of the platform (e.g., large datasets). 7. Optimization: - Analyze the performance of your solution and look for potential optimizations (if necessary). - Refactor the solution to reduce time complexity, if possible (e.g., using memoization, better algorithms, etc.). - Minimize the space complexity where applicable. 8. Interview Preparation: - If the problem is part of an interview preparation platform (e.g., InterviewBit, CodeSignal, HackerRank), consider preparing for related concepts. - Simulate solving the problem in a timed environment as a mock interview. - Review common questions and patterns that are frequently asked in coding interviews. 9. Company-specific Problem Set: - If the problem comes from a company-specific question bank (e.g., Amazon, Google, Facebook), research their common coding patterns (e.g., dynamic programming, graph traversal, etc.). - Prepare for follow-up questions based on similar problems asked in interviews at these companies. Focus on: - Code Quality: Ensure the code is clean, maintainable, and follows best practices for readability and reusability. - Efficiency: Optimize the solution for both time and space complexity. - Correctness: Ensure the solution passes all test cases, including edge cases. - Scalability: Make sure the solution can handle large inputs efficiently. Additional Considerations: - If any part of the problem is ambiguous or unclear, state your assumptions. - Be mindful of platform-specific rules (e.g., time limits, memory constraints, input/output formatting). - Focus on how the solution might be extended or modified for more complex scenarios or interviews.
Save
Clear