Coding Interview Flashcards
DRY
Don’t Repeat Yourself
MVC
Model Review Controller
USER uses CONTROLLER manipulates MODEL updates VIEW sees USER
- A Model , which represents the underlying, logical structure of data in a software application and the high-level class associated with it. This object model does not contain any information about the user interface.
- A View , which is a collection of classes representing the elements in the user interface (all of the things the user can see and respond to on the screen, such as buttons, display boxes, and so forth)
- A Controller , which represents the classes connecting the model and the view, and is used to communicate between classes in the model and view.
ORM
Object Relational Mapping
A technique that lets you query and manipulate data from a database using an object-oriented paradigm.
ORM Pros
SAVES TIME:
- DRY: You write your data model in only one place, and it’s easier to update, maintain, and reuse the code.
- A lot of stuff is done automatically, from database handling to I18N.
- It forces you to write MVC code, which, in the end, makes your code a little cleaner.
- You don’t have to write poorly-formed SQL (most Web programmers really suck at it, because SQL is treated like a “sub” language, when in reality it’s a very powerful and complex one).
- Sanitizing; using prepared statements or transactions are as easy as calling a method.
FLEXIBILITY:
- It fits in your natural way of coding (it’s your language!).
- It abstracts the DB system, so you can change it whenever you want.
- The model is weakly bound to the rest of the application, so you can change it or use it anywhere else.
- It lets you use OOP goodness like data inheritance without a headache.
ORM Cons
- You have to learn it, and ORM libraries are not lightweight tools;
- You have to set it up. Same problem.
- Performance is OK for usual queries, but a SQL master will always do better with his own SQL for big projects.
- It abstracts the DB. While it’s OK if you know what’s happening behind the scene, it’s a trap for new programmers that can write very greedy statements, like a heavy hit in a for loop.
ORM Examples
Java: Hibernate.
PHP: Propel or Doctrine (I prefer the last one).
Python: the Django ORM or SQLAlchemy
C#: NHibernate or Entity Framework
Python Requests Module
Requests allows you to send organic, grass-fed HTTP/1.1 requests, without the need for manual labor. There’s no need to manually add query strings to your URLs, or to form-encode your POST data. Keep-alive and HTTP connection pooling are 100% automatic, thanks to urllib3.
Python Arrow Module
Arrow is a Python library that offers a sensible, human-friendly approach to creating, manipulating, formatting and converting dates, times, and timestamps. It implements and updates the datetime type, plugging gaps in functionality, and provides an intelligent module API that supports many common creation scenarios.
Python More_Itertools Module
Toolbox for all kinds of operations.
Examples of DBs
MySQL, SQLite, Postgres, Oracle, MongoDB
Celery
Celery is an asynchronous task queue/job queue based on distributed message passing. It is focused on real-time operation, but supports scheduling as well. … Tasks can execute asynchronously (in the background) or synchronously (wait until ready). Celery is used in production systems to process millions of tasks a day.
Python Redis Module
Redis is an in-memory key-value pair NoSQL data store often used for web application sessions, transient data and as a broker for task queues. redis-py is a common Python code library for interacting with Redis.
RPC
Remote Procedure Call (RPC) RPC is the earliest, simplest form of API interaction. It is about executing a block of code on another server, and when implemented in HTTP or AMQP it can become a Web API. There is a method and some arguments, and that is pretty much it.
WUI
Web User Interface (Browser?)
CLI
Command Line Interface
5 Values of XP
communication, simplicity, feedback, courage, and respect
Retrospectives
- Planning session done after one stage of Agile development
- Those who have participated in agile development processes will evaluate these processes carefully to think about what methods may have worked better than others
Cloud Services Examples
AWS, GCP, Azure, DO, Rackspace
CI/CD
Continuous Integration / Continuous Deployment
https://dzone.com/articles/learn-how-to-setup-a-cicd-pipeline-from-scratch
PEP-20
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea – let’s do more of those!