This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Systems Architecture Expert - Black Box Design Specialist | |
| You are a senior systems architect specializing in modular, maintainable software design. Your expertise comes from Eskil Steenberg's principles for building large-scale systems that last decades. | |
| ## Core Philosophy | |
| **"It's faster to write five lines of code today than to write one line today and then have to edit it in the future."** | |
| Your goal is to create software that: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The Three Pillars of Writing Good Code | |
| When you're writing code, it's like building a strong foundation for a house. Just as a house needs a solid base, your code needs to have certain key qualities to make it reliable and efficient. These qualities are like pillars that support your code. Let's explore these three pillars of good code and also delve into the skills that interviewers seek in a proficient coder. | |
| Pillar 1: Readable Code | |
| Imagine reading a book with messy handwriting and confusing sentences. It wouldn't be enjoyable, right? The same goes for code. Readable code is like clear writing. It's easy to understand and follow. When your code is readable, anyone can look at it and quickly figure out what's happening. This is crucial because other programmers might need to work with your code, or you might revisit your own code after a while. | |
| Pillar 2: Time Complexity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module FriendApprover | |
| def approve(friend_request) | |
| friend_request.approved = true | |
| friend_request.save | |
| increment_friends | |
| notify_new_buddy(friend_request.user_id) | |
| end | |
| def increment_friends | |
| friend_count += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "Running migrations" | |
| python manage.py migrate | |
| echo "Starting development server" | |
| python manage.py runserver 0.0.0.0:8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:3.9.12 | |
| WORKDIR /app | |
| ENV PYTHONFAULTHANDLER=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONHASHSEED=random \ | |
| # pip: | |
| PIP_NO_CACHE_DIR=off \ | |
| PIP_DISABLE_PIP_VERSION_CHECK=on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| web: | |
| build: . | |
| command: sh start_dev_server.sh | |
| volumes: | |
| - .:/app | |
| environment: | |
| - DEBUG=1 | |
| env_file: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var RecentCounter = function() { | |
| this.Q = [] | |
| }; | |
| /** | |
| * @param {number} t | |
| * @return {number} | |
| */ | |
| RecentCounter.prototype.ping = function(t) { | |
| this.Q.push(t); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {number[]} nums | |
| * @return {void} Do not return anything, modify nums in-place instead. | |
| */ | |
| var sortColors = function (nums) { | |
| const countConfig = { 0: 0, 1: 0, 2: 0 }; | |
| for (const iterator of nums) { | |
| countConfig[iterator] += 1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {string} s | |
| * @param {number[]} indices | |
| * @return {string} | |
| */ | |
| const emptyy = []; | |
| var restoreString = function (s, indices) { | |
| emptyy.length = 0; | |
| const str = [...s]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The 3 pillars of good code: | |
| 1. Readable | |
| 2. Time Complexity | |
| 3. Space Complexity | |
| What skills interviewer is looking for: | |
| Analytic Skills - How can you think through problems and analyze things? | |
| Coding Skills - Do you code well, by writing clean, simple, organized, readable code? | |
| Technical knowledge - Do you know the fundamentals of the job you're applying for? | |
| Communication skills: Does your personality match the companies’ culture? |
NewerOlder