Posts

Python Coding Interview Questions (Beginner to Advanced)

#Find Squares in Array nums = [1, 2, 3] squared = [n ** 2 for n in nums] print(squared) —------------------Write a function that takes a string and returns it reversed. def FirstReverse(s: str) -> str: return s[::-1] # Reverses the string using slicing, slice syntax is: s[start:stop:step] print(FirstReverse("hello")) # Output: "olleh" —------------- # Get input from the user user_string = input("Enter a string to reverse: ").strip() #.strip() removes any leading/trailing whitespace # Check if input is empty if not user_string: print("Error: You entered an empty string. Please try again.") else: # Reverse the string using slicing reversed_string = user_string[::-1] print("The reversed string is:", reversed_string) —---------------- Find the Second Largest Number def SecondLargest(nums: list[int]) -> int: nums = list(set(nums)) # remove duplicates nums.sort() return nums[-2] if len(nums) >= 2 el...

🌐 Build & Deploy a Website with Node.js and Express

Image
# 🌐 Build & Deploy a Website with Node.js and Express > Full Step-by-Step Tutorial Project This project demonstrates how to build and deploy a simple yet powerful website using **Node.js** and **Express.js**. It includes basic routing, serving static files, and deploying to a live server. --- ## 🚀 Features - Express server setup - Static file hosting (HTML, CSS, JS) - Dynamic routes using Express - Organized project structure - Ready for deployment to platforms like Render, Vercel, or Heroku --- ## 📁 Project Structure nodeexpress/ ├── static/ │ ├── index.html │ ├── about.html │ └── style.css ├── server.js └── package.json --- ## 🛠️ Technologies Used - [Node.js](https://nodejs.org/) - [Express.js](https://expressjs.com/) - HTML5, CSS3 - [Render](https://render.com/) / [Vercel](https://vercel.com/) for deployment --- ## 🧑‍💻 Getting Started ### 1. Clone the repo ```bash git clone https://github.com/manibalasinha/nodeexpress.git cd nodeexpress 2...

✨ Build & Deploy a Stunning ReactJS UI Step by Step (Full Tutorial + Free Hosting)

Image
✨ Build & Deploy a Stunning ReactJS UI Step by Step (Full Tutorial + Free Hosting) Want to build a beautiful ReactJS frontend and deploy it for free? You're in the right place. In this tutorial, we'll walk through every step to design, build, and deploy a stunning React app — no prior experience needed. 🔧 What We'll Cover ✅ Setting up your React app (no boilerplate!) 🎨 Designing a beautiful UI with Tailwind CSS 🔗 Connecting components with state & props 🚀 Free deployment to Vercel 🧠 Pro tips for performance and SEO 🛠️ Step 1: Create a New React App First, make sure you have Node.js installed. Then open your terminal and run: npx create-react-app my-react-ui cd my-react-ui npm start Your browser should now open to http://localhost:3000/ . 🎨 Step 2: Style with Tailwind CSS Tailwind makes it easy to create professional UI fast. Install Tailwind: npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p Update tail...

React + TypeScript Setup and Usage Guide

Image
  React + TypeScript Setup and Usage Guide 1. Create React App with TypeScript npx create-react-app react-ts-app --template typescript cd react-ts-app npm start This sets up a React project with TypeScript ready out of the box. tsconfig.json will be auto-generated. The default source files will be .tsx instead of .js . 2. Manual Setup (if starting with JavaScript project and adding TS) If you started with a plain React app and want to add TypeScript later: npm install --save typescript @types/node @types/react @types/react-dom @types/jest Rename .js and .jsx files in src/ to .ts and .tsx respectively. Run npm start , and CRA will generate tsconfig.json automatically. React Scripts version 2.1.1+ supports this smooth TS integration. 3. Typical package.json scripts "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", ...

Adding Job Creation Form & Bootstrap Styling

  Adding Job Creation Form & Bootstrap Styling 1. Create a Django Form in jobs/forms.py from django import forms from .models import Job class JobForm(forms.ModelForm):     class Meta:         model = Job         fields = ['summary', 'image'] 2. Create a View to Handle Job Creation in jobs/views.py Add this view below your existing ones: from django.shortcuts import redirect from .forms import JobForm def create_job(request):     if request.method == 'POST':         form = JobForm(request.POST, request.FILES)         if form.is_valid():             form.save()             return redirect('home')  # After saving, redirect to homepage     el...