Skip to content

Instantly share code, notes, and snippets.

View RadwaKamal's full-sized avatar
🦚

Radwa Kamal RadwaKamal

🦚
  • Cairo, EG
View GitHub Profile
@RadwaKamal
RadwaKamal / change_convention.py
Created March 17, 2016 11:51
A simple python script to convert naming convention from lower camel case to snake case in a file.
#!/usr/bin/env python
#Simple python script to change lower camel case strings in a file to snake case
import sys
import re
#detect if the string is lower camel case
def is_camel(word):
bol = re.search('\w([a-z][A-Z])', word)
return bol
@RadwaKamal
RadwaKamal / task.sh
Last active December 10, 2016 13:15
Shell script to generate <tag_name>.md file automatically for a jekyll blog.
#!/bin/bash
target=(_posts/*.md)
prv_last_file=`cat last_file.txt`
tag_template=`cat tag_template.md`
for ((i=${#target[@]}-1; i>=0; i--)); do
if [ "$prv_last_file" == "${target[$i]}" ]; then
echo ${target[${#target[@]}-1]} > last_file.txt
echo "We are done, Thank you!"
break
@RadwaKamal
RadwaKamal / valid-parentheses.md
Last active May 20, 2026 10:18
Valid Parentheses

Valid Parentheses

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if:

  1. Open brackets must be closed by the same type of brackets.
  2. Open brackets must be closed in the correct order.
  3. Every close bracket has a corresponding open bracket of the same type.

Examples

@RadwaKamal
RadwaKamal / longest-substring.md
Created March 30, 2026 11:08
Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters

Given a string s, find the length of the longest substring without repeating characters.

Examples

"abcabcbb"  → 3  ("abc")
"bbbbb"     → 1  ("b")
"pwwkew"    → 3  ("wke")
"" → 0
@RadwaKamal
RadwaKamal / system-design.md
Last active May 21, 2026 12:38
ML Task System Design

Design a system where an admin can trigger a machine learning model training job from a desktop application and check on its status later. Because training can take several minutes, this does not need to be real-time.

To give you some architectural context, the system is split into two parts:

  • A Core Service: This is our main backend API. It handles user requests, and receives the initial 'Train' request from the desktop app.

  • An ML Service: This is a separate service responsible for training the ML model.


Your Task