Leetcode - 670. Maximum Swap
DescriptionYou are given an integer num. You can swap two digits at most once to get the maximum valued number. Return the maximum valued number you can get. 12345Example 1:Input: num = 2736Output: 7236Explanation: Swap the number 2 and the number 7. 12345Example 2:Input: num = 9973Output: 9973Explanation: No swap. 12Constraints:0 <= num <= 108 Approach1234567891011121314151617181920class Solution: def maximumSwap(self, num: int) -> int: result = num num_list = list(...
interview question of Java Backend
Interview QuestionsCore Java (OOPs, Collections, Concurrency Basics)Explain difference between HashMap, HashTable, and ConcurrentHashMap. Feature HashMap Hashtable ConcurrentHashMap Thread Safety Not thread-safe Thread-safe (synchronized methods) Thread-safe (lock segmentation / fine-grained locking) Null Keys/Values Allows one null key and multiple null values Does not allow any null keys/values Does not allow null keys/values Performance Faster (no synchronization overhead) Slowe...
terraform
TerraformDocumentationterraform TofuDocumentationtofu
interview question of anthrapic
Question 1: Concurrent Web Crawler ImplementationDesign and implement a multi-threaded web crawler that efficiently crawls a specific domain and counts unique URLs Requirements: Handle circular references and invalid URLs implement rate limiting and exponential back off Process robots.txt compliance Support different URL schemes and redirects Optimize for memory usage with large datasets Overview12345678910111213141516171819[Seed URLs] | [Frontier in-memory queue] <--- [Persistent ov...
Transformation
What is data transformationConditional Split TransformationThe conditional split transformation routes data rows to different streams based on matching conditions The conditional split transformation is similar to a CASE decision structure in a programming language. The transformation evaluates expressions, and based on the results, directs the data row to the specified stream Exists TransformationThe exists transformation is a row filtering transformation that checks whether your data exists...
Azure Data Factory – Core Concepts Explained
Azure Data Factory OverviewAzure Data Factory (ADF) is a fully managed, cloud-based data integration service that allows you to create, schedule, and orchestrate data workflows.It is commonly used for ETL / ELT pipelines, enabling data movement and transformation across different data sources at scale. Resource GroupA Resource Group is a logical container in Azure that holds related resources for an Azure solution. In Azure Data Factory, the resource group typically contains: Azure Data Fact...
Activity
What is ActivityCopy ActivityIn Azure Data Factory and Synapse pipelines, you can use the Copy activity to copy data among stores located on-premises and in the cloud. After you copy the data, you can use otheer activities to further transform and analyze it. Append Variable ActivityUse the Append Variable activity to add a value to an existing array variable. Delete ActivityDelete files or folders from on-premises storage stores or cloud storage store. This activity is used to clean up or ac...
Docker Compose Install Postgres
Installing Postgres using Docker Compose1234567891011121314151617version: "3.9"services: postgres: image: postgres:13.22-trixie container_name: postgres_13 restart: always environment: POSTGRES_USER: root POSTGRES_PASSWORD: root POSTGRES_DB: mydb ports: - "5432:5432" volumes: - ./data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U root"]
Docker Compose Install Mysql
Installing Mysql using Docker Compose12345678910111213141516version: '3'services: mysql: image: mysql:8.0.18 container_name: mysql8 environment: - MYSQL_ROOT_PASSWORD=root# - TZ=Asia/Shanghai volumes: - ./log:/var/log/mysql - ./data:/var/lib/mysql - ./conf/conf.d:/etc/mysql/conf.d # - /etc/localtime:/etc/localtime:ro ports: - 3306:3306 restart: always
Docker Compose Install MongoDB
Installing MongoDB using Docker Compose1234567891011121314151617181920212223242526version: "3.8"services: mongodb: image: mongo container_name: mongodb ports: - 27017:27017 volumes: - ./database:/data/db environment: - MONGO_INITDB_ROOT_USERNAME=admin - MONGO_INITDB_ROOT_PASSWORD=adminpwd # mongo-express: # image: mongo-express # container_name: mongo-express # restart: always # ports: # - 8081:8081 # environment: # - ME_...








