0% found this document useful (0 votes)
4 views12 pages

Coding Round Coding Report

The coding interview report indicates that the candidate passed with an overall score of 79%, demonstrating proficiency in array manipulation and linked list operations. They attempted all questions, passing 80% overall, but there are areas for improvement, particularly in handling edge cases and code readability. The report includes detailed feedback on each coding problem, highlighting strengths and suggesting improvements.

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)
4 views12 pages

Coding Round Coding Report

The coding interview report indicates that the candidate passed with an overall score of 79%, demonstrating proficiency in array manipulation and linked list operations. They attempted all questions, passing 80% overall, but there are areas for improvement, particularly in handling edge cases and code readability. The report includes detailed feedback on each coding problem, highlighting strengths and suggesting improvements.

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 Round

Started: April 21st, 2026


Ended: April 21st, 2026
Duration: 37 minutes
79%

5/5 4/5
Qns Attempted Qns Passed

Overall Status: PASSED

AI Interview Analysis
The candidate showcases capability and proficiency in several key areas, including array ma-
nipulation and linked list operations, as evident from their performance on the questions. They
attempted all questions and passed 80% overall, demonstrating a solid grasp of foundational
concepts. Although there is room for improvement, their ability to approach algorithm challenges
effectively suggests suitability for roles requiring development and problem-solving expertise.
Continued focus on refining coding practices and handling edge cases would further benefit
their career progression.
Strengths Areas for Improvement
• Efficient use of mathematical formulas for ar- • Expand practices in handling edge cases sys-
ray manipulation in Question 1, exhibiting strong tematically, as highlighted by the runtime con-
problem-solving skills. cerns in Question 2.
• Correct iterative approach to linked list oper- • Develop comments and explanations within the
ations, as demonstrated in Questions 3 and 5, code to improve readability and maintainability.
showing practical understanding of data structure
• Explore recursive methods and advanced algo-
handling.
rithm designs to complement iterative solutions
• Prompt application of dictionary-based tech- and provide deeper options for problem-solving.
niques in Question 4 for nearest duplicate calcu-
lations, indicating efficient use of data structures.

Proficient Topics
Array manipulation Linked list operations HashMap usage

Code Quality Rating:7/10


Coding Problems
1. Find Missing Number EASY PASSED 5/5 Passed

You are given an array containing n distinct numbers taken from the range 0 to n.
This means one number in the range is missing from the array.

Your task is to return the missing number.

Constraints:
The array contains n numbers and all are unique.

The numbers are in the range [0, n], so exactly one number is missing.

1 dn d 10t

Array String Bit Manipulation MATH

Time Complexity Total Test Cases Space Complexity


O(N) 5 O(1)

Test Cases Passed Total Memory Used Total Execution Time


5 4536 0.171

Test Case Results

Status Input Output Expected Time Memory

passed [3, 0, 1] 2 2 0.035 4364

passed [0, 1] 2 2 0.035 4536

passed [9,6,4,2,3,5,7,0,1] 8 8 0.035 4468

passed [0] 1 1 0.034 4368

passed [1, 2] 0 0 0.032 4476

AI Feedback for this Question

The provided solution correctly identifies the missing number in an array of distinct integers
ranging from 0 to n using a mathematical approach. It demonstrates a clear understanding of
the problem and implements an efficient solution.

### Code Strengths


- The solution utilizes the formula for the sum of the first n natural numbers, which is
computationally efficient.
- The implementation is concise and easy to understand.
- The code passes all provided test cases, demonstrating correctness.

### Areas for Improvement


- Consider adding comments to explain the mathematical formula used for clarity to readers
unfamiliar with it.
- Ensure the function handles edge cases, such as an empty array, although the constraints
specify at least one element.

Submitted Code (Python (3.8.1))

from typing import List


import sys
import json

def missingNumber(nums: List[int]) -> int:


# --- Your actual solution code will be inserted here ---
n = len(nums)
expected_sum = n * (n+1) // 2
actual_sum = sum(nums)
return expected_sum - actual_sum
2. Reverse an Array EASY FAILED 0/3 Passed

DescriptionWrite a function that takes an integer array nums as input and reverses the order of its
elements [Link] function should not return a new array; it should modify the original input
[Link] solution should run in $O(n)$ time [Link] space complexity should be $O(1)$
(constant extra space).

Array String

Time Complexity Total Test Cases Space Complexity


O(N) 3 O(1)

Test Cases Passed Total Memory Used Total Execution Time


0 4376 0.078

Test Case Results

Status Input Output Expected Time Memory

failed [1] [1] 0.023 4376

failed [10,20,30,40,50] [50,40,30,20,10] 0.03 4328

failed [1,2,3,4,5,6] [6,5,4,3,2,1] 0.025 4376

AI Feedback for this Question

The submitted code provides an implementation for reversing an array in-place, but it includes
unnecessary elements that cause runtime errors. The logic for reversing the array is correct,
but the function's interaction with input/output is problematic and not aligned with the problem
requirements.

### Code Strengths


- The logic for swapping elements to reverse the array is implemented correctly using a
two-pointer approach.
- The function modifies the array in-place, adhering to the problem's constraints.

### Areas for Improvement


- Remove any code related to input handling, as the function should directly operate on the
provided argument `nums`.
- Ensure the function returns `None` instead of the modified array to align with the in-place
modification requirement.
- Test the function with various edge cases, such as empty arrays or arrays with a single
element, to ensure robustness.

Submitted Code (Python (3.8.1))


from typing import List, Optional

def reverseArray(nums: List[int]) -> List[int]:


left = 0
right = len(nums) - 1

while left < right:


nums[left], nums[right] = nums[right], nums[left]
left += 1
right -= 1

return nums
3. Merge Two Sorted Lists EASY PASSED 5/5 Passed

You are given the heads of two sorted singly linked lists, list1 and list2.

Merge the two lists into one sorted linked list, and return the head of the merged list.

You must do this by splicing together the nodes of the original lists — do not create new nodes.

Constraints:
The number of nodes in both lists is in the range [0, 50].

-100 [Link] d 100

Both list1 and list2 are sorted in non-decreasing order.

Recursion Two Pointers LINKED_LIST SORTING

Time Complexity Total Test Cases Space Complexity


O(N + M) 5 O(1)

Test Cases Passed Total Memory Used Total Execution Time


5 4616 0.172

Test Case Results

Status Input Output Expected Time Memory

passed [1,2,3],[] [1,2,3] [1,2,3] 0.036 4384

passed [],[0] [0] [0] 0.035 4492

passed [5,6,7],[1,2,3] [1,2,3,5,6,7] [1,2,3,5,6,7] 0.036 4616

passed [1,2,4],[1,3,4] [1,1,2,3,4,4] [1,1,2,3,4,4] 0.03 4556

passed [],[] [] [] 0.035 4448

AI Feedback for this Question

The submitted code successfully implements the merging of two sorted linked lists into a single
sorted linked list using an iterative approach. It demonstrates a clear understanding of linked
list traversal and node manipulation.

### Code Strengths


- The code correctly handles edge cases, such as when one or both input lists are empty.
- The iterative approach is efficient and ensures that the merged list maintains sorted order.
- The use of a dummy node simplifies the implementation by providing a consistent starting
point for the merged list.

### Areas for Improvement


- Consider adding comments to explain the logic within the loop for better readability and
maintainability.
- Ensure the code handles large input sizes efficiently, although within the given constraints,
this is not a concern.
- Explore the recursive approach as an alternative implementation for merging sorted lists,
which can be more intuitive for some scenarios.

Submitted Code (Python (3.8.1))

import sys
import json
from typing import List, Optional

# Definition for singly-linked list.


class ListNode:
def __init__(self, val=0, next=None):
[Link] = val
[Link] = next

# Function to merge two sorted lists


def mergeTwoLists(list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]:
# --- Your actual solution code will be inserted here ---
dummy = ListNode(0)
current = dummy

while list1 and list2:


if [Link] <= [Link]:
[Link] = list1
list1 = [Link]
else:
[Link] = list2
list2 = [Link]
current = [Link]

if list1:
[Link] = list1
else:
[Link] = list2

return [Link] # Placeholder return


4. Nearest Duplicate Distance EASY PASSED 5/5 Passed

<p>You are given an integer array A. For every element, find the distance to its nearest identical
element (either left or right). If no duplicate exists for that element, return -1 for that position. Return
the result array. </p><p>This simulates finding the nearest repeated event in logs or user actions.
</p><h2>Constraints </h2><ul><li><p>1 d N d 100000 </p></li><li><p> 1 d A[i] d 100000 </p></li></ul><p>
</p><h2>Test Case 1 </h2><h3> Input: </h3><p> 1 2 3 1 4 2 </p><h3> Output: </h3><p> 3 3 -1 3 -1
3 </p><h2>Test Case 2 </h2><h3> Input: </h3><p> 5 5 5 5 </p><h3> Output: </h3><p> 1 1 1 1 </p>

Array String Hashing HashMap Two Pass Distance Calculation

Time Complexity Total Test Cases Space Complexity


O(N) 5 O(N)

Test Cases Passed Total Memory Used Total Execution Time


5 4464 0.159

Test Case Results

Status Input Output Expected Time Memory

passed [5, 5, 5, 5] [1, 1, 1, 1] [1, 1, 1, 1] 0.035 4464

passed [1, 2, 3, 4] [-1, -1, -1, -1] [-1, -1, -1, -1] 0.033 4368

passed [3, 4, 3, 4, 3, 4] [2, 2, 2, 2, 2, 2] [2, 2, 2, 2, 2, 2] 0.028 4364

passed [1, 2, 3, 1, 4, 2] [3, 4, -1, 3, -1, 4] [3, 4, -1, 3, -1, 4] 0.033 4456

passed [1, 1, 2, 3, 4, 1] [1, 1, -1, -1, -1, 4] [1, 1, -1, -1, -1, 4] 0.03 4408

AI Feedback for this Question

The submitted code correctly implements the logic to find the nearest duplicate distances in
the given array using a two-pass approach. It efficiently handles the problem requirements and
passes all provided test cases.

### Code Strengths


- The solution uses a dictionary to track the indices of elements, ensuring efficient lookups
and updates.
- The two-pass approach (forward and backward) ensures that both left and right nearest
duplicates are considered.
- The code correctly handles edge cases, such as no duplicates or all elements being duplicates.

### Areas for Improvement


- The code could benefit from additional comments explaining the logic behind each pass for
clarity.
- Consider optimizing memory usage by reusing the dictionary instead of clearing and recreating
it.
- Adding type hints for the method parameters and return type would improve code readability
and maintainability.

Submitted Code (Python (3.8.1))

from typing import List


import sys
import re

class Solution:
def nearestDuplicateDistance(self, arr: List[int]) -> List[int]:
n = len(arr)
res = [float('inf')]*n
last_seen = {}

for i in range(n):
if arr[i] in last_seen:
res[i] = i - last_seen[arr[i]]
last_seen[arr[i]] = i

last_seen.clear()

for i in range(n-1, -1 , -1):


if arr[i] in last_seen:
res[i] = min(res[i], last_seen[arr[i]] - i)
last_seen[arr[i]] = i

for i in range(n):
if res[i] == float('inf'):
res[i] = -1
return res
# Write your logic here:
# 1. Initialize result array with float('inf')
# 2. Forward pass: Track last seen index of each element in a dict
# 3. Backward pass: Track next seen index of each element in a dict
# 4. Final pass: Convert any remaining 'inf' to -1

return arr;
5. Reverse Linked List EASY PASSED 3/3 Passed

Given the head of a singly linked list, reverse the list and return the new head.

You must do this iteratively or recursively.

Constraints:
The number of nodes in the list is in the range [0, 5000]

-5000 [Link] d 5000

Recursion Two Pointers Linked List

Time Complexity Total Test Cases Space Complexity


O(N) 3 O(1)

Test Cases Passed Total Memory Used Total Execution Time


3 4764 0.093

Test Case Results

Status Input Output Expected Time Memory

passed [1, 2, 3, 4, 5] [5,4,3,2,1] [5,4,3,2,1] 0.029 4584

passed [1, 2] [2,1] [2,1] 0.038 4744

passed [3, 4, 5, 6] [6,5,4,3] [6,5,4,3] 0.026 4764

AI Feedback for this Question

The user's code submission successfully implements an iterative solution to reverse a singly
linked list. The implementation is correct and passes all provided test cases, demonstrating a
solid understanding of the problem requirements.

### Code Strengths


- The code correctly uses an iterative approach to reverse the linked list, adhering to the
problem constraints.
- The logic is clear and efficiently updates pointers to achieve the reversal.
- The implementation is clean and concise, making it easy to read and understand.

### Areas for Improvement


- Consider adding comments to explain the purpose of each step for better readability and
maintainability.
- Include edge case handling explicitly, such as when the input list is empty or contains only
one node, even though the current implementation handles these cases implicitly.
- Add unit tests to validate the solution against a broader range of scenarios, including edge
cases.
Submitted Code (Python (3.8.1))

import sys
import json
from typing import List, Optional

# Definition for singly-linked list.


class ListNode:
def __init__(self, val=0, next=None):
[Link] = val
[Link] = next

def reverseList(head: Optional['ListNode']) -> Optional['ListNode']:


prev = None
curr = head

while curr:
next_node = [Link]
[Link] = prev
prev = curr
curr = next_node
return prev

You might also like