Skip to the content

coderz.py

Keep Coding Keep Cheering!

  • 23 DSA Patterns
  • DSA Basics
  • DSA Sheet
  • Programming
    • C
    • C++
    • Java
    • Python
  • DBMS
  • Privacy Policy
  • Sign Up
  • 23 DSA Patterns
  • DSA Basics
  • DSA Sheet
  • Programming
    • C
    • C++
    • Java
    • Python
  • DBMS
  • Privacy Policy
  • Sign Up
  • 23 DSA Patterns
  • DSA Basics
  • DSA Sheet
  • Programming
    • C
    • C++
    • Java
    • Python
  • DBMS
  • Privacy Policy
  • Sign Up

What is object oriented design patterns

  • September 5, 2025
  • Object Oriented Design Patterns
A design pattern is a reusable solution to a commonly occurring problem in software design. They are not finished, ready-to-use pieces of code but rather templates or blueprints that can be adapted for a specific situation. Developers use these formalized best practices to write more structured, efficient, and maintainable code. Analogy: A cooking recipe Why design […]

Factory Method Design Pattern in OODP

  • August 26, 2025
  • Factory Method Design Pattern / Object Oriented Design Patterns
Factory Method is a creational design pattern that deals with the object creation. It separates the object creation logic from the client code, which makes the system more flexible and maintainable. Instead of instantiating objects directly using a constructor, it passes the responsibility to another method, which is called a factory method. In contrast, if […]
DSA Sheet

Find Intersection of Two Singly Linked Lists

  • March 11, 2025
  • Data Structure / Google
You are given two singly linked lists that intersect at some node. Your task is to find and return the first intersecting node.
DSA Sheet

Minimum Cost to Paint Houses with K Colors

  • March 9, 2025
  • Data Structure / dsa / Facebook
A builder plans to construct N houses in a row, where each house can be painted in K different colors. The goal is to minimize the total painting cost, ensuring that no two adjacent houses have the same color.
DSA Sheet

Longest Absolute Path in File System Representation

  • February 19, 2025
  • dsa / Google
Find the length of the longest absolute path to a file within the abstracted file system. The length is measured in characters.
DSA Sheet

Efficient Order Log Storage

  • February 6, 2025
  • Data Structure / dsa / Twitter
You manage an e-commerce website and need to keep track of the last N order IDs in a log. Design a data structure that supports the following operations efficiently:
DSA Sheet

Select a Random Element from a Stream

  • February 3, 2025
  • Algorithm / dsa / Twitter
You are given a stream of elements that is too large to fit into memory. Write an algorithm to select a random element from the stream with equal probability
DSA Sheet

Estimate π Using Monte Carlo Method

  • January 17, 2025
  • dsa / DSA Sheet / Google
The formula for the area of a circle is given by πr². Use the Monte Carlo method to approximate the value of π to three decimal places.
DSA Sheet

Longest Substring with K Distinct Characters

  • January 16, 2025
  • Amazon / dsa / DSA Sheet
Given an integer k and a string s, write a function to determine the length of the longest substring in s that contains at most k distinct characters.
DSA Sheet

Staircase Climbing Ways

  • January 11, 2025
  • Amazon / Data Structure / dsa
There is a staircase with N steps, and you can ascend either 1 step or 2 steps at a time. Write a function to calculate the number of unique ways to climb the staircase. The sequence of steps matters.

Posts pagination

Page Number1 Page Number2 … Page Number59

Advertisement

Recent Posts

  • What is object oriented design patterns
  • Factory Method Design Pattern in OODP
  • Find Intersection of Two Singly Linked Lists
  • Minimum Cost to Paint Houses with K Colors
  • Longest Absolute Path in File System Representation
Copyright : coderz.py
Verified by MonsterInsights