1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
Challenge 1: "Create a smallest script in terms of size that on
execution doesn't throw any error. The script doesn't have to do anything
special. You could even come up with smallest one-liner."
My notes: Umm, if it doesn't have to do anything special, and we want it to
be tiny, does it have to do anything at all? Why not write the shortest
Perl one-liner: perl -e 1:-)
Challenge 2: "Create a script to implement full text search functionality
using Inverted Index. According to wikipedia:
In computer science, an inverted index (also referred to as a
postings file or inverted file) is a database index storing
a mapping from content, such as words or numbers, to its
locations in a table, or in a document or a set of documents
(named in contrast to a forward index, which maps from documents
to content). The purpose of an inverted index is to allow fast
full-text searches, at a cost of increased processing when a
document is added to the database."
My notes: One extreme to the other, an inverted index might be quite a
lot of work. Most especially, it would need an index-creator/updater
and a search-using-index tool. Also, the wikipedia article says that
some inverted indexes are:
wordindocument: word -> set of document (names or numbers),
whereas others are:
wordwhereindocuments: word -> set of (document, position)
(or perhaps set of word -> set of document -> list of position)
Knowing the positions of each word in each document allows us to
search for several words "near to each other", so that's very useful.
But does the question want us to do that or not? Minimalism says not:-)
|