Skip to content

Instantly share code, notes, and snippets.

View DhavalDalal's full-sized avatar
🇮🇳
https://twitter.com/softwareartisan

Dhaval Dalal DhavalDalal

🇮🇳
https://twitter.com/softwareartisan
View GitHub Profile
@DhavalDalal
DhavalDalal / Attention.md
Last active September 15, 2022 08:58
Identify the Code-Smell?

Identify the Code Smells

  • Can you identify the code-smell?
  • How will you Refactor it?
@DhavalDalal
DhavalDalal / Attention.md
Created April 17, 2020 10:54
Refactoring - ocp
  • How can I use circle, square, triangle and any shape that comes in future to draw?
  • How can I draw pictures that are composed from triangles, squares, or circles or any future shape?
  • I want to make sure that always circles are drawn first, squares are second and triangles are third?
@DhavalDalal
DhavalDalal / Attention.md
Last active February 17, 2022 10:24
Thread-Safe Counter (Java)

Thread-Safe Counter (Java)

@DhavalDalal
DhavalDalal / Attention.md
Created June 2, 2019 10:59
Paper Scissor Rock (C#)

Paper, Scissor, Rock (C#)

Problem Statement

Two players choose one of rock, paper and scissors after counting to three and making one of these gestures:

  • A clenched fist representing a rock.

  • A flat hand representing a piece of paper.

@DhavalDalal
DhavalDalal / Attention.md
Created June 2, 2019 10:30
Shapes Refactoring - C#

Shapes Refactoring (C#)

                          +---------------+
                          |    Shape3d    |
                          +---------------+
                          | SurfaceArea() |<-------------------------------+
                          | Volume()      |                                |
                          +---------------+                                |
                                  ^                                        |
@DhavalDalal
DhavalDalal / Attention.md
Last active May 19, 2019 06:28
Smelly Locks (C#)

Smelly Locks (C#)

  • Create a Console app project.
  • Make Sure that the code compiles and runs.
  • If you are within a proxy, you can do it programmatically like this:
    System.Net.WebRequest.DefaultWebProxy = new WebProxy(ip,port); 
    
@DhavalDalal
DhavalDalal / Attention.md
Last active August 11, 2019 05:39
Smelly ODBC Code (C#)

Smelly ODBC Code (C#)

You can use any DB Server for creating the Feedback Table. To help with MySQL database:

  • Run the ddl.sql
  • Run the dml.sql

NOTE: For other databases, please consult the respective help.

@DhavalDalal
DhavalDalal / Attention.md
Created May 17, 2019 11:19
Logger Refactoring (C#)

Logger Refactoring (C#)

@DhavalDalal
DhavalDalal / 1_README.md
Created May 15, 2019 11:32
Bank Maker-Checker Refactoring (C#)

Bank Maker-Checker Refactoring (C#)

SMS and Email Notification (Scala)

Notification.scala contains all the necessary implementations and a couple of missing ones. Using Scala's Futures implement the problem parts below:

  • Part 1

    • Send notification for debit or credit transactions on a customer’s bank account.
    • Implement either credit or debit operation.
    • You must send both the messages SMS and Email upon a successful transaction.
  • Part 2