0% found this document useful (0 votes)
2 views9 pages

Coding PYTHON Coding Report

The coding interview report evaluates a candidate's performance in a Python coding interview, scoring 73% overall with two out of three questions passed. The candidate demonstrated strengths in string manipulation and algorithmic techniques but struggled with problem comprehension, leading to an unrelated solution for one question. Recommendations for improvement include enhancing problem understanding, developing manual sorting algorithms, and better handling of edge cases.

Uploaded by

Sharvesh S
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

Coding PYTHON Coding Report

The coding interview report evaluates a candidate's performance in a Python coding interview, scoring 73% overall with two out of three questions passed. The candidate demonstrated strengths in string manipulation and algorithmic techniques but struggled with problem comprehension, leading to an unrelated solution for one question. Recommendations for improvement include enhancing problem understanding, developing manual sorting algorithms, and better handling of edge cases.

Uploaded by

Sharvesh S
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Prepverse In Association with

Coding Interview Report

Interview Overview Overall Score


Coding : PYTHON

Started: April 23rd, 2026


Ended: April 23rd, 2026
Duration: 20 minutes
73%

3/3 2/3
Qns Attempted Qns Passed

Overall Status: NEUTRAL

AI Interview Analysis
The candidate demonstrates a solid understanding of Python programming and proficiency
in middle-tier algorithmic problems, evidenced by full passing of two out of three challenging
coding questions during the interview. However, the candidate failed to adequately address one
question due to submitting unrelated code, which indicates an area needing improvement in
problem comprehension. Given their performance in the remaining questions, they are suitable
for a position requiring mid-level Python expertise.

Strengths Areas for Improvement


• Effective utilization of stack data structure in • Improve comprehension of problem require-
Question 2 to solve a string manipulation task. ments and constraints to match the implementa-
• Application of two-pointer techniques in Ques- tion with the task.
tion 1 submitted code, albeit unrelated to the • Develop and test manual sorting algorithms such
prompt. as merge sort to adhere to constraints without
• Provision of logical comments suggesting the using Python's built-in sorted function.
use of merge sort in Question 3. • Enhance error handling and edge case consid-
eration, specifically in aligning inputs and outputs
as specified by example cases.

Proficient Topics

String manipulation techniques Greedy algorithms Basic sorting concepts

Code Quality Rating:6/10


Coding Problems
1. Reverse Vowels of a String EASY FAILED 2/3 Passed

<p>Given a string <code>s</code>, reverse only all the vowels in the string and
return it.</p><p>The vowels are <code>'a'</code>, <code>'e'</code>, <code>'i'</code>,
<code>'o'</code>, and <code>'u'</code>, and they can appear in both lower and upper
cases, more than once.</p><p>&nbsp;</p><p><strong>Example 1:</strong></p><p><strong>In-
put:</strong> s = "IceCreAm"</p><p><strong>Output:</strong> "AceCreIm"</p><p><strong>Ex-
planation:</strong></p><p>The vowels in <code>s</code> are <code>['I', 'e', 'e', 'A']</code>.
On reversing the vowels, s becomes <code>"AceCreIm"</code>.</p><p><strong>Exam-
ple 2:</strong></p><p><strong>Input:</strong> s = "leetcode"</p><p><strong>Output:</strong>
"leotcede"</p><p>&nbsp;</p><p><strong>Constraints:</strong></p><ul><li><p><code>1 &lt;=
[Link] &lt;= 3 * 105</code></p></li><li><p><code>s</code> consist of <strong>printable
ASCII</strong> characters.</p></li></ul><p></p>

Two Pointers String

Time Complexity Total Test Cases Space Complexity


Not applicable 3 Not applicable

Test Cases Passed Total Memory Used Total Execution Time


2 4404 0.087

Test Case Results

Status Input Output Expected Time Memory

passed [1],1,[],0 [1] [1] 0.03 4228

passed [0],0,[1],1 [1] [1] 0.027 4404

failed [1,2,3,0,0,0],3,[2,5,6],3 [1, 2, 2, 3, 5, 6] [1,2,2,3,5,6] 0.03 4016

AI Feedback for this Question

The submitted code addresses a merging problem for two sorted arrays but does not relate to the
task of reversing vowels in a string. It is non-functional for the given problem and requires
a complete implementation.

### Code Strengths


- Demonstrates understanding of in-place array manipulation.
- Implements a two-pointer approach effectively for merging arrays.

### Areas for Improvement


- The code provided is unrelated to the problem statement of reversing vowels in a string.
- A new implementation specific to the problem requirements must be developed.
- Ensure alignment of logic with the constraints and examples provided in the problem
description.
Submitted Code (Python (3.8.1))

class Solution:
def merge(self, nums1, m, nums2, n):
"""
Do not return anything.
Modify nums1 in-place.
"""
i = m - 1
j = n - 1
k = m + n - 1

while i >= 0 and j >= 0:


if nums1[i] > nums2[j]:
nums1[k] = nums1[i]
i -= 1
else:
nums1[k] = nums2[j]
j -= 1
k -= 1
while j >= 0:
nums1[k] = nums2[j]
j -= 1
k -= 1
2. Remove Duplicate Letters MEDIUM PASSED 3/3 Passed

<p>Given a string <code>s</code>, remove duplicate letters so that every letter appears once
and only once. You must make sure your result is <span data-keyword="lexicographically-small-
er-string"><strong>the smallest in lexicographical order</strong></span> among all possible re-
sults.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;bcabc&quot;
<strong>Output:</strong> &quot;abc&quot;
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> s = &quot;cbacdcbc&quot;
<strong>Output:</strong> &quot;acdb&quot;
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
<li><code>1 &lt;= [Link] &lt;= 10<sup>4</sup></code></li>
<li><code>s</code> consists of lowercase English letters.</li>
</ul>

<p>&nbsp;</p>
<p><strong>Note:</strong> This question is the same as 1081:
<a href="[Link] tar-
get="_blank">[Link]

String Stack Greedy Monotonic Stack

Time Complexity Total Test Cases Space Complexity


O(N) 3 O(N)

Test Cases Passed Total Memory Used Total Execution Time


3 3372 0.06

Test Case Results


Status Input Output Expected Time Memory

passed cdadabcc adbc adbc 0.02 3260

passed cbacdcbc acdb acdb 0.02 3296

passed bcabc abc abc 0.02 3372

AI Feedback for this Question

The submitted code correctly implements the solution for removing duplicate letters while
ensuring the result is the smallest lexicographical order. It passes all provided test cases
efficiently and demonstrates a solid understanding of the problem requirements.

### Code Strengths


- The code correctly utilizes a stack-based approach to maintain the lexicographical order while
removing duplicates.
- The use of a dictionary to store the last occurrence of each character is efficient and
well-suited for the problem.
- The implementation is concise and adheres to best practices for readability and maintain-
ability.

### Areas for Improvement


- Consider adding comments to explain the logic behind key operations, such as the conditions
within the while loop, to improve code clarity.
- Ensure thorough testing with edge cases, such as strings with all identical characters or
very long strings, to validate robustness.
- Explore optimizing memory usage further, if possible, though the current implementation is
efficient.

Submitted Code (Python (3.8.1))

class Solution:
def removeDuplicateLetters(self, s: str) -> str:
last = {c: i for i, c in enumerate(s)}
stack = []
seen = set()

for i, c in enumerate(s):
if c in seen:
continue

while stack and c < stack[-1] and last[stack[-1]] > i:


[Link]([Link]())
[Link](c)
[Link](c)
return "".join(stack)
3. Sort an Array MEDIUM PASSED 3/3 Passed

<p>Given an array of integers <code>nums</code>, sort the array in ascending order and return it.</p>

<p>You must solve the problem <strong>without using any built-in</strong> functions in
<code>O(nlog(n))</code> time complexity and with the smallest space complexity possible.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> nums = [5,2,3,1]
<strong>Output:</strong> [1,2,3,5]
<strong>Explanation:</strong> After sorting the array, the positions of some numbers are not changed
(for example, 2 and 3), while the positions of other numbers are changed (for example, 1 and 5).
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> nums = [5,1,1,2,0,0]
<strong>Output:</strong> [0,0,1,1,2,5]
<strong>Explanation:</strong> Note that the values of nums are not necessarily unique.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
<li><code>1 &lt;= [Link] &lt;= 5 * 10<sup>4</sup></code></li>
<li><code>-5 * 10<sup>4</sup> &lt;= nums[i] &lt;= 5 * 10<sup>4</sup></code></li>
</ul>

Array Divide and Conquer Sorting Heap (Priority Queue) Merge Sort Bucket Sort

Radix Sort Counting Sort

Time Complexity Total Test Cases Space Complexity


Not applicable 3 Not applicable

Test Cases Passed Total Memory Used Total Execution Time


3 4520 0.112

Test Case Results


Status Input Output Expected Time Memory

passed [5,2,3,1] [1,2,3,5] [1,2,3,5] 0.037 4520

passed [5,1,1,2,0,0] [0,0,1,1,2,5] [0,0,1,1,2,5] 0.038 4412

passed [-1,2,-8,0] [-8,-1,0,2] [-8,-1,0,2] 0.037 4464

AI Feedback for this Question

The submission demonstrates an understanding of the problem requirements but does not implement
the required sorting algorithm manually as specified in the prompt. Instead, it uses Python's
built-in `sorted` function, which is not allowed per the constraints.

### Code Strengths


- The code correctly identifies the need to sort the input array and returns the sorted result.
- It includes comments suggesting an approach using merge sort, which aligns with the problem's
constraints.

### Areas for Improvement


- Implement the sorting logic manually using a suitable algorithm such as merge sort or heap
sort to meet the problem's requirements.
- Ensure the implemented algorithm achieves the specified `O(n log n)` time complexity and
minimal space usage.
- Remove the usage of built-in sorting functions to adhere to the constraints.

Submitted Code (Python (3.8.1))

from typing import List

class Solution:
def sortArray(self, nums: List[int]) -> List[int]:
"""
:param nums: List of integers
:return: Sorted list in O(n log n)
"""
# Write your logic here (Merge Sort or Heap Sort)
# def merge_sort(arr):
# if len(arr) <= 1:
# return arr
# mid = len(arr) // 2
# left = merge_sort(arr[mid])
# right = merge_sort(arr[mid:])
# return merge(left, right)

# def merge(left,right):
# res = []
# i = j = 0

# while i < len(left) and j < len(right):


# if left[i] < right[j]:
# [Link](left[i])
# i += 1
# else:
# [Link](right[j])
# j += 1
# [Link](left[i:])
# [Link](right[j:])
# return res
return sorted(nums)
# return merge_sort(nums)

You might also like