Skip to content

Welcome to Tech by Example

Menu
  • Home
  • Posts
  • System Design Questions
Menu

Author: admin

Program for ugly number 2 in Go (Golang)

Posted on August 13, 2022August 13, 2022 by admin

Overview An ugly number is a number whose prime factors are limited to 2,3 and 5. We have already seen a program where given a number n returns true if it is…

Program for an ugly number

Posted on August 12, 2022August 12, 2022 by admin

Overview An ugly number is a number whose prime factors are limited to 2,3 and 5. Given a number, n return true if it is an ugly number otherwise return false. Example…

Is Graph Bipartite Program

Posted on August 1, 2022August 1, 2022 by admin

Overview An undirected graph is given. A  graph is said to be bipartite if the nodes of the graph can be partitioned into two subsets such that every edge connects one node…

Binary Tree Maximum Path Sum Program

Posted on July 30, 2022July 30, 2022 by admin

Overview A  binary tree is given. The objective is to find the maximum Path Sum in that binary tree.  A path in a binary tree is a sequence of nodes that are connected…

Sort characters by frequency

Posted on July 28, 2022July 28, 2022 by admin

Overview An input string is given. The objective is to sort the string based on frequency. We have to sort based on decreasing order of the frequency of characters. Let’s understand it…

Program for Income Tax Paid

Posted on July 26, 2022July 26, 2022 by admin

Overview A 2d array is given which represents the bracket of income tax. The input array is brackets where which means that ith bracket has an upper bound of upperi and is…

Check If N and Its Double Exist

Posted on July 25, 2022July 25, 2022 by admin

Overview An array is given. The objective is to find if there exists any number for which it’s double also exists. Example 1 Example 2 The idea is to use a map…

Program for Pascal’s Triangle

Posted on July 25, 2022July 25, 2022 by admin

Overview The objective is to find the print n number of rows of Pascal’s triangle. The number n is given as an input to the program Example 1 Example 2 Refer to…

Longest Consecutive Sequence Program

Posted on July 21, 2022July 21, 2022 by admin

Overview An integer array is given. Find the length of the longest consecutive sequence in it. Let’s see an example to understand it Example 1 Example 2 The naive idea is to…

Print all Binary Tree Paths

Posted on July 20, 2022July 20, 2022 by admin

Overview The root of a tree is given. The objective is to print all the tree paths starting with the root. Example Output: Program Below is the program for the same Output:…

Posts pagination

Previous 1 … 3 4 5 … 16 Next
©2025 Welcome to Tech by Example | Design: Newspaperly WordPress Theme