@manhnguyenv

Welcome to my blog!

Dev

December 13, 2017 11:31

Tự ôn tập phỏng vấn về lập trình (Coding Interview University)

https://github.com/jwasham/coding-interview-university/blob/master/translations/README-vi.md

Tree to List in JavaScript

https://danmartensen.svbtle.com/converting-a-tree-to-a-list-in-javascript

function convertTreeToList(root) {

    var stack = [], array = [], hashMap = {};

    stack.push(root);

    while(stack.length !== 0) {

        var node = stack.pop();

        if(node.children === null) {

            visitNode(node, hashMap, array);

        } else {

            for(var i = node.children.length - 1; i >= 0; i--) {

                stack.push(node.children[i]);

            }

        }

    }

    return array;

}

 

function visitNode(node, hashMap, array) {

    if(!hashMap[node.data]) {

        hashMap[node.data] = true;

        array.push(node);

    }

}

 

var tree = {

  "data": null,

  "children": [

    {

      "data": "A",

      "children": null

    },

    {

      "data": "B",

      "children": null

    },

    {

      "data": null,

      "children": [

        {

          "data": "C",

          "children": null

        },

        {

          "data": "D",

          "children": null

        },

        {

          "data": "A",

          "children": null

        }

      ]

    }

  ]

}

 

// intial tree has leaf nodes A, B, C, D, A

console.log(tree);

 

// do conversion

var array = convertTreeToList(tree);

 

// converts to list of A, B, C, D

// removes duplicates and preserves order

console.log(array);

JavaScript Type Checking

https://danmartensen.svbtle.com/type-checking-techniques-in-javascript-part-1

https://danmartensen.svbtle.com/type-checking-techniques-in-javascript-part-2

Map, Filter & Reduce

https://code.tutsplus.com/tutorials/how-to-use-map-filter-reduce-in-javascript--cms-26209

http://cryto.net/~joepie91/blog/2015/05/04/functional-programming-in-javascript-map-filter-reduce/

https://danmartensen.svbtle.com/javascripts-map-reduce-and-filter

var tasks = [
{
'name' : 'Write for Envato Tuts+',
'duration' : 120
},
{
'name' : 'Work out',
'duration' : 60
},
{
'name' : 'Procrastinate on Duolingo',
'duration' : 240
}
];

var task_names = [];
for (var i = 0, max = tasks.length; i < max; i += 1) {
task_names.push(tasks[i].name);
}

var task_names = [];
tasks.forEach(function (task) {
task_names.push(task.name);
});

var task_names = tasks.map(function (task, index, array) {
return task.name;
});

var task_names = tasks.map((task) => task.name );

----------
var map = function (array, callback) {
var new_array = [];
array.forEach(function (element, index, array) {
new_array.push(callback(element));
});
return new_array;
};

var task_names = map(tasks, function (task) {
return task.name;
});

Cache

http://johnnycoder.com/blog/2008/12/10/c-cache-helper-class/

Chrome tools

https://viblo.asia/p/mot-so-chrome-extensions-huu-ich-danh-cho-viec-test-web-apps-GrLZD9vElk0

https://viblo.asia/p/top-chrome-extensions-danh-cho-viec-test-web-apps-ZjlvawjneqJ

Paging HTML using JavaScript

http://dotnet-munesh.blogspot.in/2016/08/paging-in-html-table-using-javascript.html

JavaScript frameworks

https://www.infoworld.com/article/3229747/javascript/the-10-essential-tools-for-javascript-developers.html

All the C# versions

http://dotnetcrunch.com/list-of-c-new-features-by-version/

Exception

  1. Syntactical Error
  2. Compilation Error
  3. Runtime Error
    1. Argument Exception
    2. ArgumentNullException
    3. ArithmeticException
    4. IndexOutOfRange
    5. NullReferenceException
    6. InSufficientException
    7. and others

Object-oriented Programming in C# for C and Java programmers

http://people.cs.aau.dk/~normark/oop-csharp/html/notes/theme-index.html

The System.Collections namespace includes following non-generic collections.

  1. ArrayList
  2. SortedList
  3. Hashtable
  4. BitArray
  5. Stack
  6. Queue

Read more http://dotnetcrunch.com/what-are-non-generic-collections-in-c/

The System.Collections.Genrics namespace includes following generic collections.

  1. List<T>
  2. SortedList<TKey, TValue>
  3. Hashset<T>
  4. Dictionary<Tkey, TValue>
  5. Stack<T>
  6. Queue<T>

Read more http://dotnetcrunch.com/generic-collections-c-example/

Differences between cookies and sessions?

http://www.devshed.com/c/a/PHP/Sessions-and-Cookies/

Sessions are server-side files that contain user information, while Cookies are client-side files that contain user information. Sessions have a unique identifier that maps them to specific users. This identifier can be passed in the URL or saved into a session cookie.

Most modern sites use the second approach, saving the identifier in a Cookie instead of passing it in a URL (which poses a security risk). You are probably using this approach without knowing it, and by deleting the cookies you effectively erase their matching sessions as you remove the unique session identifier contained in the cookies.

Cookies và một số vấn đề bảo mật

https://whitehat.vn/threads/web12-http-cookie-va-mot-so-van-de-bao-mat-phan-1.1948/

Cookies và Session trong ASP.NET

https://anhthienad.com/blog/so-sanh-cookie-va-session-trong-asp-net.html

  • Địa chỉ URL của website mà trình duyệt nhận cookie
  • Thời gian tồn tại của Cookie
  • Giá trị lưu trữ

Cookies trong ASP.NET

  • Name: Tên Cookie.
  • Domain: Tên miền của Cookie lưu trữ.
  • Expires: Xác định thời gian hiệu lực của Cookie.
  • Value: Giá trị của Cookie.
  • HasKeys: Cho biết Cookie có tập giá trị con hay không.
  • Values: Tập các giá trị của Cookie.

Những câu hỏi thường gặp:

- Introduce yourself and your experiences
- Decrible lastest projects: role, module implemented
- Compare Winform vs Webform
- C# :
   + Abstract class vs Interface. When use ?
   + Allow multi inheritance or not ?
   + Singleton vs Static Class
   + Delegate
   + Threadsafe: What is it? Purpose ?
   + Hashtable: Define and How to add item to hashtable
   + Aggregation vs composition
- SQL
   + Rate yourself from 1 to 10 ?
   + Cluster Index vs Non-clusterIndex
   + Table variable vs temp table
   + Write a query with group by having (Renga will give the requirement) 

Củng cố lại các phần sau:

- Basic T-SQL Statements (SELECT/ UPDATE/ INSERT/ DELETE …)
- JOIN clauses (INNER JOIN/ FULL JOIN/ LEFT JOIN/ RIGHT JOIN/ CROSS JOIN)
- Aggregation functions (COUNT/ MAX …)
- EXIST operator/ IN
- Date functions (DATEADD/ DATEDIFF …)
- Ranking functions (PARTITION BY …OVER/ ROW_NUMBER() …)
- Temporary table, variable table, using cursor.
- CASE… WHEN clause
- Advanced subjects (nice to have): PIVOT/ UNPIVOT/ Performance tuning/ CTE …
- Design patterns, WPF, Dependency Injection (Unity framework)

Categories

Recent posts