You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 KiB

Coding Interview University

**เดิมทีผมสร้างขึ้นเพื่อเป็นรายการที่ต้องทำสำหรับหัวข้อที่ต้องศึกษาเพื่อที่จะเป็นวิศวกรซอฟต์แวร์ แต่ว่ามันเติบโตขึ้นอย่างมากและมีหัวข้อต่างๆ มากมายอย่างที่คุณเห็นอยู่ทุกวันนี้ หัวข้อต่างๆ นี้จะเป็นสิ่งที่ให้คุณเตรียมตัวสำหรับสัมภาษณ์งานสำหรับบริษัทซอฟต์แวร์รวมทั้งบริษัทซอฟต์แวร์ขนาดใหญ่ของโลกอย่างเช่น Amazon Facebook Google หรือ Microsoft **

ขอให้คุณโชคดี!

ภาษาอื่นๆ:

นี่คืออะไร ?

นี่เป็นแผนการศึกษาหลายเดือนของผมจากนักพัฒนาเว็บไซต์ (ด้วยการศึกษาด้วยตัวเอง โดยไม่ได้จบวิทยาการคอมพิวเตอร์) เพื่อจะเป็นวิศวกรซอฟต์แวร์ในบริษัทขนาดใหญ่ที่หลายๆ คนต้องการเข้าทำงานด้วย

Coding at the whiteboard - from HBO's Silicon Valley

บทความนี้สำหรับคนที่อยากเป็น วิศวกรซอฟต์แวร์ หรือต้องการเปลี่ยนมาจากนักพัฒนาซอฟต์แวร์หรือนักพัฒนาเว็บไซด์มาเป็นวิศวกรซอฟต์แวร์ (ผู้ซึ่งมีความรู้ความเข้าใจลึกซึ้งในหลักการของวิทยาการคอมพิวเตอร์) ถ้าคุณมีประสบการณ์หลายปีและมั่นใจในประสบการณ์การเป็นวิศวกรซอฟต์แวร์ของคุณ จะได้เจอการสัมภาษณ์ที่ยากขึ้นแน่นอน

ถ้าคุณมีประสบการณ์การพัฒนาซอฟต์แวร์หรือเว็บไซต์มาหลายปี แต่ในบริษัทซอฟต์แวร์ขนาดใหญ่ของโลกอย่าง Google Amazon Facebook และ Microsoft มองการพัฒนาซอฟต์แวร์ของวิศวกรซอฟต์แวร์ที่ต่างกันออกไปจากการพัฒนาซอฟต์แวร์หรือเว็บไซต์โดยทั่วๆไป และบริษัทที่กล่าวมานี้ก็ต้องการความรู้ทางวิทยาการคอมพิวเตอร์ที่เข้มข้นอย่างมาก

ถ้าคุณต้องการเป็นวิศวกรคุณภาพ หรือวิศวกรระบบ คุณอาจจะต้องศึกษาเพิ่มเติมในรายการเพิ่มเติม (ระบบเครือข่าย, ระบบความปลอดภัย)


ตารางสารบัญ

---------------- รายการด้านล่างนี้เป็นรายการตัวเลือก ----------------


ทำไมต้องใช้?

ตอนเริ่มโครงการนี้, ผมไม่รู้จัก stack จาก heap เสียด้วยซ้ำ, หรือแม้กระทั้ง Big-O, โครงสร้างต้นไม้ หรือวิธีการเข้าถึงข้อมูลในโครงสร้างกราฟ ถ้าผมต้องได้เขียนโค้ดสำหรับจัดเรียงข้อมูล ผมบอกได้เลยว่ามันต้องออกมาไม่ดีแน่ๆ ทุกๆ โครงสร้างข้อมูลที่เคยใช้ก็ใช้สิ่งที่มีมากับตัวภาษาโปรแกรมที่ใช้ และผมไม่รู้ด้วยซ้ำว่ามันทำงานยังไงในระดับลึกๆ ผมไม่เคยจำเป็นต้องสนใจการเขียนเพื่อให้ใช้หน่วยความจำให้มีประสิทธิภาพ จนกระทั่งระบบเตือนมาโน่นแหละว่า "หน่วยความจำหมด" จึงจะหาวิธีแก้ขัด ผมใช้โครงสร้างแถวลำดับ (Arrays) หลายมิติน้อยครั้งมากๆ เมื่อเทียบกับโครงสร้างแถวลำดับ (Arrays) แบบปกติ แต่ผมก็ไม่เคยสร้างโครงสร้างข้อมูลขึ้นมาใช้เองเลยสักครั้ง

นี่คือแผนอันยาวไกล คุณอาจต้องใช้เวลาหลายเดือน ถ้าคุณมีความคุ้นเคยมาก่อนหน้านี้ ก็จะทำให้คุณใช้เวลาน้อยลง

ใช้อย่างไร

ทุกสิ่งที่อยู่ด้านล่างนี้เป็นเพียงเค้าโครงเท่านั้น และคุณต้องศึกษาสิ่งเหล่านี้จากบนลงล่างตามลำดับ

ผมใช้ เครื่องมือของ Github markdown สำหรับทำ check list เพื่อไว้ดูความก้าวหน้าในแต่ละหัวข้อ

สร้าง branch ใหม่ และคุณจะสามารถติ๊กแต่ละรายการโดยใช้วิธี, เพิ่มอักขระ x ข้างในวงเล็บก้ามปูแบบนี้: [x]

Fork branch และใช้คำสั่งดังนี้

git checkout -b progress

git remote add jwasham https://github.com/jwasham/coding-interview-university

git fetch --all

เลือกทุกกล่องโดยใช้ X หลังจากที่คุณศึกษาเสร็จแล้ว

git add .

git commit -m "Marked x"

git rebase jwasham/main

git push --force

เพิ่มเติมเกี่ยวกับเครื่องมือ markdown ของ Github

ห้ามรู้สึกว่าคุณไม่ฉลาดพอ

เกี่ยวกับแหล่งที่มาของวีดีโอ

บางวิดีโอนั้น สามารถเข้าถึงได้เฉพาะการลงทะเบียนเรียนใน Coursera, EdX หรือ Lynda.com ซึ่งเรียกว่า MOOCs บางครั้งคอร์สที่คุณต้องการเข้าไปดูวิดีโอนั้นยังไม่เปิด คุณจำเป็นต้องรอประมาณสองสามเดือน ส่วน Lynda.com นั้นต้องเสียเงิน

ผมยินดีหากคุณช่วยเพิ่มแหล่งความรู้ที่ฟรีและสามารถเข้าถึงได้แบบสาธารณะ เช่น วิดีโอใน YouTube ที่เป็นวิดีโอที่ใช้ในคอร์สเรียนนั้นๆ
ซึ่งผมชอบใช้บทเรียนที่มาจากมหาวิทยาลัยต่างๆ 

กระบวนการการสัมภาษณ์และการเตรียมตัว

เลือกภาษาสำหรับการสัมภาษณ์

คุณสามารถเลือกภาษาที่คุณถนัดในการสัมภาษณ์ในส่วนของการเขียนโปรแกรม แต่สำหรับบริษัทใหญ่ๆ ภาษาเหล่านี้คือตัวเลือกที่ควรใช้:

  • C++
  • Java
  • Python

You could also use these, but read around first. There may be caveats:

  • JavaScript
  • Ruby

You need to be very comfortable in the language and be knowledgeable.

อ่านเพิ่มเติม สำหรับภาษาที่ใช้เลือกสอบ:

See language resources here

คุณอาจจะเห็นแหล่งเรียนรู้เกี่ยวกับภาษา C, C++ และ Python ข้างใต้นี้ เพราะเราก็ยังคงศึกษาเรียนรู้กันอยู่ตลอด และมีหนังสือที่เกี่ยวข้องด้านล่าง

รายชื่อหนังสือ

นี่คือรายชื่อหนังสือที่น้อยกว่าที่ผมใช้ ซึ่งสิ่งเหล่านี้จะช่วยชีวิตของคุณ

เตรียมตัวสัมภาษณ์

หากคุณมีเวลาพอ:

สถาปัตยกรรม คอมพิวเตอร์

หากคุณมีเวลาน้อย:

  • Write Great Code: Volume 1: Understanding the Machine
    • The book was published in 2004, and is somewhat outdated, but it's a terrific resource for understanding a computer in brief.
    • The author invented HLA, so take mentions and examples in HLA with a grain of salt. Not widely used, but decent examples of what assembly looks like.
    • These chapters are worth the read to give you a nice foundation:
      • Chapter 2 - Numeric Representation
      • Chapter 3 - Binary Arithmetic and Bit Operations
      • Chapter 4 - Floating-Point Representation
      • Chapter 5 - Character Representation
      • Chapter 6 - Memory Organization and Access
      • Chapter 7 - Composite Data Types and Memory Objects
      • Chapter 9 - CPU Architecture
      • Chapter 10 - Instruction Set Architecture
      • Chapter 11 - Memory Architecture and Organization

หากคุณมีเวลาพอ (ผมอยากได้เล่มนี้):

สำหรับแต่ละภาษา

คุณต้องเลือกภาษาที่จะใช้สัมภาษณ์ (ดูด้านบน). นี่หนังสือที่ผมแนะนำแยกตามแต่ละภาษา ผมมีไม่ครบทุกภาษา และผมยินดีที่จะเพิ่มในภายหลัง

ถ้าคุณอ่านเล่มใดเล่มนึงจนจบ คุณควรจะมีความรู้ความเข้าใจในโครงสร้างข้อมูลและอัลกอริธึม เพื่อเริ่มทำโจทย์แก้ปัญหาได้ คุณไม่ต้องดูวิดีสอนใดๆ ในนี้ก็ได้, นอกเสียจากคุณต้องการจะทบทวน

แหล่งทรัพยกรอื่นๆ ที่เกี่ยวข้อง

C++

ผมยังไม่เคยอ่านสองเล่มนี้ แต่สองเล่มนี้แนะนำอย่างแรงและมีการรีวิวโดย Sedgewick พ่อหนุ่มคนนี้เค้าเจ๋งนะ

ถ้าคุณมีเล่มอื่นที่ดีกว่าอยากแนะนำสำหรับ C++ บอกให้ผมทราบได้เลย ตอนนี้กำลังหาแหล่งที่มีเนื้อหาครอบคลุมทุกด้านอยู่

Java

หรือ:

  • Data Structures and Algorithms in Java
    • โดย Goodrich, Tamassia, Goldwasser
    • ใช้เป็นหนังสือเสริมในหลักสูตร CS intro ที่ UC Berkeley
    • see my book report on the Python version below. This book covers the same topics.

Python

หนังสืออื่นๆ

หลายคนแนะนำหนังสือเหล่านี้ แต่ผมคิดว่ามันนอกเหนือขอบเขตไปหน่อย หรืออย่างน้อยคุณต้องมีประสบการณ์ในวิศวกรรมซอฟต์แวร์หลายปีและคาดหวังการสัมภาษณ์ที่ยากๆ:

  • Algorithm Design Manual (Skiena)

    • As a review and problem recognition
    • The algorithm catalog portion is well beyond the scope of difficulty you'll get in an interview.
    • This book has 2 parts:
      • class textbook on data structures and algorithms
        • pros:
          • is a good review as any algorithms textbook would be
          • nice stories from his experiences solving problems in industry and academia
          • code examples in C
        • cons:
          • can be as dense or impenetrable as CLRS, and in some cases, CLRS may be a better alternative for some subjects
          • chapters 7, 8, 9 can be painful to try to follow, as some items are not explained well or require more brain than I have
          • don't get me wrong: I like Skiena, his teaching style, and mannerisms, but I may not be Stony Brook material.
      • algorithm catalog:
        • this is the real reason you buy this book.
        • about to get to this part. Will update here once I've made my way through it.
    • Can rent it on kindle
    • Half.com is a great resource for textbooks at good prices.
    • Answers:
    • Errata
  • Introduction to Algorithms

    • Important: Reading this book will only have limited value. This book is a great review of algorithms and data structures, but won't teach you how to write good code. You have to be able to code a decent solution efficiently.
    • Half.com is a great resource for textbooks at good prices.
    • aka CLR, sometimes CLRS, because Stein was late to the game
  • Programming Pearls

    • The first couple of chapters present clever solutions to programming problems (some very old using data tape) but that is just an intro. This a guidebook on program design and architecture, much like Code Complete, but much shorter.
  • "Algorithms and Programming: Problems and Solutions" by Shen

    • A fine book, but after working through problems on several pages I got frustrated with the Pascal, do while loops, 1-indexed arrays, and unclear post-condition satisfaction results.
    • Would rather spend time on coding problems from another book or online coding problems.

ก่อนที่จะเริ่มต้น

This list grew over many months, and yes, it kind of got out of hand.

Here are some mistakes I made so you'll have a better experience.

1. คุณไม่สามารถจำได้ทุกสิ่งอย่าง

ผมดูวิดีโอหลายชั่วโมงและจดโน้ตไว้ หลายเดือนต่อมาพบว่า ผมจำสิ่งต่างๆ ได้น้อยมา ผมใช้เวลา 3 เดือน อ่านโน๊ตและทำ flashcard ซึ่งนั่นทำให้ผมได้ทบทวนเนื้อหา

โปรดอ่านตรงนี้ก่อนและคุณจะได้ไม่ต้องทำผิดแบบผม:

Retaining Computer Science Knowledge

2. ใช้ Flashcards

ในการแก้ปัญหานี้ ผมได้สร้างเว็บ flashcard เล็กๆ โดยมี 2 ชนิดคือ: ทั่วไป และ โค้ด แต่ละการ์ดจะมีรูปแบบต่างกัน

ผมทำเว็บที่รองรับอุกรณ์มือถือ ซึ่งผมจะได้สามารถทบทวนในโทรศัพท์หรือแทบเล็ต ที่ใดก็ได้

คุณสามารถทำได้แบบฟรีๆ:

คลังการ์ดของผมนั้น เนื้อหาจะครอบคลุมเกินเนื้อหาหลัก ตั้งแต่ภาษา assembly และ Python จนไปถึง machine learning และ สถิติ ซึ่งมันก็เกินกว่าที่เราต้องการ

Note on flashcards: The first time you recognize you know the answer, don't mark it as known. You have to see the same card and answer it several times correctly before you really know it. Repetition will put that knowledge deeper in your brain.

An alternative to using my flashcard site is Anki, which has been recommended to me numerous times. It uses a repetition system to help you remember. It's user-friendly, available on all platforms and has a cloud sync system. It costs $25 on iOS but is free on other platforms.

My flashcard database in Anki format: https://ankiweb.net/shared/info/25173560 (thanks @xiewenya)

3. ทบทวน, ทบทวน, ทบทวน

I keep a set of cheat sheets on ASCII, OSI stack, Big-O notations, and more. I study them when I have some spare time.

Take a break from programming problems for a half hour and go through your flashcards.

4. เพ่งสมาธิ

There are a lot of distractions that can take up valuable time. Focus and concentration are hard.

อะไรที่ไม่ครอบคลุม

เทคโนโลยีเหล่านี้ถูกใช้แพร่หลาย แต่จะไม่อยู่ในแผนการเรียนนี้ ได้แก่:

  • SQL
  • Javascript
  • HTML, CSS, และ เทคโนโลยี front-end อื่นๆ

แผนของแต่ละวัน

บางหัวข้อใช้เวลาวันเดียว บ้างใช้หลายวัน และบางอันนั้นเป็นการเรียนแบบไม่ได้เขียนจริง

แต่ละวัน ผมศึกษาหนึ่งหัวข้อจากรายการด้านล่าง ดูวิดีโอเกี่ยวกับห้อข้อนั้นๆ และเขียนโปรแกรมที่เกี่ยวข้องลงไป:

  • C - using structs and functions that take a struct * and something else as args.
  • C++ - without using built-in types
  • C++ - using built-in types, like STL's std::list for a linked list
  • Python - using built-in types (to keep practicing Python)
  • and write tests to ensure I'm doing it right, sometimes just using simple assert() statements
  • คุณอาจใช้ Java หรือ ภาษาอื่นๆ ได้เช่นกัน ผมใช้เฉพาะข้างต้นนี้

คุณไม่จำเป็นต้องฝึกทั้งหมดนี้ คุณต้องการเฉพาะ ภาษาเดียวที่จะใช้สอบสัมภาษณ์.

ทำไมต้องโค้ดทั้งหมดนี้?

  • ฝึกฝน, ฝึกฝน, ฝึกฝน, จนผมเอียนกับมัน และสามารถทำมันได้โดยไม่ติดปัญหาอะไร (บางอันมีรายละเอียดปลีกย่อยที่ต้องจำ)
  • Work within the raw constraints (allocating/freeing memory without help of garbage collection (except Python))
  • Make use of built-in types so I have experience using the built-in tools for real-world use (not going to write my own linked list implementation in production)

ผมอาจจะมีเวลาไม่พอที่จะทำทั้งหมดทุกหัวข้อ แต่ผมก็ลองทำ

คุณสามารถดูโค้ดของผมได้:

คุณไม่จำเป็นต้องจำรายละเอียดทุกอย่างของทุกอัลกอริธึม

เขียนโค้ดลงกระดานหรือกระดาษ ไม่ใช่ในเครื่องคอมพิวเตอร์ ทดสอบโดยใช้ข้อมูลตัวอย่าง จากนั้นลองรันจริงๆ ในเครื่องคอมพิวเตอร์

ความรู้พื้นฐานที่จำเป็น

  • เรียนรู้ภาษา C

    • ภาษา C มีอยู่ทุกหนแห่ง คุณจะเห็นตัวอย่างต่างๆ ในหนังสือ บทเรียน วิดีโอ ทุกหนแห่ง ในขณะที่คุณศึกษาอยู่
    • C Programming Language, Vol 2
      • This is a short book, but it will give you a great handle on the C language and if you practice it a little you'll quickly get proficient. Understanding C helps you understand how programs and memory work.
      • answers to questions
  • คอมพิวเตอร์จัดการกับโปรแกรมอย่างไร:

ความซับซ้อนของขั้นตอนวิธี / Big-O / การวิเคราะห์ Asymptotic

โครงสร้างข้อมูล

More Knowledge

Trees

Sorting

If you need more detail on this subject, see "Sorting" section in Additional Detail on Some Subjects

Graphs

Graphs can be used to represent many problems in computer science, so this section is long, like trees and sorting were.

You'll get more graph practice in Skiena's book (see Books section below) and the interview books

Even More Knowledge

System Design, Scalability, Data Handling


Final Review

This section will have shorter videos that you can watch pretty quickly to review most of the important concepts.
It's nice if you want a refresher often.
  • Series of 2-3 minutes short subject videos (23 videos)
  • Series of 2-5 minutes short subject videos - Michael Sambol (48 videos):

Coding Question Practice

ขณะนี้คุณมีความรู้เกี่ยวกับวิทยการคอมพิวเตอร์ทุกหัวข้อด้านบนแล้ว ก็ถึงเวลาฝึกซ้อมตอบคำถามเกี่ยวกับปัญหาด้านการโค้ดดิ้ง

การฝึกซ้อมนี้ ไม่เกี่ยวข้องกับการท่องจำตอบของโจทย์ด้านการเขียนโปรแกรม

ทำไมคุณจึงต้องฝึกซ้อม:

  • เพื่อทดสอบความเข้าใจโจทย์ ว่า ควรใช้โครงสร้างช้อมูลใด และ อัลกอริธึมใด ที่เหมาะสมกับโจทย์
  • รวบรวมสิ่งที่โจทย์ต้องการ
  • พูดคุยเป็นภาษาของคุณ เฉกเช่นเดียวกับเมื่อคุณไปสัมภาษณ์
  • เขียนโค้ดบนกระดาน, กระดาษ ไม่ใช่ในคอมพิวเตอร์
  • ได้คำตอบออกมา พร้อมกับประสิทธิภาพของคำตอบของคุณ
  • ทดสอบคำตอบของคุณ

There is a great intro for methodical, communicative problem solving in an interview. You'll get this from the programming interview books, too, but I found this outstanding: Algorithm design canvas

No whiteboard at home? That makes sense. I'm a weirdo and have a big whiteboard. Instead of a whiteboard, pick up a large drawing pad from an art store. You can sit on the couch and practice. This is my "sofa whiteboard". I added the pen in the photo for scale. If you use a pen, you'll wish you could erase. Gets messy quick.

my sofa whiteboard

Supplemental:

Read and Do Programming Problems (in this order):

See Book List above

Coding exercises/challenges

Once you've learned your brains out, put those brains to work. Take coding challenges every day, as many as you can.

Coding Interview Question Videos:

Challenge sites:

Mock Interviews:

Once you're closer to the interview

Your Resume

  • See Resume prep items in Cracking The Coding Interview and back of Programming Interviews Exposed

Be thinking of for when the interview comes

Think of about 20 interview questions you'll get, along with the lines of the items below. Have 2-3 answers for each. Have a story, not just data, about something you accomplished.

  • Why do you want this job?
  • What's a tough problem you've solved?
  • Biggest challenges faced?
  • Best/worst designs seen?
  • Ideas for improving an existing product.
  • How do you work best, as an individual and as part of a team?
  • Which of your skills or experiences would be assets in the role and why?
  • What did you most enjoy at [job x / project y]?
  • What was the biggest challenge you faced at [job x / project y]?
  • What was the hardest bug you faced at [job x / project y]?
  • What did you learn at [job x / project y]?
  • What would you have done better at [job x / project y]?

Have questions for the interviewer

Some of mine (I already may know answer to but want their opinion or team perspective):
  • How large is your team?
  • What does your dev cycle look like? Do you do waterfall/sprints/agile?
  • Are rushes to deadlines common? Or is there flexibility?
  • How are decisions made in your team?
  • How many meetings do you have per week?
  • Do you feel your work environment helps you concentrate?
  • What are you working on?
  • What do you like about it?
  • What is the work life like?

Once You've Got The Job

Congratulations!

Keep learning.

You're never really done.


*****************************************************************************************************
*****************************************************************************************************

Everything below this point is optional.
By studying these, you'll get greater exposure to more CS concepts, and will be better prepared for
any software engineering job. You'll be a much more well-rounded software engineer.

*****************************************************************************************************
*****************************************************************************************************

Additional Books

Additional Learning

These topics will likely not come up in an interview, but I added them to help you become a well-rounded software engineer, and to be aware of certain technologies and algorithms, so you'll have a bigger toolbox.

--

Additional Detail on Some Subjects

I added these to reinforce some ideas already presented above, but didn't want to include them
above because it's just too much. It's easy to overdo it on a subject.
You want to get hired in this century, right?

Video Series

Sit back and enjoy. "Netflix and skill" :P

หลักสูตร วิทยาการคอมพิวเตอร์