📜  HashedIn 面试经历 |软件工程师 | 2019 年 9 月(1)

📅  最后修改于: 2023-12-03 15:01:06.802000             🧑  作者: Mango

HashedIn 面试经历 |软件工程师 | 2019 年 9 月

介绍

HashedIn是一家专注于软件开发和IT咨询的企业。公司的目标是通过先进的技术和流程开发高质量的软件解决方案,以满足客户不断增长的需求。公司在印度和美国拥有多个办事处,为客户提供全球化的IT服务。

面试经历
第一轮

第一轮面试主要围绕基础计算机科学问题和数据结构,如数组,链表,哈希表,栈,堆,排序,查找等问题。面试官要求我讲解每个数据结构的内部工作原理和实现算法。我还需要从时间和空间复杂度的角度分析每个算法,以及解决面试官为我提供的一些代码问题。

代码示例:

def binary_search(arr, target):
    left, right = 0, len(arr) - 1
    while left <= right:
        mid = (left + right) // 2
        if arr[mid] == target:
            return mid
        elif arr[mid] > target:
            right = mid - 1
        else:
            left = mid + 1
    return -1
第二轮

在第二轮面试中,我需要解决实际问题或为提供的业务场景设计算法和数据结构。面试官还考察了我的编程能力和代码风格。我需要在短时间内编写高效且易于维护的代码,并解释我的解决方案为什么是最好的。这部分的面试还涵盖了设计模式,架构原则,面向对象编程,代码重构等领域。

代码示例:

class Cache:
    def __init__(self, capacity: int):
        self.capacity = capacity
        self.cache = {}
        self.first = None
        self.last = None

    def remove_node(self, node: ListNode) -> None:
        if node.prev:
            node.prev.next = node.next
        else:
            self.first = node.next
        if node.next:
            node.next.prev = node.prev
        else:
            self.last = node.prev

    def add_node_to_front(self, node: ListNode) -> None:
        node.prev = None
        node.next = self.first
        if self.first:
            self.first.prev = node
        self.first = node
        if not self.last:
            self.last = node

    def get(self, key):
        if key in self.cache:
            node = self.cache[key]
            self.remove_node(node)
            self.add_node_to_front(node)
            return node.value
        return -1

    def put(self, key, value):
        if key in self.cache:
            node = self.cache[key]
            node.value = value
            self.remove_node(node)
            self.add_node_to_front(node)
        else:
            if len(self.cache) >= self.capacity:
                node_to_remove = self.last
                self.remove_node(node_to_remove)
                del self.cache[node_to_remove.key]
            new_node = ListNode(key, value)
            self.cache[key] = new_node
            self.add_node_to_front(new_node)
第三轮

在第三轮面试中,我需要展示我的技术领导力和思维方式。我需要提供有关如何构建产品和解决问题的详细思路。面试官还会提供一些业务挑战,让我应对这些挑战,并提出解决方案。在这部分的面试中,我还需要表达自己的计划和目标,显示自己的成长动态和技术趋势。

代码示例:

def get_income_trends_by_country(income_df: DataFrame) -> List[Tuple[str, str]]:
    country_income_map = {}
    for row in income_df.iterrows():
        row = row[1]
        country = row['Country']
        income = int(row['Income'])
        if not math.isnan(income):
            if country not in country_income_map:
                country_income_map[country] = []
            country_income_map[country].append(income)

    country_income_mean_list = []
    for country, income_list in country_income_map.items():
        mean_income = sum(income_list) // len(income_list)
        country_income_mean_list.append((country, mean_income))

    country_income_mean_list.sort(key=lambda x: x[1], reverse=True)
    return country_income_mean_list
结论

HashedIn是一个专注于软件开发和IT咨询的卓越公司,面试通常涉及基础计算机科学问题,算法和数据结构,编程能力和代码风格,架构原则和设计模式,以及技术领导力和思维方式。在这些方面表现良好,可以有机会成为HashedIn成长的一部分。