Skip to content

Welcome to Tech by Example

Menu
  • Home
  • Posts
  • System Design Questions
Menu

Posts

Fix LoadError cannot load such file — scanf in Ruby 2.7.0

Posted on October 11, 2022October 11, 2022 by admin

Overview The scanf gem is no longer a bundled gem that comes with Ruby Installation. It has to be specifically installed. Simply add the below line to your Gemfile and then do…

Fix LoadError cannot load such file — e2mmap in Ruby 2.7.0

Posted on October 11, 2022October 11, 2022 by admin

Overview The e2mmap gem is no longer a bundled gem that comes with Ruby Installation. It has to be specifically installed. Simply add below line to your Gemfile and then do ‘bundle’…

Delete a nested key in a hash in Ruby Language

Posted on October 5, 2022October 5, 2022 by admin

Overview It is possible to delete nested keys in a hash in Ruby Language. Let’s see examples One Level Nested Key Here is the code to delete the key in a hash…

Ruby regex match in an if check

Posted on October 5, 2022October 5, 2022 by admin

Overview We can use the below sign to have ruby regex match in an if check Program Let’s see an example of the same Output Note: Check out our system design tutorial…

Program for Longest Word in Dictionary through Deleting

Posted on September 30, 2022September 30, 2022 by admin

Overview A string and a dictionary of words are given. The objective is to find the longest word in the dictionary which is present as a subsequence in the given string. If the…

Traverse three arrays together in Ruby Language

Posted on September 24, 2022September 24, 2022 by admin

Overview It is possible to traverse three arrays at once in Ruby. It can be done using the .zip function.  Here is the doc link for the zip function https://ruby-doc.org/core-2.0.0/Array.html#method-i-zip Let’s see…

Remove Linked List Elements Program

Posted on September 15, 2022September 15, 2022 by admin

Overview Given a linked list and a value, delete all nodes from the linked list whose value is equal to the given value. Example 1 Example 2 Program Below is the program…

Understanding Directory-Based Sharding

Posted on August 29, 2022August 29, 2022 by admin

Overview In this tutorial, we will try to understand directory-based sharding. Other than directory-based sharding there are two types of sharding as well Key Based Sharding Range Based Sharding Directory-based sharding keeps…

Count unguarded cells program

Posted on August 25, 2022August 25, 2022 by admin

Overview Two integers m and n are given which represent an m*n grid. Other than that two 2D integer arrays are also given guards where guards[i] = [rowi , columni]. It represents…

Recover Binary Search Tree Program

Posted on August 19, 2022August 19, 2022 by admin

Overview The root of a binary search tree is given. Two nodes of the binary search tree have been swapped. We need to fix the binary tree and recover the original structure…

Posts pagination

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