CodeNFacts
CodeHub
Home

All Categories


Sign In
Practice Hub

Practice CodingQuestions

Master the art of solving coding problems with structured practice. We are building fully optimized practice sections that cover every major topic - coming very soon.

Fully optimized practice modules launching soon

What You Should Practice

Data Structures

  • Arrays & Strings
  • Linked Lists
  • Trees & Graphs
  • Heaps & Hash Maps

Algorithms

  • Sorting & Searching
  • Two Pointers
  • Sliding Window
  • Dynamic Programming

Problem Solving Patterns

  • Backtracking
  • Greedy
  • Binary Search
  • Recursion & Memoization

System Design Basics

  • Complexity Analysis
  • Trade-offs
  • Scalability Thinking
  • Edge Cases

How to Approach a Problem

Problem-Solving Flow

Read & Clarify
Examples & Edge Cases
Brute Force Idea
Optimize
Code & Test
Analyze Complexity

Time Complexity Hierarchy

O(1)
O(log n)
O(n)
O(n log n)
O(n²)
O(2ⁿ)

Quick Mental Model

Think of every problem as a transformation of input → output. Identify the pattern first (two pointers? hash map? tree traversal?). The data structure you choose often decides the complexity.

Important Things to Keep in Mind

1

Understand before coding

Spend 5–10 minutes clarifying constraints, edge cases, and expected output before writing a single line.

2

Start with brute force

Get a correct (even if slow) solution first. Optimize only after you have a working baseline.

3

Talk through your approach

Explain your thought process out loud. This is how interviews work and it improves your own clarity.

4

Test edge cases early

Empty input, single element, duplicates, negatives, overflow — catch them before they catch you.

5

Analyze time & space

Always state Big-O for both time and space. Interviewers care about this as much as correctness.

6

Review & refine

After solving, revisit the problem 2–3 days later. Can you solve it faster? With better space?