Thank you for your interest in the National Service Software Engineering position at Arkesel. We appreciate the time you've taken to apply and would like you to participate in a coding challenge as the next step in our evaluation process.
The coding challenge consists of five questions that will help us assess your problem-solving and programming skills. You can use any programming language of your choice to solve these problems.
Please find below detailed instructions, input format, output format, and additional requirements for each question.
Question 1 - Palindrome Check
Determine if the given string is a palindrome.
Input Format:
- A string s consisting of lowercase English letters (1 <= s.length <= 10^4)
Output Format:
- A boolean value indicating whether the input string is a palindrome or not.
Question 2 - Binary Search
Implement the binary search algorithm to find the index of a target value in a sorted array.
Input Format:
-
A sorted array of integers arr (1 <= arr.length <= 10^5, -10^4 <= arr[i] <= 10^4)
-
An integer target (-10^4 <= target <= 10^4)
Output Format:
- An integer representing the index of the target value in the array, or -1 if the target value is not present in the array.
Question 3 - Longest Common Prefix
Find the longest common prefix string amongst an array of strings.
Input Format:
- An array of strings strs (1 <= strs.length <= 10^4, 1 <= strs[i].length <= 100)
Output Format:
- A string representing the longest common prefix of the input strings.
Question 4 - Merge Intervals
Given an array of intervals, merge any overlapping intervals and return the merged intervals.
Input Format:
- An array of intervals intervals (1 <= intervals.length <= 10^4, 0 <= intervals[i][0] <= intervals[i][1] <= 10^4)
Output Format:
- An array of intervals, representing the merged overlapping intervals.
Question 5 - Linked List Cycle Detection
Determine if a linked list has a cycle in it.
Input Format:
-
A ListNode object representing the head of a singly-linked list. Each ListNode object has the following properties:
-
val: an integer representing the node's value (0 <= val <= 10^4)
-
next: a reference to the next ListNode object in the list, or None if it is the last node
-
Output Format:
- A boolean value indicating whether a cycle exists in the linked list.