ProjectWithSourceCodes
1.03K subscribers
332 photos
8 videos
53 files
1.37K links
Free Source Code Projects for Students šŸš€ | Python | Java | Android | Web Dev | AI/ML | Final Year Projects | BCA • BTech • MCA | Interview Prep | Job Alerts

Website: https://updategadh.com
Download Telegram
Project: ✨ AI-Based Job Recommendation System

šŸ“Š Overview:
An intelligent system that recommends jobs to users based on their skills, resume, and preferences using Machine Learning.

šŸ” Advanced Features:
āœ… Resume Parsing using NLP
āœ… Skill Matching Algorithm
āœ… Job Ranking & Filtering
āœ… Admin Panel to Post Jobs
āœ… Python + Flask + Scikit-Learn + MongoDB

šŸ‘Øā€šŸŽ“ Ideal for:
āœ… Final year project
āœ… BCA / BTech / MCA students
āœ… Resume booster for placements

šŸ“„ Get full source code, report & video demo
šŸ‘‰ Visit: Updategadh.com


#AIProjects #FinalYearProject #Updategadh #ProjectWithSourceCodes #AdvancedCoding #PlacementReady #PythonML
šŸš€ Advanced Coding Interview Questions with Answers (Part 1)

1ļøāƒ£ Find the Longest Substring Without Repeating Characters

šŸ‘‰ Given a string, find the length of the longest substring containing no duplicate characters.

def longest_unique_substring(s):
seen = set()
left = 0
max_length = 0

for right in range(len(s)):
while s[right] in seen:
seen.remove(s[left])
left += 1

seen.add(s[right])
max_length = max(max_length, right - left + 1)

return max_length

print(longest_unique_substring("abcabcbb"))


šŸ“Œ Output:

3


ā± Time Complexity: O(n)
šŸ’¾ Space Complexity: O(n)

---

2ļøāƒ£ Find the Kth Largest Element in an Array

šŸ‘‰ Find the Kth largest element without completely sorting the array.

import heapq

def kth_largest(nums, k):
heap = nums[:k]
heapq.heapify(heap)

for num in nums[k:]:
if num > heap[0]:
heapq.heapreplace(heap, num)

return heap[0]

print(kth_largest([3, 2, 1, 5, 6, 4], 2))


šŸ“Œ Output:

5


ā± Time Complexity: O(n log k)
šŸ’¾ Space Complexity: O(k)

---

3ļøāƒ£ Detect a Cycle in a Linked List

šŸ‘‰ Determine whether a linked list contains a cycle using Floyd's Cycle Detection Algorithm.

def has_cycle(head):
slow = head
fast = head

while fast and fast.next:
slow = slow.next
fast = fast.next.next

if slow == fast:
return True

return False


šŸ’” The slow pointer moves one step while the fast pointer moves two steps.

ā± Time Complexity: O(n)
šŸ’¾ Space Complexity: O(1)

---

4ļøāƒ£ Find the Maximum Subarray Sum

šŸ‘‰ Find the contiguous subarray with the largest sum using Kadane's Algorithm.

def max_subarray_sum(nums):
current = nums[0]
maximum = nums[0]

for num in nums[1:]:
current = max(num, current + num)
maximum = max(maximum, current)

return maximum

print(max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4]))


šŸ“Œ Output:

6


ā± Time Complexity: O(n)
šŸ’¾ Space Complexity: O(1)

---

5ļøāƒ£ Merge Overlapping Intervals

šŸ‘‰ Given a collection of intervals, merge all overlapping intervals.

def merge_intervals(intervals):
intervals.sort(key=lambda x: x[0])
merged = []

for start, end in intervals:
if not merged or start > merged[-1][1]:
merged.append([start, end])
else:
merged[-1][1] = max(merged[-1][1], end)

return merged

print(merge_intervals([[1, 3], [2, 6], [8, 10], [9, 12]]))


šŸ“Œ Output:

[[1, 6], [8, 12]]


ā± Time Complexity: O(n log n)
šŸ’¾ Space Complexity: O(n)

---

šŸ’¬ Save this for your advanced coding interview preparation!

šŸ”„ Part 2 will cover 5 harder problems on Binary Search, Dynamic Programming, Graphs, Backtracking & Sliding Window.

#Coding #CodingInterview #Python #DSA #AdvancedCoding #Algorithms #DynamicProgramming #Graphs #Programming #TechInterview
šŸš€ Advanced Coding Interview Questions with Answers (Part 3)
1ļøāƒ£1ļøāƒ£ Find the Top K Frequent Elements
šŸ‘‰ Given an array, return the k elements that appear most frequently.
from collections import Counter

def top_k_frequent(nums, k):
frequency = Counter(nums)
return [num for num, count in frequency.most_common(k)]

print(top_k_frequent([1, 1, 1, 2, 2, 3], 2))

šŸ“Œ Output:
[1, 2]

ā±ļø Time Complexity: O(n log n)
šŸ’¾ Space Complexity: O(n)
1ļøāƒ£2ļøāƒ£ Generate All Permutations of a String
šŸ‘‰ Generate every possible arrangement of the characters in a string using Backtracking.
def permutations(s):
result = []

def backtrack(path, remaining):
if not remaining:
result.append("".join(path))
return

for i in range(len(remaining)):
backtrack(
path + [remaining[i]],
remaining[:i] + remaining[i + 1:]
)

backtrack([], s)
return result

print(permutations("ABC"))

šŸ“Œ Output:
['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']

ā±ļø Time Complexity: O(n Ɨ n!)
šŸ’¾ Space Complexity: O(n Ɨ n!)
1ļøāƒ£3ļøāƒ£ Find the Minimum Coins for a Given Amount
šŸ‘‰ Given coin denominations, find the minimum number of coins required to make a target amount.
def min_coins(coins, amount):
dp = [float("inf")] * (amount + 1)
dp[0] = 0

for current in range(1, amount + 1):
for coin in coins:
if coin <= current:
dp[current] = min(
dp[current],
dp[current - coin] + 1
)

return dp[amount] if dp[amount] != float("inf") else -1

print(min_coins([1, 2, 5], 11))

šŸ“Œ Output:
3

šŸ’” 5 + 5 + 1 = 11
ā±ļø Time Complexity: O(amount Ɨ number of coins)
šŸ’¾ Space Complexity: O(amount)
1ļøāƒ£4ļøāƒ£ Find the Maximum Product Subarray
šŸ‘‰ Find the contiguous subarray whose elements have the largest product.
def max_product_subarray(nums):
current_max = nums[0]
current_min = nums[0]
result = nums[0]

for num in nums[1:]:
if num < 0:
current_max, current_min = current_min, current_max

current_max = max(num, current_max * num)
current_min = min(num, current_min * num)

result = max(result, current_max)

return result

print(max_product_subarray([2, 3, -2, 4]))

šŸ“Œ Output:
6

šŸ’” The maximum product comes from [2, 3].
ā±ļø Time Complexity: O(n)
šŸ’¾ Space Complexity: O(1)
1ļøāƒ£5ļøāƒ£ Implement an LRU Cache
šŸ‘‰ An LRU (Least Recently Used) Cache removes the item that has not been accessed for the longest time when the cache reaches its capacity.
from collections import OrderedDict

class LRUCache:
def __init__(self, capacity):
self.capacity = capacity
self.cache = OrderedDict()

def get(self, key):
if key not in self.cache:
return -1

self.cache.move_to_end(key)
return self.cache[key]

def put(self, key, value):
if key in self.cache:
self.cache.move_to_end(key)

self.cache[key] = value

if len(self.cache) > self.capacity:
self.cache.popitem(last=False)

šŸ“Œ Example:
cache = LRUCache(2)

cache.put(1, "A")
cache.put(2, "B")

print(cache.get(1))

cache.put(3, "C")

print(cache.get(2))

šŸ“Œ Output:
A
-1

ā±ļø Average Time Complexity: O(1) for get() and put()
šŸ’¾ Space Complexity: O(capacity)
šŸ’¬ Save this for your advanced coding interview preparation!
šŸ”„ Part 4 will cover 5 advanced problems on Dijkstra's Algorithm, Trie, Union-Find, Matrix & Dynamic Programming.
#Coding #CodingInterview #Python #DSA #AdvancedCoding #Algorithms #DynamicProgramming #Graph #DataStructures #Programming
šŸš€ Advanced Coding Interview Questions with Answers (Part 4)
1ļøāƒ£6ļøāƒ£ Find the Shortest Path Using Dijkstra's Algorithm
šŸ‘‰ Dijkstra's Algorithm finds the shortest path from a source node to other nodes in a graph with non-negative edge weights.
import heapq

def dijkstra(graph, start):
distances = {node: float("inf") for node in graph}
distances[start] = 0

heap = [(0, start)]

while heap:
distance, node = heapq.heappop(heap)

if distance > distances[node]:
continue

for neighbor, weight in graph[node]:
new_distance = distance + weight

if new_distance < distances[neighbor]:
distances[neighbor] = new_distance
heapq.heappush(heap, (new_distance, neighbor))

return distances

ā±ļø Time Complexity: O((V + E) log V)
1ļøāƒ£7ļøāƒ£ Implement a Trie
šŸ‘‰ A Trie is a tree-based data structure commonly used for prefix searching and autocomplete.
class TrieNode:
def __init__(self):
self.children = {}
self.is_end = False


class Trie:
def __init__(self):
self.root = TrieNode()

def insert(self, word):
node = self.root

for char in word:
if char not in node.children:
node.children[char] = TrieNode()

node = node.children[char]

node.is_end = True

def search(self, word):
node = self.root

for char in word:
if char not in node.children:
return False
node = node.children[char]

return node.is_end

ā±ļø Time Complexity: O(L) per operation
L = length of the word
1ļøāƒ£8ļøāƒ£ Find Connected Components Using Union-Find
šŸ‘‰ Union-Find, also called Disjoint Set Union (DSU), efficiently manages groups of connected elements.
class DSU:
def __init__(self, n):
self.parent = list(range(n))

def find(self, x):
if self.parent[x] != x:
self.parent[x] = self.find(self.parent[x])
return self.parent[x]

def union(self, a, b):
root_a = self.find(a)
root_b = self.find(b)

if root_a != root_b:
self.parent[root_b] = root_a

šŸ’” It is commonly used in graph connectivity and Kruskal's algorithm.
ā±ļø Amortized Time: Nearly O(1) per operation with path compression and union by rank/size.
1ļøāƒ£9ļøāƒ£ Rotate a Matrix 90 Degrees Clockwise
šŸ‘‰ Rotate an n Ɨ n matrix 90 degrees clockwise in place.
def rotate(matrix):
n = len(matrix)

for i in range(n):
for j in range(i + 1, n):
matrix[i][j], matrix[j][i] = (
matrix[j][i],
matrix[i][j]
)

for row in matrix:
row.reverse()

return matrix

matrix = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]

print(rotate(matrix))

šŸ“Œ Output:
[[7, 4, 1],
[8, 5, 2],
[9, 6, 3]]

ā±ļø Time Complexity: O(n²)
šŸ’¾ Space Complexity: O(1)
2ļøāƒ£0ļøāƒ£ Solve the 0/1 Knapsack Problem
šŸ‘‰ Given items with weights and values, find the maximum value that can be placed in a bag with limited capacity.
def knapsack(weights, values, capacity):
dp = [0] * (capacity + 1)

for i in range(len(weights)):
for w in range(capacity, weights[i] - 1, -1):
dp[w] = max(
dp[w],
dp[w - weights[i]] + values[i]
)

return dp[capacity]

print(knapsack([1, 3, 4], [15, 50, 60], 4))

šŸ“Œ Output:
65

ā±ļø Time Complexity: O(n Ɨ capacity)
šŸ’¾ Space Complexity: O(capacity)
šŸ’¬ Save this for your advanced coding interview preparation!
šŸ”„ Next: Generative AI – Part 9
#Coding #DSA #Python #AdvancedCoding #Algorithms #DynamicProgramming #Graphs #InterviewQuestions