数据结构和系统设计问题

发布于 2024-10-16 14:22:44 字数 173 浏览 1 评论 0原文

如果有人被问到“为某某设计一个系统”或者“你会为某某使用什么数据结构?”……可以用关系数据库系统设计来回答吗?是否包含表、实体、它们之间的关系、外键和主键等?对于拥有丰富的数据库系统使用经验但没有使用数据结构的项目经验的人来说,这可以吗?我只知道链表、二叉树、二叉搜索树、堆栈和队列……对即将到来的实习生面试感到紧张。有什么建议吗?

If one is asked to "Design a system for such and such" or "What data structure would you use for such and such?"...is it okay to answer with a relational database system design? Complete with the tables, entities, relationships between them, foreign keys and primary keys, etc? Would this be okay for one that has a lot of experience using database systems, but no project experience using data structures? I only know Linked Lists, binary trees, binary search trees, stacks and queues...nervous for my upcoming intern interview. Any advice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

美人如玉 2024-10-23 14:22:44

链表、树和堆栈是作用于程序中数据的工具。数据库表以及表设计和关系是存储数据的工具。 “系统”使用这两种方法,但目的不同,但它们确实可以一起工作。

“为某某设计一个系统”
这是一个更高级别的问题,因此我首先从讨论数据库表开始,然后根据它们所了解的细节程度,进入程序细节。

“你会使用什么数据结构来实现这样那样的目的?”
这听起来像是一个关于算法设计的问题,所以这里你可能会被问到有关树和栈的问题。

希望有帮助:p

Linked lists, trees, and stacks are tools for acting on data in a program. Database tables and table designs and relationships are tools for storing data. The "system" uses both of these but for different purposes, but they do work togethor.

"Design a system for such and such"
This is a higher level question, and so I would first start by talking about database tables, and then depending on how much detail they are after, move into program specifics.

"What data structure would you use for such and such?"
This sounds like a question about algorithm design, so here is where you are probably being asked about trees and stacks.

Hope that helps :p

懒猫 2024-10-23 14:22:44

在面试中,旨在测试您对数据结构(通常是算法复杂性)熟悉程度的问题与关系数据库无关。关于系统设计的问题很可能涉及数据库设计部分。

你提到的数据结构都很重要。最明显缺失且非常重要的是哈希表(或无序映射,以及许多脚本语言中的数据结构,例如 python 中的字典和 javascript 中的对象/映射)。您还应该阅读 btree,它通常用于实现关系数据库(并且具有属性类似于二叉搜索树,但更适合磁盘存储)。

In interviews, questions designed to test your familiarity with data structures (and often with algorithmic complexity) are NOT about relational databases. Questions about system design may well involve a database design part.

The data structures you mentioned are all important. The one that's most obviously missing and very important is hash tables (or unordered maps, and the basis for data structures in many scripting languages, such as dicts in python and objects/maps in javascript). You should also read up on btrees, which are usually used to implement relational databases (and have properties like binary search trees, but are better suited to disk storage).

装纯掩盖桑 2024-10-23 14:22:44

在实习生面试中,这是不行的。

我希望您熟悉基本数据结构,但我不希望您成为其中任何一个的专家。 (无论如何,这不是我所说的专家。)我更感兴趣的是你如何回答明显超出你当前知识范围的问题。如果我问你 van Emde Boas 树的理论优势,“我不知道”可能是正确的答案。 (比试图欺骗我更好。)

但是,作为一个实际问题,您可以将关系设计原则有效地应用于许多不明显相关的问题。大多数 Lotus Notes 应用程序都会受益于可靠的关系设计。即使您无法在 Notes 中以声明方式实现约束,您仍然必须以某种方式考虑它们——异常报告、周期文档爬行等等。

而且,IIRC,大规模 C++ 设计中的第一个扩展示例,既是 C++ 或 OO 设计问题,也是关系设计问题。 (那件事是1996年出版的。我有那么老吗?是的,我想我有那么老。)

In an intern interview, that's not ok.

I would expect you to be familiar with fundamental data structures, but I wouldn't expect you to be an expert in any of them. (Not what I'd call an expert, anyway.) I'd be more interested in how you respond to questions that are clearly beyond your current knowledge. If I asked you about the theoretical advantages of a van Emde Boas tree, "I don't know" would probably be the right answer. (Better than trying to bluff me.)

But, as a practical matter, you can apply relational design principles profitably to many problems that aren't obviously relational. Most Lotus Notes applications would benefit from a solid relational design. Even though you can't implement constraints declaratively in Notes, you still have to account for them somehow--exception reports, period document crawling, whatever.

And, IIRC, the first extended example in Large Scale C++ Design was as much a relational design issue as a C++ or OO design issue. (That thing was published in 1996. Am I that old? Yes, I guess I am.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文