Tuesday, January 8, 2019
cheat sheet for ls
1. List Files using ls with no option
ls with no option list files and directories in bare format where we won’t be able to view details like file types, size, modified date and time, permission and links etc.
[vn04nxr@client-236651385-1-270480917 ~]$ ls affiliate_spend_viq_08-13-2018_to_08-23-2018.tsv employee first_file
Here, ls -l (-l is character not one) shows file or directory, size, modified date and time, file or folder name and owner of file and its permission.
[vn04nxr@client-236651385-1-270480917 ~]$ ls -l total 64 -rw-rw-r-- 1 vn04nxr vn04nxr 22 Aug 23 19:11 affiliate_spend_viq_08-13-2018_to_08-23-2018.tsv -rw-rw-r-- 1 vn04nxr vn04nxr 14510 Sep 3 14:58 cat_more -rw-rw-r-- 1 vn04nxr vn04nxr 35 Aug 23 21:46 employee
SQL question challenge (Employee Dept)
Link to Github
These are the list of tables which includes employees, projects and department table. It also shows the relationship between these tables
1) SELECT EMPLOYEES FROM
DEPARTMENT WHERE SALARY IS GREATER THAN 40K
These are the list of tables which includes employees, projects and department table. It also shows the relationship between these tables
employees projects +---------------+---------+ +---------------+---------+ | id | int |<----+ +->| id | int | | first_name | varchar | | | | title | varchar | | last_name | varchar | | | | start_date | date | | salary | int | | | | end_date | date | | department_id | int |--+ | | | budget | int | +---------------+---------+ | | | +---------------+---------+ | | | departments | | | employees_projects +---------------+---------+ | | | +---------------+---------+ | id | int |<-+ | +--| project_id | int | | name | varchar | +-----| employee_id | int | +---------------+---------+ +---------------+---------+
1) SELECT EMPLOYEES FROM
DEPARTMENT WHERE SALARY IS GREATER THAN 40K
select concat(employees.first_name,' ',employees.last_name) as employee_name,names from employees,departments where employees.department_id=departments.id group by employees.id,employees.salary having employees.salary > 40000;
SQL question challenge (Employee Boss)
DDL Scripts :
Employee table
create table employee(employee_id integer,department_id integer,boss_id
integer,name varchar(50),salary integer); insert into employee values(1,1,2,'John Smith',20000); insert into employee values(2,5,4,'Ava Muffinson',10000); insert into employee values(3,2,5,'Cailin Ninson',30000); insert into employee values(4,2,5,'Mike Peterson',20000); insert into employee values(5,2,1,'Ian Peterson',80000); insert into employee values(6,3,null,'John Mills',50000); +----+------------+-----------+--------+---------------+ | id | first_name | last_name | salary | department_id | +----+------------+-----------+--------+---------------+ | 1 | John | Smith | 20000 | 1 | | 2 | Ava | Muffinson | 10000 | 5 | | 3 | Cailin | Ninson | 30000 | 2 | | 4 | Mike | Peterson | 20000 | 2 | | 5 | Ian | Peterson | 80000 | 2 | | 6 | John | Mills | 50000 | 3 | +----+------------+-----------+--------+---------------+
Friday, December 28, 2018
Friday, October 26, 2018
System design Twitter
Overview
Designing the architecture of Twitter and similar social networks is a popular engineering interview question asked at companies like LinkedIn, Microsoft, Google, Snapchat, NVidia and others.No solution is right or wrong and might have trade-offs.Let's try our best to take different features and design a high level solution to the problem.
Approach
When we design a system. we first need to list the features what we need.Lets build the system feature by feature and later test for performance and improve on it.
Let us consider 3 main features of twitter system
1.TweetingThis would have all the tweets.
2.Timeline
-User
List of all the tweets within that timeline.Content of this would be less as this would be the list of
tweets that the user has done at a particular timeline
-Home
List of all the tweets of the users whom we are following. Each users might have thousands of tweets at a particular timeline.
3.Following
These are the list of the users that we are following. This would not dynamically change and would have less load on the system
Subscribe to:
Posts (Atom)
Labels
- Algorithms (52)
- Apache Kafka (7)
- Apache Spark (21)
- Architecture (8)
- Arrays (23)
- Big Data (98)
- Cloud services (6)
- Cognitive technologies (12)
- Data Analytics (3)
- Data Science (6)
- Design (1)
- Hadoop (26)
- Hive (11)
- Java (2)
- JavaScript (65)
- JavaScript Run-time (12)
- Machine learning (11)
- Maths (6)
- MySQL (1)
- Networking (3)
- No SQL (2)
- Node (20)
- Python (28)
- SQL (40)
- Security (4)
- Spark Grpahx (1)
- Spark MLlib (1)
- Spark Sql (3)
- Spark Streaming (4)
- Sqoop (2)
- Strings (13)
- devOps (1)
- mongoDb (2)
- ssis (3)

